Skip to content

Commit c27bb21

Browse files
folkertdevAmanieu
authored andcommitted
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.
1 parent 2665cdd commit c27bb21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ci/run-docker.sh

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if [ $# -lt 1 ]; then
1111
fi
1212

1313
run() {
14+
# Set the linker that is used for the host (e.g. when compiling a build.rs)
15+
# This overrides any configuration in e.g. `.cargo/config.toml`, which will
16+
# probably not work within the docker container.
17+
HOST_LINKER="CARGO_TARGET_$(rustc --print host-tuple | tr '[:lower:]-' '[:upper:]_')_LINKER"
18+
1419
# Prevent `Read-only file system (os error 30)`.
1520
cargo generate-lockfile
1621

@@ -25,6 +30,7 @@ run() {
2530
--env CARGO_HOME=/cargo \
2631
--env CARGO_TARGET_DIR=/checkout/target \
2732
--env TARGET="${1}" \
33+
--env "${HOST_LINKER}"="cc" \
2834
--env STDARCH_TEST_EVERYTHING \
2935
--env STDARCH_DISABLE_ASSERT_INSTR \
3036
--env NOSTD \

0 commit comments

Comments
 (0)