Rollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
Make remote-test-server easier to use with new targets While testing #81455 I encountered 2 issues with `remote-test-server`: - It is built with the stage 0 toolchain, which does not support a newly added target. - It overwrites `LD_LIBRARY_PATH` instead of appending to it, which prevents the use of a custom sysroot for target libraries.
This commit is contained in:
commit
b5438e2230
2 changed files with 10 additions and 17 deletions
|
@ -1880,8 +1880,7 @@ impl Step for RemoteCopyLibs {
|
||||||
builder.info(&format!("REMOTE copy libs to emulator ({})", target));
|
builder.info(&format!("REMOTE copy libs to emulator ({})", target));
|
||||||
t!(fs::create_dir_all(builder.out.join("tmp")));
|
t!(fs::create_dir_all(builder.out.join("tmp")));
|
||||||
|
|
||||||
let server =
|
let server = builder.ensure(tool::RemoteTestServer { compiler, target });
|
||||||
builder.ensure(tool::RemoteTestServer { compiler: compiler.with_stage(0), target });
|
|
||||||
|
|
||||||
// Spawn the emulator and wait for it to come online
|
// Spawn the emulator and wait for it to come online
|
||||||
let tool = builder.tool_exe(Tool::RemoteTestClient);
|
let tool = builder.tool_exe(Tool::RemoteTestClient);
|
||||||
|
|
|
@ -218,25 +218,19 @@ fn handle_run(socket: TcpStream, work: &Path, tmp: &Path, lock: &Mutex<()>, conf
|
||||||
cmd.args(args);
|
cmd.args(args);
|
||||||
cmd.envs(env);
|
cmd.envs(env);
|
||||||
|
|
||||||
|
// On windows, libraries are just searched in the executable directory,
|
||||||
|
// system directories, PWD, and PATH, in that order. PATH is the only one
|
||||||
|
// we can change for this.
|
||||||
|
let library_path = if cfg!(windows) { "PATH" } else { "LD_LIBRARY_PATH" };
|
||||||
|
|
||||||
// Support libraries were uploaded to `work` earlier, so make sure that's
|
// Support libraries were uploaded to `work` earlier, so make sure that's
|
||||||
// in `LD_LIBRARY_PATH`. Also include our own current dir which may have
|
// in `LD_LIBRARY_PATH`. Also include our own current dir which may have
|
||||||
// had some libs uploaded.
|
// had some libs uploaded.
|
||||||
if cfg!(windows) {
|
let mut paths = vec![work.to_owned(), path.clone()];
|
||||||
// On windows, libraries are just searched in the executable directory,
|
if let Some(library_path) = env::var_os(library_path) {
|
||||||
// system directories, PWD, and PATH, in that order. PATH is the only one
|
paths.extend(env::split_paths(&library_path));
|
||||||
// we can change for this.
|
|
||||||
cmd.env(
|
|
||||||
"PATH",
|
|
||||||
env::join_paths(
|
|
||||||
std::iter::once(work.to_owned())
|
|
||||||
.chain(std::iter::once(path.clone()))
|
|
||||||
.chain(env::split_paths(&env::var_os("PATH").unwrap())),
|
|
||||||
)
|
|
||||||
.unwrap(),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
cmd.env("LD_LIBRARY_PATH", format!("{}:{}", work.display(), path.display()));
|
|
||||||
}
|
}
|
||||||
|
cmd.env(library_path, env::join_paths(paths).unwrap());
|
||||||
|
|
||||||
// Some tests assume RUST_TEST_TMPDIR exists
|
// Some tests assume RUST_TEST_TMPDIR exists
|
||||||
cmd.env("RUST_TEST_TMPDIR", tmp.to_owned());
|
cmd.env("RUST_TEST_TMPDIR", tmp.to_owned());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue