]> git.lizzy.rs Git - rust.git/commitdiff
bootstrap: stop trashing (DY)LD_LIBRARY_PATH
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sun, 19 Feb 2017 01:41:56 +0000 (10:41 +0900)
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Mon, 20 Feb 2017 06:46:52 +0000 (15:46 +0900)
This generated an ugly error with fakeroot before.

src/bootstrap/bootstrap.py

index 7ca7ef4bd720c2f8ab8a119af8bbe3c6d52b2390..58de5706e94f62f3733585b0dde2d2f6a2ed17eb 100644 (file)
@@ -342,8 +342,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()):