From ae22ae135879f1a0713888239b9242c1813a10c8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 22 Jul 2022 07:49:20 -0400 Subject: [PATCH 1/2] miri: make --stage 0 testing work --- src/bootstrap/test.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 4c6b5ba0afc08..078207d85fe46 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); From 2564a080d8e252f7bb44a0186564a52e72750a65 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 22 Jul 2022 12:18:52 -0400 Subject: [PATCH 2/2] update Miri --- src/tools/miri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/miri b/src/tools/miri index dac1676eb3bea..963f08b702caf 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit dac1676eb3bea10e94404bc5b40412742ea5e8d9 +Subproject commit 963f08b702caf7a06eed564312933ec50dd07f54