Skip to content

Commit 601ac11

Browse files
committed
Unblock aws-lc-sys cross-compile in CI
The new bpi rev pulled reqwest 0.13, whose `rustls` feature forces aws-lc-rs as the rustls crypto provider via cargo feature unification. aws-lc-sys then has to cross-compile its bundled C, which the napi-rs docker images can't do out of the box: - x86_64-unknown-linux-gnu: aws-lc-sys probes the compiler with -fuse-ld=lld and the image has no lld installed. - aarch64-unknown-linux-gnu: the image pre-sets CC_aarch64_unknown_linux_gnu and CFLAGS pointing at its custom cross toolchain under /usr/aarch64-unknown-linux-gnu, whose sysroot is missing stdatomic.h. The previous exports just sat alongside the docker's values without overriding them, so aws-lc-sys was still picking up the broken sysroot. Install lld and, on aarch64, unset the inherited env before exporting the Debian cross toolchain values so they actually take effect. This is the smallest fix that keeps rustls in place. The alternative was patching bpi to use reqwest's `rustls-no-provider` plus an explicit ring provider, which would have required a runtime CryptoProvider::install_default() call and another upstream fork bump.
1 parent 75263c2 commit 601ac11

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/CI.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ jobs:
7171
target: x86_64-unknown-linux-gnu
7272
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
7373
build: |
74+
set -e
75+
apt-get update
76+
apt-get install -y lld
7477
rustup install $RUST_VERSION
7578
rustup default $RUST_VERSION
7679
rustup target add x86_64-unknown-linux-gnu
@@ -94,7 +97,16 @@ jobs:
9497
build: |
9598
set -e
9699
apt-get update
97-
apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
100+
apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross lld
101+
# The napi-rs docker image pre-sets CC_aarch64_unknown_linux_gnu and
102+
# CFLAGS pointing to its custom cross-toolchain at
103+
# /usr/aarch64-unknown-linux-gnu, whose sysroot lacks stdatomic.h.
104+
# Unset and switch to the Debian cross-toolchain so aws-lc-sys
105+
# can find C11 atomics.
106+
unset CFLAGS
107+
unset CC_aarch64_unknown_linux_gnu
108+
unset CXX_aarch64_unknown_linux_gnu
109+
unset AR_aarch64_unknown_linux_gnu
98110
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
99111
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
100112
export AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar

0 commit comments

Comments
 (0)