@@ -1235,6 +1235,7 @@ impl<'a> Builder<'a> {
1235
1235
assert!(run_compiler.stage > 0, "miri can not be invoked at stage 0");
1236
1236
let build_compiler = self.compiler(run_compiler.stage - 1, self.build.build);
1237
1237
1238
+ // Prepare the tools
1238
1239
let miri = self.ensure(tool::Miri {
1239
1240
compiler: build_compiler,
1240
1241
target: self.build.build,
@@ -1245,7 +1246,7 @@ impl<'a> Builder<'a> {
1245
1246
target: self.build.build,
1246
1247
extra_features: Vec::new(),
1247
1248
});
1248
- // Invoke cargo-miri, make sure we can find miri and cargo.
1249
+ // Invoke cargo-miri, make sure it can find miri and cargo.
1249
1250
let mut cmd = Command::new(cargo_miri);
1250
1251
cmd.env("MIRI", &miri);
1251
1252
cmd.env("CARGO", &self.initial_cargo);
@@ -1711,6 +1712,15 @@ impl<'a> Builder<'a> {
1711
1712
cargo.env("RUSTC_WRAPPER_REAL", existing_wrapper);
1712
1713
}
1713
1714
1715
+ // If this is for `miri-test`, prepare the sysroots.
1716
+ if cmd == "miri-test" {
1717
+ self.ensure(compile::Std::new(compiler, compiler.host));
1718
+ let host_sysroot = self.sysroot(compiler);
1719
+ let miri_sysroot = test::Miri::build_miri_sysroot(self, compiler, target);
1720
+ cargo.env("MIRI_SYSROOT", &miri_sysroot);
1721
+ cargo.env("MIRI_HOST_SYSROOT", &host_sysroot);
1722
+ }
1723
+
1714
1724
cargo.env(profile_var("STRIP"), self.config.rust_strip.to_string());
1715
1725
1716
1726
if let Some(stack_protector) = &self.config.rust_stack_protector {
0 commit comments