diff --git a/src/bin/cargo-miri.rs b/src/bin/cargo-miri.rs index fe30e7d010b..b46742efe72 100644 --- a/src/bin/cargo-miri.rs +++ b/src/bin/cargo-miri.rs @@ -141,6 +141,13 @@ fn get_sysroot(mut cmd: Command) -> PathBuf { .unwrap_or_else(|_| panic!("Failed to canonicalize sysroot: {}", stdout)) } + // We let the user skip this check if they really want to. + // (`bootstrap` needs this because Miri gets built by the stage1 compiler + // but run with the stage2 sysroot.) + if std::env::var("MIRI_SKIP_SYSROOT_CHECK").is_ok() { + return; + } + let rustc_sysroot = get_sysroot(Command::new("rustc")); let miri_sysroot = get_sysroot(Command::new(find_miri())); diff --git a/src/lib.rs b/src/lib.rs index 0265fbf15cc..58f572bf701 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,5 @@ /// Insert rustc arguments at the beginning of the argument list that Miri wants to be /// set per default, for maximal validation power. pub fn miri_default_args() -> &'static [&'static str] { - // The flags here should be kept in sync with what bootstrap adds when `test-miri` is - // set, which happens in `bootstrap/bin/rustc.rs` in the rustc sources. &["-Zalways-encode-mir", "-Zmir-emit-retag", "-Zmir-opt-level=0", "--cfg=miri"] }