1
1
name : Ensure parseable builds on all release targets
2
-
3
2
on :
4
3
pull_request :
5
4
paths-ignore :
6
- - " docs/**"
7
- - " helm/**"
8
- - " assets/**"
5
+ - docs/**
6
+ - helm/**
7
+ - assets/**
9
8
- " **.md"
10
-
11
9
jobs :
12
10
# Default build without Kafka
13
11
build-default :
@@ -30,15 +28,12 @@ jobs:
30
28
# Windows build
31
29
- os : windows-latest
32
30
target : x86_64-pc-windows-msvc
33
-
34
31
steps :
35
32
- uses : actions/checkout@v4
36
-
37
33
- name : Setup Rust toolchain
38
34
uses : dtolnay/rust-toolchain@stable
39
35
with :
40
36
targets : ${{ matrix.target }}
41
-
42
37
- name : Cache dependencies
43
38
uses : actions/cache@v4
44
39
with :
@@ -47,14 +42,12 @@ jobs:
47
42
~/.cargo/git
48
43
target
49
44
key : ${{ runner.os }}-cargo-${{ matrix.target }}-default-${{ hashFiles('**/Cargo.lock') }}
50
-
51
45
- name : Build
52
46
uses : actions-rs/cargo@v1
53
47
with :
54
48
use-cross : ${{ runner.os == 'Linux' }}
55
49
command : build
56
50
args : --target ${{ matrix.target }} --release
57
-
58
51
# Kafka build for supported platforms
59
52
build-kafka :
60
53
name : Build Kafka ${{matrix.target}}
68
61
target : x86_64-unknown-linux-gnu
69
62
- os : macos-latest
70
63
target : aarch64-apple-darwin
71
-
72
64
steps :
73
65
- uses : actions/checkout@v4
74
-
75
66
# Linux-specific dependencies
76
67
- name : Install Linux dependencies
77
68
if : runner.os == 'Linux'
90
81
python3 \
91
82
gcc-aarch64-linux-gnu \
92
83
g++-aarch64-linux-gnu
93
-
94
84
# Install cross-compilation specific packages
95
85
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
96
86
sudo apt-get install -y \
101
91
libssl-dev:arm64 \
102
92
pkg-config-aarch64-linux-gnu
103
93
fi
104
-
105
-
106
94
# macOS-specific dependencies
107
95
- name : Install macOS dependencies
108
96
if : runner.os == 'macOS'
@@ -116,12 +104,10 @@ jobs:
116
104
117
105
cyrus-sasl \
118
106
python3
119
-
120
107
- name : Setup Rust toolchain
121
108
uses : dtolnay/rust-toolchain@stable
122
109
with :
123
110
targets : ${{ matrix.target }}
124
-
125
111
- name : Cache dependencies
126
112
uses : actions/cache@v4
127
113
with :
@@ -130,7 +116,48 @@ jobs:
130
116
~/.cargo/git
131
117
target
132
118
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
134
161
- name : Build with Kafka
135
162
uses : actions-rs/cargo@v1
136
163
with :
@@ -140,9 +167,9 @@ jobs:
140
167
env :
141
168
LIBRDKAFKA_SSL_VENDORED : 1
142
169
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
147
174
OPENSSL_STATIC : " 1"
148
- SASL2_STATIC : " 0"
175
+ SASL2_STATIC : " 0"
0 commit comments