diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index cd6c173944..6cc47cfb3c 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -118,10 +118,12 @@ blocks: 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 + - ./packaging/tools/build-configurations-checks.sh make quay.io/pypa/manylinux_2_28_x86_64:2024.07.01-1 + - ./packaging/tools/build-configurations-checks.sh cmake quay.io/pypa/manylinux_2_28_x86_64:2024.07.01-1 + - ./packaging/tools/build-configurations-checks.sh make alpine:3.16.9 + - ./packaging/tools/build-configurations-checks.sh cmake alpine:3.16.9 + - name: 'Build and integration tests with "classic" protocol' commands: - wget -O rapidjson-dev.deb https://launchpad.net/ubuntu/+archive/primary/+files/rapidjson-dev_1.1.0+dfsg2-3_all.deb diff --git a/packaging/tools/build-configurations-checks.sh b/packaging/tools/build-configurations-checks.sh index 6001fa9cc8..f94e688973 100755 --- a/packaging/tools/build-configurations-checks.sh +++ b/packaging/tools/build-configurations-checks.sh @@ -1,11 +1,57 @@ -#!/bin/bash +#!/bin/sh set -e + +build_tool="$1" +docker_image="$2" + +if [ -n "$docker_image" ]; then + echo "Running in docker image: $docker_image" + # Running on the host, spin up the docker builder. + exec docker run -v "$PWD:/v" -w /v $docker_image ./packaging/tools/build-configurations-checks.sh $build_tool + # Only reached on exec error + exit $? +fi + +if [ -z "$build_tool" ]; then + # Default to using make if no build tool is specified. + build_tool="make" +fi + +if grep -q alpine /etc/os-release 2>/dev/null ; then + # Alpine + apk add \ + bash gcc g++ make $build_tool git bsd-compat-headers +fi + +# Clone the repo so other builds are unaffected of what we're doing +# and we get a pristine build tree. +git config --system --add safe.directory '/v/.git' +git config --system --add safe.directory '/librdkafka/.git' +git clone /v /librdkafka + +cd /librdkafka + # Disable all flags to make sure it # compiles correctly in all cases -./configure --install-deps --disable-ssl --disable-gssapi \ +if [ "$build_tool" = "make" ]; then +./configure --disable-ssl --disable-gssapi \ --disable-curl --disable-zlib \ --disable-zstd --disable-lz4-ext --disable-regex-ext \ --disable-c11threads --disable-syslog \ --enable-werror --enable-devel +cat ./config.h +else +cmake -DWITH_SSL=OFF -DWITH_SASL_CYRUS=OFF \ + -DWITH_CURL=OFF -DWITH_ZLIB=OFF \ + -DWITH_ZSTD=OFF -DHAVE_REGEX=OFF -DWITH_C11THREADS=OFF \ + -DWITH_LIBDL=OFF +cat ./generated/config.h +fi make -j + +export CI=true +if [ "$build_tool" = "make" ]; then make -j -C tests run_local_quick +else +ctest -VV -R RdKafkaTestBrokerLessQuick --output-on-failure +fi diff --git a/src/rdkafka_conf.c b/src/rdkafka_conf.c index f0803248b6..e66e5cb6ca 100644 --- a/src/rdkafka_conf.c +++ b/src/rdkafka_conf.c @@ -56,7 +56,7 @@ #include #endif -#ifdef WITH_OAUTHBEARER_OIDC +#if WITH_OAUTHBEARER_OIDC #include #endif diff --git a/tests/0066-plugins.cpp b/tests/0066-plugins.cpp index 7b5e7b00fb..e5705354e5 100644 --- a/tests/0066-plugins.cpp +++ b/tests/0066-plugins.cpp @@ -69,6 +69,20 @@ static void do_test_plugin() { NULL, }; + RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); + if (conf->set("plugin.library.paths", + "interceptor_test/interceptor_test_dummy", errstr) && + errstr.find( + "Configuration property \"plugin.library.paths\" not supported") != + std::string::npos) { + delete conf; + Test::Skip( + "Configuration property \"plugin.library.paths\" not supported in this " + "build\n"); + return; + } + delete conf; + char cwd[512], *pcwd; #ifdef _WIN32 pcwd = _getcwd(cwd, sizeof(cwd) - 1); @@ -84,7 +98,7 @@ static void do_test_plugin() { ictest_cnt_init(&ictest.on_new, 1, 1); /* Config for intercepted client */ - RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); + conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); for (int i = 0; config[i]; i += 2) { Test::Say(tostr() << "set(" << config[i] << ", " << config[i + 1] << ")\n"); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e509092873..cacd012657 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -162,6 +162,7 @@ target_link_libraries(test-runner PUBLIC rdkafka++) add_test(NAME RdKafkaTestInParallel COMMAND test-runner -p5) add_test(NAME RdKafkaTestSequentially COMMAND test-runner -p1) add_test(NAME RdKafkaTestBrokerLess COMMAND test-runner -p5 -l) +add_test(NAME RdKafkaTestBrokerLessQuick COMMAND test-runner -p5 -l -Q) if(NOT WIN32 AND NOT APPLE) set(tests_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})