Skip to content

Commit f0e8717

Browse files
committed
Auto merge of #870 - RalfJung:miri-rustc, r=oli-obk
Prepare Miri for rustc bootstrap building a separate libstd for it
2 parents e00fa96 + 56630e0 commit f0e8717

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/bin/cargo-miri.rs

+7
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ fn test_sysroot_consistency() {
141141
.unwrap_or_else(|_| panic!("Failed to canonicalize sysroot: {}", stdout))
142142
}
143143

144+
// We let the user skip this check if they really want to.
145+
// (`bootstrap` needs this because Miri gets built by the stage1 compiler
146+
// but run with the stage2 sysroot.)
147+
if std::env::var("MIRI_SKIP_SYSROOT_CHECK").is_ok() {
148+
return;
149+
}
150+
144151
let rustc_sysroot = get_sysroot(Command::new("rustc"));
145152
let miri_sysroot = get_sysroot(Command::new(find_miri()));
146153

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,5 @@ pub use crate::eval::{eval_main, create_ecx, MiriConfig};
4747
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
4848
/// set per default, for maximal validation power.
4949
pub fn miri_default_args() -> &'static [&'static str] {
50-
// The flags here should be kept in sync with what bootstrap adds when `test-miri` is
51-
// set, which happens in `bootstrap/bin/rustc.rs` in the rustc sources.
5250
&["-Zalways-encode-mir", "-Zmir-emit-retag", "-Zmir-opt-level=0", "--cfg=miri"]
5351
}

0 commit comments

Comments
 (0)