about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-05 12:11:05 +0000
committerbors <bors@rust-lang.org>2021-02-05 12:11:05 +0000
commitf9435f4c92651d67d5dbaba13c5606c4c4fc1327 (patch)
treed6b3c5182c722eef20e17d3a76f84ce13977bf27 /src/tools
parent730d6dfdddc0f55d9cbeedb29a14b342f74e2a9d (diff)
parent2383cd4b2d820f968a57f9750bf4b4471a655835 (diff)
Auto merge of #81784 - m-ou-se:rollup-s23fow7, r=m-ou-se
Rollup of 15 pull requests

Successful merges:

 - #79554 (Generic associated types in trait paths)
 - #80726 (relax adt unsizing requirements)
 - #81307 (Handle `Span`s for byte and raw strings and add more detail )
 - #81318 (rustdoc-json: Fix has_body)
 - #81456 (Make remote-test-server easier to use with new targets)
 - #81497 (rustdoc: Move `display_fn` struct inside `display_fn`)
 - #81500 (Remove struct_type from union output)
 - #81542 (Expose correct symlink API on WASI)
 - #81676 (Add more information to the error code for 'crate not found')
 - #81682 (Add additional bitset benchmarks)
 - #81730 (Make `Allocator` object-safe)
 - #81763 (Cleanup rustdoc pass descriptions a bit)
 - #81767 (Update LayoutError/LayoutErr stability attributes)
 - #81771 (Indicate change in RSS from start to end of pass in time-passes output)
 - #81781 (Fix `install-awscli.sh` error in CI)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/remote-test-server/src/main.rs24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/tools/remote-test-server/src/main.rs b/src/tools/remote-test-server/src/main.rs
index d92758eb747..cd9d5300964 100644
--- a/src/tools/remote-test-server/src/main.rs
+++ b/src/tools/remote-test-server/src/main.rs
@@ -218,25 +218,19 @@ fn handle_run(socket: TcpStream, work: &Path, tmp: &Path, lock: &Mutex<()>, conf
     cmd.args(args);
     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
     // in `LD_LIBRARY_PATH`. Also include our own current dir which may have
     // had some libs uploaded.
-    if cfg!(windows) {
-        // 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.
-        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()));
+    let mut paths = vec![work.to_owned(), path.clone()];
+    if let Some(library_path) = env::var_os(library_path) {
+        paths.extend(env::split_paths(&library_path));
     }
+    cmd.env(library_path, env::join_paths(paths).unwrap());
 
     // Some tests assume RUST_TEST_TMPDIR exists
     cmd.env("RUST_TEST_TMPDIR", tmp.to_owned());