11name : Ensure parseable builds on all release targets
2-
32on :
43 pull_request :
54 paths-ignore :
6- - " docs/**"
7- - " helm/**"
8- - " assets/**"
5+ - docs/**
6+ - helm/**
7+ - assets/**
98 - " **.md"
10-
119jobs :
1210 # Default build without Kafka
1311 build-default :
@@ -30,15 +28,12 @@ jobs:
3028 # Windows build
3129 - os : windows-latest
3230 target : x86_64-pc-windows-msvc
33-
3431 steps :
3532 - uses : actions/checkout@v4
36-
3733 - name : Setup Rust toolchain
3834 uses : dtolnay/rust-toolchain@stable
3935 with :
4036 targets : ${{ matrix.target }}
41-
4237 - name : Cache dependencies
4338 uses : actions/cache@v4
4439 with :
@@ -47,14 +42,12 @@ jobs:
4742 ~/.cargo/git
4843 target
4944 key : ${{ runner.os }}-cargo-${{ matrix.target }}-default-${{ hashFiles('**/Cargo.lock') }}
50-
5145 - name : Build
5246 uses : actions-rs/cargo@v1
5347 with :
5448 use-cross : ${{ runner.os == 'Linux' }}
5549 command : build
5650 args : --target ${{ matrix.target }} --release
57-
5851 # Kafka build for supported platforms
5952 build-kafka :
6053 name : Build Kafka ${{matrix.target}}
6861 target : x86_64-unknown-linux-gnu
6962 - os : macos-latest
7063 target : aarch64-apple-darwin
71-
7264 steps :
7365 - uses : actions/checkout@v4
74-
7566 # Linux-specific dependencies
7667 - name : Install Linux dependencies
7768 if : runner.os == 'Linux'
9081 python3 \
9182 gcc-aarch64-linux-gnu \
9283 g++-aarch64-linux-gnu
93-
9484 # Install cross-compilation specific packages
9585 if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
9686 sudo apt-get install -y \
10191 libssl-dev:arm64 \
10292 pkg-config-aarch64-linux-gnu
10393 fi
104-
105-
10694 # macOS-specific dependencies
10795 - name : Install macOS dependencies
10896 if : runner.os == 'macOS'
@@ -116,12 +104,10 @@ jobs:
116104 openssl@3.0 \
117105 cyrus-sasl \
118106 python3
119-
120107 - name : Setup Rust toolchain
121108 uses : dtolnay/rust-toolchain@stable
122109 with :
123110 targets : ${{ matrix.target }}
124-
125111 - name : Cache dependencies
126112 uses : actions/cache@v4
127113 with :
@@ -130,7 +116,48 @@ jobs:
130116 ~/.cargo/git
131117 target
132118 key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{ hashFiles('**/Cargo.lock') }}
133-
119+ - name : Find and fix librdkafka CMakeLists.txt for Linux
120+ if : runner.os == 'Linux'
121+ run : |
122+ cargo fetch
123+ # Find the rdkafka-sys package directory
124+ RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
125+ echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
126+ # Find the librdkafka CMakeLists.txt file
127+ CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
128+ if [ -f "$CMAKE_FILE" ]; then
129+ echo "Found CMakeLists.txt at: $CMAKE_FILE"
130+ # Make a backup of the original file
131+ cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
132+ # Replace the minimum required version
133+ sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
134+ echo "Modified CMakeLists.txt - before and after comparison:"
135+ diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
136+ else
137+ echo "Could not find librdkafka CMakeLists.txt file!"
138+ exit 1
139+ fi
140+ - name : Find and fix librdkafka CMakeLists.txt for macOS
141+ if : runner.os == 'macOS'
142+ run : |
143+ cargo fetch
144+ # Find the rdkafka-sys package directory
145+ RDKAFKA_SYS_DIR=$(find ~/.cargo/registry/src -name "rdkafka-sys-*" -type d | head -n 1)
146+ echo "Found rdkafka-sys at: $RDKAFKA_SYS_DIR"
147+ # Find the librdkafka CMakeLists.txt file
148+ CMAKE_FILE="$RDKAFKA_SYS_DIR/librdkafka/CMakeLists.txt"
149+ if [ -f "$CMAKE_FILE" ]; then
150+ echo "Found CMakeLists.txt at: $CMAKE_FILE"
151+ # Make a backup of the original file
152+ cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
153+ # Replace the minimum required version - macOS requires '' after -i
154+ sed -i '' 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
155+ echo "Modified CMakeLists.txt - before and after comparison:"
156+ diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
157+ else
158+ echo "Could not find librdkafka CMakeLists.txt file!"
159+ exit 1
160+ fi
134161 - name : Build with Kafka
135162 uses : actions-rs/cargo@v1
136163 with :
@@ -140,9 +167,9 @@ jobs:
140167 env :
141168 LIBRDKAFKA_SSL_VENDORED : 1
142169 PKG_CONFIG_ALLOW_CROSS : " 1"
143- PKG_CONFIG_PATH : " /usr/lib/aarch64-linux-gnu/pkgconfig"
144- SASL2_DIR : " /usr/lib/aarch64-linux-gnu"
145- OPENSSL_DIR : " /usr/lib/aarch64-linux-gnu"
146- OPENSSL_ROOT_DIR : " /usr/lib/aarch64-linux-gnu"
170+ PKG_CONFIG_PATH : /usr/lib/aarch64-linux-gnu/pkgconfig
171+ SASL2_DIR : /usr/lib/aarch64-linux-gnu
172+ OPENSSL_DIR : /usr/lib/aarch64-linux-gnu
173+ OPENSSL_ROOT_DIR : /usr/lib/aarch64-linux-gnu
147174 OPENSSL_STATIC : " 1"
148- SASL2_STATIC : " 0"
175+ SASL2_STATIC : " 0"
0 commit comments