about summary refs log tree commit diff
path: root/src/bootstrap/bootstrap.py
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-02-25 14:13:22 +0200
committerGitHub <noreply@github.com>2017-02-25 14:13:22 +0200
commitbe66a607da258614e2593486df75ee561206b0fc (patch)
treeabbbdc76a8d8e0912430f7b6442c008a787ff98e /src/bootstrap/bootstrap.py
parent16202862b2540a5259c6011b27ec5278da71879c (diff)
parentdf285693da68797ab604fed42da853ed0047849e (diff)
downloadrust-be66a607da258614e2593486df75ee561206b0fc.tar.gz
rust-be66a607da258614e2593486df75ee561206b0fc.zip
Rollup merge of #39950 - ishitatsuyuki:stop-trashing-ldpath, r=alexcrichton
bootstrap: stop trashing (DY)LD_LIBRARY_PATH

This generated an ugly error with fakeroot before.
Diffstat (limited to 'src/bootstrap/bootstrap.py')
-rw-r--r--src/bootstrap/bootstrap.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 3f8286f9e9e..c1ee0c29ac9 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -355,8 +355,12 @@ class RustBuild(object):
         env = os.environ.copy()
         env["CARGO_TARGET_DIR"] = build_dir
         env["RUSTC"] = self.rustc()
-        env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
-        env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
+        env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
+                                 (os.pathsep + env["LD_LIBRARY_PATH"]) \
+                                 if "LD_LIBRARY_PATH" in env else ""
+        env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
+                                   (os.pathsep + env["DYLD_LIBRARY_PATH"]) \
+                                   if "DYLD_LIBRARY_PATH" in env else ""
         env["PATH"] = os.path.join(self.bin_root(), "bin") + \
                       os.pathsep + env["PATH"]
         if not os.path.isfile(self.cargo()):