Rollup merge of #128382 - RalfJung:cargo-miri-assert, r=oli-obk

cargo-miri: better error when we seem to run inside bootstrap but something is wrong

Cc https://github.com/rust-lang/miri/issues/3775
This commit is contained in:
Matthias Krüger
2024-07-30 22:51:40 +02:00
committed by GitHub
+4 -1
View File
@@ -100,7 +100,10 @@ pub fn setup(
// for target crates.
let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
if env::var_os("RUSTC_STAGE").is_some() {
assert!(env::var_os("RUSTC").is_some());
assert!(
env::var_os("RUSTC").is_some() && env::var_os("RUSTC_WRAPPER").is_some(),
"cargo-miri setup is running inside rustc bootstrap but RUSTC or RUST_WRAPPER is not set"
);
command.env("RUSTC_REAL", &cargo_miri_path);
} else {
command.env("RUSTC", &cargo_miri_path);