Source

FROM stagex/pallet-clang
COPY --from=stagex/core-rust . /
COPY --from=stagex/core-git . /
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-libunwind . /
COPY --from=stagex/core-openssl . /
COPY --from=stagex/core-ca-certificates . /
COPY --from=stagex/core-curl . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-pkgconf . /

# The following MUST be done with the same version of LLVM used to build Rust
# While that would imply `core-rust` should provide these definitions, they _cannot_ be symlinks
# We can use hard links here, as we add `pallet-clang` first, but in `core-rust` we'd have to `cp`

# Populate Rust's self-contained toolchain's linker
# https://github.com/rust-lang/rust/blob/44e34e1ac6d7e69b40856cf1403d3da145319c30/src/bootstrap/src/core/build_steps/dist.rs#L581-L601
# https://github.com/rust-lang/rust/blob/44e34e1ac6d7e69b40856cf1403d3da145319c30/src/bootstrap/src/lib.rs#L79-L80
RUN mkdir -p /usr/lib/rustlib/$(uname -m)-unknown-linux-musl/bin/gcc-ld
RUN ln /bin/lld /usr/lib/rustlib/$(uname -m)-unknown-linux-musl/bin/rust-lld
RUN for bin in ld64.lld ld.lld lld-link wasm-ld; do ln /bin/$bin /usr/lib/rustlib/$(uname -m)-unknown-linux-musl/bin/gcc-ld/$bin; done

# Populate Rust's self-contained LLVM tools
# https://github.com/rust-lang/rust/blob/44e34e1ac6d7e69b40856cf1403d3da145319c30/src/bootstrap/src/core/build_steps/dist.rs#L603-L614
RUN ln /bin/llvm-objcopy /usr/lib/rustlib/$(uname -m)-unknown-linux-musl/bin/rust-objcopy

ENTRYPOINT ["/usr/bin/cargo"]
Copied to clipboard!