Skip to content

Commit 2d9803c

Browse files
authored
Update ldk-node and bpi (#42)
* Update ldk-node and bpi * 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 conflicts with the napi-rs docker images on the two gnu Linux targets: - x86_64-unknown-linux-gnu: aws-lc-sys passes `-fuse-ld=lld` to the compiler unconditionally. The image's custom `x86_64-unknown-linux-gnu-gcc` does not recognize the flag, but the image's clang (already CC=clang) does once lld is installed. - aarch64-unknown-linux-gnu: the image's custom cross toolchain at /usr/aarch64-unknown-linux-gnu has a sysroot missing stdatomic.h. Debian's gcc-aarch64-linux-gnu plus libc6-dev-arm64-cross provides the C11 atomics header. The catch is that aws-lc-sys reads TARGET_CC ahead of CC_<target> and CC. The image pre-sets TARGET_CC to its custom gcc, so any CC_<target> exports were ignored until we unset TARGET_CC (and TARGET_CXX, TARGET_AR) first. Same story for CFLAGS on aarch64, which the image pre-sets to the broken sysroot. 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. Keeping rustls's default provider was preferred since the CI fix is self-contained. Musl targets were not failing in the latest run. If they break later the same TARGET_CC unset trick should apply.
1 parent 78a326f commit 2d9803c

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

.github/workflows/CI.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ 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
77+
# The napi-rs image pre-sets TARGET_CC/TARGET_CXX to a custom gcc
78+
# that does not understand `-fuse-ld=lld`, which aws-lc-sys passes
79+
# unconditionally for x86_64. aws-lc-sys reads TARGET_CC ahead of
80+
# CC_<target> and CC, so we unset it so CC=clang (already in the
81+
# image) takes effect; clang supports -fuse-ld=lld with lld
82+
# installed.
83+
unset TARGET_CC TARGET_CXX TARGET_AR
7484
rustup install $RUST_VERSION
7585
rustup default $RUST_VERSION
7686
rustup target add x86_64-unknown-linux-gnu
@@ -94,7 +104,17 @@ jobs:
94104
build: |
95105
set -e
96106
apt-get update
97-
apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
107+
apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross lld
108+
# The napi-rs docker image pre-sets TARGET_CC and CFLAGS pointing
109+
# to its custom cross-toolchain at /usr/aarch64-unknown-linux-gnu,
110+
# whose sysroot lacks stdatomic.h. aws-lc-sys reads TARGET_CC
111+
# ahead of CC_<target>, so unset both and re-export the Debian
112+
# cross-toolchain values below.
113+
unset TARGET_CC TARGET_CXX TARGET_AR
114+
unset CFLAGS
115+
unset CC_aarch64_unknown_linux_gnu
116+
unset CXX_aarch64_unknown_linux_gnu
117+
unset AR_aarch64_unknown_linux_gnu
98118
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
99119
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
100120
export AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ tikv-jemallocator = { version = "0.6", features = ["disable_initial_exec_tls"] }
1414
# Branch: https://github.com/moneydevkit/bitcoin-payment-instructions/tree/2025-12-ldk-node-base
1515
# Pinned to the same git rev as ldk-node's transitive pull to avoid duplicate
1616
# crate compilation. Verify with `cargo tree -d | grep bitcoin-payment-instructions`.
17-
bitcoin-payment-instructions = { git = "https://github.com/moneydevkit/bitcoin-payment-instructions", rev = "bc7d03f", default-features = false, features = [
17+
bitcoin-payment-instructions = { git = "https://github.com/moneydevkit/bitcoin-payment-instructions", rev = "bdcef061488bcc619142010a2a69cd49462d8843", default-features = false, features = [
1818
"http",
1919
] }
2020
# Branch: https://github.com/moneydevkit/ldk-node/commits/lsp-0.7.0_accept-underpaying-htlcs_with_timing_logs
21-
ldk-node = { default-features = false, git = "https://github.com/moneydevkit/ldk-node.git", rev = "5616db4ed0db15534d6d92356fef8c5bad79acb1" }
21+
ldk-node = { default-features = false, git = "https://github.com/moneydevkit/ldk-node.git", rev = "f13fcead7e02ef4b77489a83854f204de11e902b" }
2222
#ldk-node = { path = "../ldk-node" }
2323

2424
napi = { version = "2", features = ["napi4"] }

0 commit comments

Comments
 (0)