Skip to content

Commit 03452d0

Browse files
committed
fix(ci/edriver): add -L native=/usr/lib to RUSTFLAGS for zstd on Alpine
'-l static=zstd' in RUSTFLAGS causes rustc to validate the library exists at compile-time for every crate (including pure-Rust libs like cfg-if). Without an explicit -L path, rustc cannot locate libzstd.a and errors with 'could not find native static library zstd'. Fix: add '-L native=/usr/lib' alongside '-l static=zstd' so rustc knows where to find /usr/lib/libzstd.a (provided by zstd-static).
1 parent e5e0345 commit 03452d0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/ci-edriver.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ jobs:
3535
# Alpine libelf-static is musl-native but IS compiled WITH zstd.
3636
# We link against system zstd-static instead of using vendored-libelf
3737
# (vendored-libelf fails on musl because elfutils configure requires
38-
# glibc-only argp/fts). The extra '-l static=zstd' tells rustc to
39-
# include /usr/lib/libzstd.a when linking.
38+
# glibc-only argp/fts).
39+
# -l static=zstd: link /usr/lib/libzstd.a to resolve ZSTD_* refs
40+
# from libelf.a.
41+
# -L native=/usr/lib: required so rustc can locate libzstd.a at
42+
# compile-time (without this rustc rejects '-l static=zstd' even
43+
# for pure-Rust lib crates like cfg-if).
4044
cargo_extra_features: ""
41-
rustflags: "-C target-feature=+crt-static -l static=zstd"
45+
rustflags: "-C target-feature=+crt-static -L native=/usr/lib -l static=zstd"
4246
- arch: aarch64
4347
runner: ubuntu-24.04-arm
4448
target: aarch64-unknown-linux-musl

0 commit comments

Comments
 (0)