about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-04 07:10:55 +0000
committerbors <bors@rust-lang.org>2021-06-04 07:10:55 +0000
commitc4c2ab57a43737867982fafc8cfacd9b069fee96 (patch)
treefa35d027efccc77a852ff3985a3ef25e1d5f1ee6 /src
parent4afa3a80926f52aa361fe4e89643dac2e2e57f34 (diff)
parent9e674af66903a82676118a409a3487beb05fbfc9 (diff)
downloadrust-c4c2ab57a43737867982fafc8cfacd9b069fee96.tar.gz
rust-c4c2ab57a43737867982fafc8cfacd9b069fee96.zip
Auto merge of #85959 - RalfJung:miri-stage-0, r=Mark-Simulacrum
fix testing Miri with --stage 0

Fixes https://github.com/rust-lang/rust/issues/78778 for Miri.

The issue remains open for error_index_generator, which has its own dylib logic:
https://github.com/rust-lang/rust/blob/903e369c831d52726a5292f847e384622189d9a0/src/bootstrap/tool.rs#L396-L400
`@jyn514` I could just copy the logic from `add_rustc_lib_path`, but that does not seem great. Any other suggestions?

Also I wonder if maybe `prepare_tool_cargo` should already call `add_rustc_lib_path`.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/builder.rs10
-rw-r--r--src/bootstrap/test.rs4
-rw-r--r--src/bootstrap/util.rs1
3 files changed, 12 insertions, 3 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index f3049a74757..da298f7edb9 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -709,7 +709,15 @@ impl<'a> Builder<'a> {
             return;
         }
 
-        add_dylib_path(vec![self.rustc_libdir(compiler)], cmd);
+        let mut dylib_dirs = vec![self.rustc_libdir(compiler)];
+
+        // Ensure that the downloaded LLVM libraries can be found.
+        if self.config.llvm_from_ci {
+            let ci_llvm_lib = self.out.join(&*compiler.host.triple).join("ci-llvm").join("lib");
+            dylib_dirs.push(ci_llvm_lib);
+        }
+
+        add_dylib_path(dylib_dirs, cmd);
     }
 
     /// Gets a path to the compiler specified.
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 16b3c6419e8..7bd29c61b0c 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -449,6 +449,7 @@ impl Step for Miri {
                 SourceType::Submodule,
                 &[],
             );
+            cargo.add_rustc_lib_path(builder, compiler);
             cargo.arg("--").arg("miri").arg("setup");
 
             // Tell `cargo miri setup` where to find the sources.
@@ -500,6 +501,7 @@ impl Step for Miri {
                 SourceType::Submodule,
                 &[],
             );
+            cargo.add_rustc_lib_path(builder, compiler);
 
             // miri tests need to know about the stage sysroot
             cargo.env("MIRI_SYSROOT", miri_sysroot);
@@ -508,8 +510,6 @@ impl Step for Miri {
 
             cargo.arg("--").args(builder.config.cmd.test_args());
 
-            cargo.add_rustc_lib_path(builder, compiler);
-
             let mut cargo = Command::from(cargo);
             if !try_run(builder, &mut cargo) {
                 return;
diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
index b4421a82714..4c1cd758f0d 100644
--- a/src/bootstrap/util.rs
+++ b/src/bootstrap/util.rs
@@ -45,6 +45,7 @@ pub fn libdir(target: TargetSelection) -> &'static str {
 }
 
 /// Adds a list of lookup paths to `cmd`'s dynamic library lookup path.
+/// If The dylib_path_par is already set for this cmd, the old value will be overwritten!
 pub fn add_dylib_path(path: Vec<PathBuf>, cmd: &mut Command) {
     let mut list = dylib_path();
     for path in path {