about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-03-31 23:09:33 +0200
committerRalf Jung <post@ralfj.de>2024-03-31 23:09:33 +0200
commitb08b06e3a861e237a5bd961a568291eb0cd4e833 (patch)
treebd1b166e33b37c4a5072a342330914bf5192f1ee
parent4797fba3b71fc44b0904ebd52603a953609a9eb6 (diff)
downloadrust-b08b06e3a861e237a5bd961a568291eb0cd4e833.tar.gz
rust-b08b06e3a861e237a5bd961a568291eb0cd4e833.zip
fix not finding the right libraries on Windows
-rw-r--r--src/bootstrap/src/core/builder.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 4941f5a8ca5..8726d7c0812 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1271,9 +1271,15 @@ impl<'a> Builder<'a> {
         let mut cmd = Command::new(cargo_miri);
         cmd.env("MIRI", &miri);
         cmd.env("CARGO", &self.initial_cargo);
-        // Need to add the run_compiler libs. Not entirely sure why that has to be one stage up from
-        // what Miri was built for.
-        self.add_rustc_lib_path(run_compiler, &mut cmd);
+        // Need to add the `run_compiler` libs. Those are the libs produces *by* `build_compiler`,
+        // so they match the Miri we just built. However this means they are actually living one
+        // stage up, i.e. we are running `stage0-tools-bin/miri` with the libraries in `stage1/lib`.
+        // This is an unfortunate off-by-1 caused (possibly) by the fact that Miri doesn't have an
+        // "assemble" step like rustc does that would cross the stage boundary. We can't use
+        // `add_rustc_lib_path` as that's a NOP on Windows but we do need these libraries added to
+        // the PATH due to the stage mismatch.
+        // Also see https://github.com/rust-lang/rust/pull/123192#issuecomment-2028901503.
+        add_dylib_path(self.rustc_lib_paths(run_compiler), &mut cmd);
         cmd
     }