From 9a218707ca8877b07f28a464ce18f3408905329f Mon Sep 17 00:00:00 2001 From: anant Date: Thu, 3 Apr 2025 14:44:10 +0530 Subject: [PATCH] Update to coverage Github action fails because the runner's minimum supported version for CMAKE is 3.5 whereas the minimum version mentioned in `librdkafka` is 3.2 This PR introduces a (hopefully temporary) change which fetches the crates and modifies the `CMakeLists.txt` of `librdkafka` before installation --- .github/workflows/coverage.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index b15ce9964..ccf2be332 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -33,6 +33,34 @@ jobs: pkg-config \ build-essential if: runner.os == 'Linux' + + - name: Find and fix librdkafka CMakeLists.txt + run: | + # Download the package first so it's in the registry + cargo fetch + + # Find the rdkafka-sys package directory + RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1) + echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR" + + # Find the librdkafka CMakeLists.txt file + CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt" + + if [ -f "$CMAKE_FILE" ]; then + echo "Found CMakeLists.txt at: $CMAKE_FILE" + + # Make a backup of the original file + cp "$CMAKE_FILE" "$CMAKE_FILE.bak" + + # Replace the minimum required version + sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE" + + echo "Modified CMakeLists.txt - before and after comparison:" + diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true + else + echo "Could not find librdkafka CMakeLists.txt file!" + exit 1 + fi - name: Check with clippy env: