about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-07-23 05:28:35 +0000
committerbors <bors@rust-lang.org>2022-07-23 05:28:35 +0000
commit7d0a55bcdc262d12447942e028c480b2387076ea (patch)
tree140e40aadf52a0ac2ff918a792b15390ca51f8af /src
parented793d86daa67fb1117dd1db8da5da765e0fc773 (diff)
parent2564a080d8e252f7bb44a0186564a52e72750a65 (diff)
downloadrust-7d0a55bcdc262d12447942e028c480b2387076ea.tar.gz
rust-7d0a55bcdc262d12447942e028c480b2387076ea.zip
Auto merge of #99599 - RalfJung:miri-stage-0, r=RalfJung
miri: make --stage 0 testing work

This needs https://github.com/rust-lang/miri/pull/2415 or it'll break Miri entirely.

also fixes https://github.com/rust-lang/rust/issues/99589
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/test.rs8
m---------src/tools/miri16
2 files changed, 16 insertions, 8 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 4c6b5ba0afc..078207d85fe 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -475,6 +475,9 @@ impl Step for Miri {
         let stage = self.stage;
         let host = self.host;
         let compiler = builder.compiler(stage, host);
+        // We need the stdlib for the *next* stage, as it was built with this compiler that also built Miri.
+        // Except if we are at stage 2, the bootstrap loop is complete and we can stick with our current stage.
+        let compiler_std = builder.compiler(if stage < 2 { stage + 1 } else { stage }, host);
 
         let miri =
             builder.ensure(tool::Miri { compiler, target: self.host, extra_features: Vec::new() });
@@ -483,6 +486,10 @@ impl Step for Miri {
             target: self.host,
             extra_features: Vec::new(),
         });
+        // The stdlib we need might be at a different stage. And just asking for the
+        // sysroot does not seem to populate it, so we do that first.
+        builder.ensure(compile::Std::new(compiler_std, host));
+        let sysroot = builder.sysroot(compiler_std);
         if let (Some(miri), Some(_cargo_miri)) = (miri, cargo_miri) {
             let mut cargo =
                 builder.cargo(compiler, Mode::ToolRustc, SourceType::Submodule, host, "install");
@@ -562,6 +569,7 @@ impl Step for Miri {
 
             // miri tests need to know about the stage sysroot
             cargo.env("MIRI_SYSROOT", miri_sysroot);
+            cargo.env("MIRI_HOST_SYSROOT", sysroot);
             cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
             cargo.env("MIRI", miri);
 
diff --git a/src/tools/miri b/src/tools/miri
-Subproject dac1676eb3bea10e94404bc5b40412742ea5e8d
+Subproject 963f08b702caf7a06eed564312933ec50dd07f5