Skip to content
Permalink
Browse files

Add local LLD to the PATH for run-make-fulldeps tests.

  • Loading branch information...
michaelwoerister committed Apr 30, 2019
1 parent c95f5e3 commit 7acead5e0a111419593267d37a5615ff4c3b5e4f
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/bootstrap/test.rs
@@ -1238,6 +1238,21 @@ impl Step for Compiletest {
.expect("Expected llvm-config to be contained in directory");
assert!(llvm_bin_path.is_dir());
cmd.arg("--llvm-bin-dir").arg(llvm_bin_path);

// If LLD is available, add it to the PATH
if builder.config.lld_enabled {
let lld_install_root = builder.ensure(native::Lld {
target: builder.config.build,
});

let lld_bin_path = lld_install_root.join("bin");

let old_path = env::var_os("PATH").unwrap_or_default();
let new_path = env::join_paths(std::iter::once(lld_bin_path)
.chain(env::split_paths(&old_path)))
.expect("Could not add LLD bin path to PATH");
cmd.env("PATH", new_path);
}
}
}

0 comments on commit 7acead5

Please sign in to comment.
You can’t perform that action at this time.