Skip to content

Commit 9273c89

Browse files
authored
Rollup merge of rust-lang#39950 - ishitatsuyuki:stop-trashing-ldpath, r=alexcrichton
bootstrap: stop trashing (DY)LD_LIBRARY_PATH This generated an ugly error with fakeroot before.
2 parents e62199a + df28569 commit 9273c89

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bootstrap/bootstrap.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,12 @@ def build_bootstrap(self):
355355
env = os.environ.copy()
356356
env["CARGO_TARGET_DIR"] = build_dir
357357
env["RUSTC"] = self.rustc()
358-
env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
359-
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
358+
env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
359+
(os.pathsep + env["LD_LIBRARY_PATH"]) \
360+
if "LD_LIBRARY_PATH" in env else ""
361+
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
362+
(os.pathsep + env["DYLD_LIBRARY_PATH"]) \
363+
if "DYLD_LIBRARY_PATH" in env else ""
360364
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
361365
os.pathsep + env["PATH"]
362366
if not os.path.isfile(self.cargo()):

0 commit comments

Comments
 (0)