Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix testing Miri with --stage 0 #85959

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix it to not do this? Overwriting the old value seems very confusing.

Copy link
Member Author

@RalfJung RalfJung Jun 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(a) this is pre-existing, I'd rather not touch this since I have no idea what changing this will break,
(b) fixing it requires an unstable feature (#44434), which AFAIK bootstrap tries to avoid.

pub fn add_dylib_path(path: Vec<PathBuf>, cmd: &mut Command) {
let mut list = dylib_path();
for path in path {
Expand Down