Skip to content

Commit 8442969

Browse files
Fix aarch64 Linux Kafka build with QEMU and nightly Rust
1 parent ffdf597 commit 8442969

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.github/workflows/build.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- uses: actions/checkout@v4
3838

3939
- name: Setup Rust toolchain
40-
uses: dtolnay/rust-toolchain@stable
40+
uses: dtolnay/rust-toolchain@nightly
4141
with:
4242
targets: ${{ matrix.target }}
4343

@@ -135,7 +135,7 @@ jobs:
135135
python3
136136
137137
- name: Setup Rust toolchain
138-
uses: dtolnay/rust-toolchain@stable
138+
uses: dtolnay/rust-toolchain@nightly
139139
with:
140140
targets: ${{ matrix.target }}
141141

@@ -201,7 +201,14 @@ jobs:
201201
env:
202202
LIBRDKAFKA_SSL_VENDORED: "1"
203203
PKG_CONFIG_ALLOW_CROSS: "1"
204-
run: cross build --target ${{ matrix.target }} --features kafka --release
204+
ZLIB_INCLUDE_DIR: "/usr/include/aarch64-linux-gnu"
205+
ZLIB_LIBRARY: "/usr/lib/aarch64-linux-gnu/libz.so"
206+
OPENSSL_DIR: "/usr"
207+
OPENSSL_LIB_DIR: "/usr/lib/aarch64-linux-gnu"
208+
OPENSSL_INCLUDE_DIR: "/usr/include/aarch64-linux-gnu"
209+
CROSS_NO_WARNINGS: "0"
210+
RUST_BACKTRACE: "1"
211+
run: cross build --target ${{ matrix.target }} --features kafka --release --verbose
205212

206213
- name: Build with Kafka (native)
207214
if: ${{ !matrix.use_cross }}

Cross.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:1e2a0291f92a4372cbc22
33
pre-build = [
44
"dpkg --add-architecture arm64",
55
"apt-get update || true",
6-
"apt-get install -y pkg-config:arm64 || true",
7-
"apt-get install -y zlib1g-dev:arm64 || true",
8-
"apt-get install -y libssl-dev:arm64 || true",
9-
"apt-get install -y libsasl2-dev:arm64 || true",
10-
"apt-get install -y libzstd-dev:arm64 || true",
11-
"apt-get install -y liblz4-dev:arm64 || true",
6+
"apt-get install -y pkg-config:arm64 zlib1g-dev:arm64 libssl-dev:arm64 libsasl2-dev:arm64 libzstd-dev:arm64 liblz4-dev:arm64 || true",
127
]
138

149
[target.aarch64-unknown-linux-gnu.env]
1510
passthrough = [
1611
"LIBRDKAFKA_SSL_VENDORED",
1712
"PKG_CONFIG_ALLOW_CROSS",
13+
"ZLIB_INCLUDE_DIR",
14+
"ZLIB_LIBRARY",
15+
"OPENSSL_DIR",
16+
"OPENSSL_LIB_DIR",
17+
"OPENSSL_INCLUDE_DIR",
18+
"CROSS_NO_WARNINGS",
19+
"RUST_BACKTRACE",
20+
]
21+
volumes = [
22+
"/usr/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu:ro",
23+
"/usr/include/aarch64-linux-gnu:/usr/include/aarch64-linux-gnu:ro",
1824
]
1925

2026
[target.x86_64-unknown-linux-gnu]

0 commit comments

Comments
 (0)