Skip to content

Commit

Permalink
Add forward declaration to fix compilation without ssl (#4794)
Browse files Browse the repository at this point in the history
and add build checks with different configurations
  • Loading branch information
emasab authored Aug 5, 2024
1 parent 6eaf89f commit d72576a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ blocks:
commands:
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
jobs:
- name: 'Build configuration checks'
commands:
- wget -O rapidjson-dev.deb https://launchpad.net/ubuntu/+archive/primary/+files/rapidjson-dev_1.1.0+dfsg2-3_all.deb
- sudo dpkg -i rapidjson-dev.deb
- python3 -m pip install -U pip
- ./packaging/tools/build-configurations-checks.sh
- name: 'Build and integration tests'
commands:
- wget -O rapidjson-dev.deb https://launchpad.net/ubuntu/+archive/primary/+files/rapidjson-dev_1.1.0+dfsg2-3_all.deb
Expand Down
10 changes: 10 additions & 0 deletions packaging/tools/build-configurations-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
# Disable all flags to make sure it
# compiles correctly in all cases
./configure --install-deps --disable-ssl --disable-gssapi \
--disable-curl --disable-zlib \
--disable-zstd --disable-lz4-ext --disable-regex-ext \
--disable-c11threads --disable-syslog
make -j
make -j -C tests run_local_quick
1 change: 1 addition & 0 deletions src/rdkafka_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
typedef struct rd_kafka_q_s rd_kafka_q_t;
typedef struct rd_kafka_toppar_s rd_kafka_toppar_t;
typedef struct rd_kafka_op_s rd_kafka_op_t;
typedef struct rd_kafka_broker_s rd_kafka_broker_t;

/* One-off reply queue + reply version.
* All APIs that take a rd_kafka_replyq_t makes a copy of the
Expand Down
15 changes: 15 additions & 0 deletions tests/0133-ssl_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ static void do_test_ssl_keys(const char *type, rd_bool_t correct_password) {


int main_0133_ssl_keys(int argc, char **argv) {
rd_kafka_conf_t *conf;
char errstr[512];
rd_kafka_conf_res_t res;

test_conf_init(&conf, NULL, 10);

/* Check that we're linked/built with OpenSSL 3.x */
res = rd_kafka_conf_set(conf, "ssl.providers", "a,b", errstr,
sizeof(errstr));
rd_kafka_conf_destroy(conf);
if (res == RD_KAFKA_CONF_INVALID) {
TEST_SKIP("%s\n", errstr);
return 0;
}

do_test_ssl_keys("PKCS12", rd_true);
do_test_ssl_keys("PKCS12", rd_false);
do_test_ssl_keys("PEM", rd_true);
Expand Down

0 comments on commit d72576a

Please sign in to comment.