Skip to content

Commit cdb03ba

Browse files
committed
Add rust-src and std's crates to the builder image
For building std with panic = "immediate-abort", which comes next.
1 parent 8bd66a5 commit cdb03ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎native/Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@ FROM rust:1.99.1-alpine3.24@sha256:44819b27be4c97b0e4d7203bd2e02c4820f97700211b6
66
LABEL org.opencontainers.image.source=https://github.com/composer/zstd
77
LABEL org.opencontainers.image.description="Toolchain that builds the zstd-extract Linux binaries of composer/zstd"
88

9-
# gcc compiles the zstd decoder and links, Rust's std needs libunwind; musl needs fortify-headers for _FORTIFY_SOURCE to do anything
9+
# gcc compiles the zstd decoder and links; std's link line needs libunwind, though none of it ends up in the binary
10+
# with panic = "immediate-abort"; musl needs fortify-headers for _FORTIFY_SOURCE to do anything
1011
RUN apk add --no-cache gcc musl-dev fortify-headers llvm-libunwind-static
12+
13+
# std is rebuilt from rust-src (see Cargo.toml), and the builds run offline: fetch the crates it depends on now
14+
RUN rustup component add rust-src \
15+
&& RUSTC_BOOTSTRAP=1 cargo fetch --locked --manifest-path "$(rustc --print sysroot)/lib/rustlib/src/rust/library/Cargo.toml"

0 commit comments

Comments
 (0)