From 8424a83e8c3942332958ac7f5c3877e14ff5f0a3 Mon Sep 17 00:00:00 2001 From: Tim Paine Date: Fri, 2 Aug 2024 16:04:42 -0400 Subject: [PATCH] Build librdkafka with gssapi support for pip package, fixes #325 Signed-off-by: Tim Paine --- .github/workflows/build.yml | 4 +++- Makefile | 6 +++--- cpp/cmake/modules/FindDepsKafkaAdapter.cmake | 5 +++++ cpp/csp/adapters/kafka/CMakeLists.txt | 2 +- vcpkg | 2 +- vcpkg.json | 18 +++++++++++++++++- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fa3d75ed..7fbef6b34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,7 +326,9 @@ jobs: if: ${{ matrix.os == 'macos-12' }} - name: Python Build Steps (Macos arm) - run: make dist-py-cibw + run: | + make dist-py-cibw + cat /Users/runner/work/csp/csp/vcpkg/buildtrees/cyrus-sasl/autoconf-arm64-osx-err.log env: CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*" CIBW_ENVIRONMENT_MACOS: CCACHE_DIR="/Users/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="${{ env.VCPKG_DOWNLOADS }}" diff --git a/Makefile b/Makefile index 6c8bf66f0..0ac8d26e4 100644 --- a/Makefile +++ b/Makefile @@ -194,14 +194,14 @@ endif .PHONY: dependencies-mac dependencies-debian dependencies-fedora dependencies-vcpkg dependencies-win dependencies-mac: ## install dependencies for mac - HOMEBREW_NO_AUTO_UPDATE=1 brew install bison cmake flex make ninja + HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf bison cmake flex libtool make ninja brew unlink bison flex && brew link --force bison flex dependencies-debian: ## install dependencies for linux - apt-get install -y automake bison cmake curl flex ninja-build tar unzip zip + apt-get install -y autoconf automake bison cmake curl flex libtool ninja-build tar unzip zip dependencies-fedora: ## install dependencies for linux - yum install -y automake bison ccache cmake curl flex perl-IPC-Cmd tar unzip zip + yum install -y autoconf automake bison ccache cmake curl flex libtool perl-IPC-Cmd tar unzip zip dependencies-vcpkg: ## install dependencies via vcpkg cd vcpkg && ./bootstrap-vcpkg.sh && ./vcpkg install diff --git a/cpp/cmake/modules/FindDepsKafkaAdapter.cmake b/cpp/cmake/modules/FindDepsKafkaAdapter.cmake index ae652fe3f..219d5e2fe 100644 --- a/cpp/cmake/modules/FindDepsKafkaAdapter.cmake +++ b/cpp/cmake/modules/FindDepsKafkaAdapter.cmake @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.7.2) if (CSP_USE_VCPKG) find_package(RdKafka CONFIG REQUIRED) + if(NOT WIN32) + # Bad, but a temporary workaround for + # https://github.com/microsoft/vcpkg/issues/40320 + link_directories(${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib) + endif() else() find_package(RdKafka REQUIRED) endif() diff --git a/cpp/csp/adapters/kafka/CMakeLists.txt b/cpp/csp/adapters/kafka/CMakeLists.txt index 1bf0ae402..b5bd4e877 100644 --- a/cpp/csp/adapters/kafka/CMakeLists.txt +++ b/cpp/csp/adapters/kafka/CMakeLists.txt @@ -22,7 +22,7 @@ set_target_properties(csp_kafka_adapter PROPERTIES PUBLIC_HEADER "${KAFKA_HEADER find_package(DepsKafkaAdapter REQUIRED) -target_link_libraries(csp_kafka_adapter PRIVATE csp_adapter_utils RdKafka::rdkafka RdKafka::rdkafka++) +target_link_libraries(csp_kafka_adapter PUBLIC csp_adapter_utils RdKafka::rdkafka RdKafka::rdkafka++) install(TARGETS csp_kafka_adapter PUBLIC_HEADER DESTINATION include/csp/adapters/kafka diff --git a/vcpkg b/vcpkg index 1b5f73466..6af584dd5 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 1b5f7346612cd63910567df714d867f5b3fa8e3b +Subproject commit 6af584dd59aa5bdba75dae6781ec74614e03e5b9 diff --git a/vcpkg.json b/vcpkg.json index 7373e063e..30a25874d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,14 +7,30 @@ "boost-beast", "boost-multi-index", "brotli", + { + "name": "cyrus-sasl", + "platform": "!windows" + }, "exprtk", "gtest", + { + "name": "krb5", + "platform": "!windows" + }, { "name": "librdkafka", "features": [ + { + "name": "sasl", + "platform": "!windows" + }, "ssl" ] }, + { + "name": "lmdb", + "platform": "!windows" + }, "lz4", "openssl", "parquet", @@ -30,5 +46,5 @@ "port-version" : 1 } ], - "builtin-baseline": "1b5f7346612cd63910567df714d867f5b3fa8e3b" + "builtin-baseline": "6af584dd59aa5bdba75dae6781ec74614e03e5b9" }