Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 929712c

Browse files
committed
reduce chance of RUSTC collisions
1 parent 7cd1d78 commit 929712c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cargo-miri/bin.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,10 @@ fn phase_cargo_miri(mut args: env::Args) {
671671
// (https://github.com/rust-lang/cargo/issues/10885). There is no good way to single out these invocations;
672672
// some build scripts use the RUSTC env var as well. So we set it directly to the `miri` driver and
673673
// hope that all they do is ask for the version number -- things could quickly go downhill from here.
674-
cmd.env("RUSTC", &find_miri());
674+
// In `main`, we need the value of `RUSTC` to distinguish RUSTC_WRAPPER invocations from rustdoc
675+
// or TARGET_RUNNER invocations, so we canonicalize it here to make it exceedingly unlikely that
676+
// there would be a collision.
677+
cmd.env("RUSTC", &fs::canonicalize(find_miri()).unwrap());
675678

676679
let runner_env_name =
677680
|triple: &str| format!("CARGO_TARGET_{}_RUNNER", triple.to_uppercase().replace('-', "_"));

0 commit comments

Comments
 (0)