@@ -102,7 +102,6 @@ jobs:
102
102
pkg-config-aarch64-linux-gnu
103
103
fi
104
104
105
-
106
105
# macOS-specific dependencies
107
106
- name : Install macOS dependencies
108
107
if : runner.os == 'macOS'
@@ -130,10 +129,25 @@ jobs:
130
129
~/.cargo/git
131
130
target
132
131
key : ${{ runner.os }}-cargo-${{ matrix.target }}-kafka-${{ hashFiles('**/Cargo.lock') }}
133
-
134
- - name : Find and fix librdkafka CMakeLists.txt
132
+
133
+ - name : Build with Kafka
134
+ uses : actions-rs/cargo@v1
135
+ with :
136
+ use-cross : ${{ runner.os == 'Linux' }}
137
+ command : build
138
+ args : --target ${{ matrix.target }} --features kafka --release
139
+ env :
140
+ LIBRDKAFKA_SSL_VENDORED : 1
141
+ PKG_CONFIG_ALLOW_CROSS : " 1"
142
+ PKG_CONFIG_PATH : " /usr/lib/aarch64-linux-gnu/pkgconfig"
143
+ SASL2_DIR : " /usr/lib/aarch64-linux-gnu"
144
+ OPENSSL_DIR : " /usr/lib/aarch64-linux-gnu"
145
+ OPENSSL_ROOT_DIR : " /usr/lib/aarch64-linux-gnu"
146
+ OPENSSL_STATIC : " 1"
147
+ SASL2_STATIC : " 0"
148
+ # Add the fix as a pre-run script right before cargo build runs
149
+ # This is a workaround since actions-rs/cargo doesn't support pre-commands
135
150
run : |
136
- # Download the package first so it's in the registry
137
151
cargo fetch
138
152
139
153
# Find the rdkafka-sys package directory
@@ -149,28 +163,19 @@ jobs:
149
163
# Make a backup of the original file
150
164
cp "$CMAKE_FILE" "$CMAKE_FILE.bak"
151
165
152
- # Replace the minimum required version
153
- sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
166
+ # Replace the minimum required version - with OS-specific syntax
167
+ if [ "${{ runner.os }}" == "macOS" ]; then
168
+ sed -i '' 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
169
+ else
170
+ sed -i 's/cmake_minimum_required(VERSION 3.2)/cmake_minimum_required(VERSION 3.5)/' "$CMAKE_FILE"
171
+ fi
154
172
155
173
echo "Modified CMakeLists.txt - before and after comparison:"
156
174
diff "$CMAKE_FILE.bak" "$CMAKE_FILE" || true
157
175
else
158
176
echo "Could not find librdkafka CMakeLists.txt file!"
159
177
exit 1
160
178
fi
161
-
162
- - name : Build with Kafka
163
- uses : actions-rs/cargo@v1
164
- with :
165
- use-cross : ${{ runner.os == 'Linux' }}
166
- command : build
167
- args : --target ${{ matrix.target }} --features kafka --release
168
- env :
169
- LIBRDKAFKA_SSL_VENDORED : 1
170
- PKG_CONFIG_ALLOW_CROSS : " 1"
171
- PKG_CONFIG_PATH : " /usr/lib/aarch64-linux-gnu/pkgconfig"
172
- SASL2_DIR : " /usr/lib/aarch64-linux-gnu"
173
- OPENSSL_DIR : " /usr/lib/aarch64-linux-gnu"
174
- OPENSSL_ROOT_DIR : " /usr/lib/aarch64-linux-gnu"
175
- OPENSSL_STATIC : " 1"
176
- SASL2_STATIC : " 0"
179
+
180
+ # Now run the actual build
181
+ cargo build --target ${{ matrix.target }} --features kafka --release
0 commit comments