From e0b634ecaefbc0dd5bdc5fdbbdc15b34328d20ce Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Mon, 21 Apr 2025 16:18:07 +0200 Subject: [PATCH] reset the host linker The host's linker is used to compile build.rs files (e.g. for libc). When the user configures a custom liker (e.g. mold) in their own .cargo/config.toml or ~/.cargo/config.toml, that linker will likely not work when running run-docker.sh. So, we now reset it to `cc`, which should always be installed in the docker container. --- library/stdarch/ci/run-docker.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/stdarch/ci/run-docker.sh b/library/stdarch/ci/run-docker.sh index 0958bc8e67b3..af83a32ecae6 100755 --- a/library/stdarch/ci/run-docker.sh +++ b/library/stdarch/ci/run-docker.sh @@ -11,6 +11,11 @@ if [ $# -lt 1 ]; then fi run() { + # Set the linker that is used for the host (e.g. when compiling a build.rs) + # This overrides any configuration in e.g. `.cargo/config.toml`, which will + # probably not work within the docker container. + HOST_LINKER="CARGO_TARGET_$(rustc --print host-tuple | tr '[:lower:]-' '[:upper:]_')_LINKER" + # Prevent `Read-only file system (os error 30)`. cargo generate-lockfile @@ -25,6 +30,7 @@ run() { --env CARGO_HOME=/cargo \ --env CARGO_TARGET_DIR=/checkout/target \ --env TARGET="${1}" \ + --env "${HOST_LINKER}"="cc" \ --env STDARCH_TEST_EVERYTHING \ --env STDARCH_DISABLE_ASSERT_INSTR \ --env NOSTD \