1
- ---
2
1
name : Ensure parseable builds on all release targets
3
2
on :
4
3
pull_request :
@@ -116,10 +115,9 @@ jobs:
116
115
~/.cargo/registry
117
116
~/.cargo/git
118
117
target
119
- key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{
120
- hashFiles('**/Cargo.lock') }}
121
- - name : Find and fix librdkafka CMakeLists.txt
122
- if : runner.os == 'Linux' || runner.os == 'macOS'
118
+ key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{ hashFiles('**/Cargo.lock') }}
119
+ - name : Find and fix librdkafka CMakeLists.txt for Linux
120
+ if : runner.os == 'Linux'
123
121
run : |
124
122
cargo fetch
125
123
# Find the rdkafka-sys package directory
@@ -139,6 +137,27 @@ jobs:
139
137
echo "Could not find librdkafka CMakeLists.txt file!"
140
138
exit 1
141
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
142
161
- name : Build with Kafka
143
162
uses : actions-rs/cargo@v1
144
163
with :
@@ -153,4 +172,4 @@ jobs:
153
172
OPENSSL_DIR : /usr/lib/aarch64-linux-gnu
154
173
OPENSSL_ROOT_DIR : /usr/lib/aarch64-linux-gnu
155
174
OPENSSL_STATIC : " 1"
156
- SASL2_STATIC : " 0"
175
+ SASL2_STATIC : " 0"
0 commit comments