about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-14 13:19:26 -0700
committerGitHub <noreply@github.com>2020-07-14 13:19:26 -0700
commit1e74f285998daf6809d2d418d2bbe1ab094e694e (patch)
tree74d7da7508e04c3dd2e0e66e41195f1ad02560ca
parenta364c0a782948e48333e296bcb089119394de9e5 (diff)
parent9741fbd202b2b55de95abe1eb7f3d8185e312444 (diff)
downloadrust-1e74f285998daf6809d2d418d2bbe1ab094e694e.tar.gz
rust-1e74f285998daf6809d2d418d2bbe1ab094e694e.zip
Rollup merge of #74252 - shepmaster:bootstrap-rust-destdir, r=Mark-Simulacrum
Don't allow `DESTDIR` to influence LLVM builds

When running a command like `DESTDIR=foo x.py install` in a completely
clean build directory, this will cause LLVM to be installed into
`DESTDIR`, which then causes the build to fail later when it attempts
to *use* those LLVM files.
-rw-r--r--src/bootstrap/native.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index e8ec575ea37..ca0b3ddc920 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -347,6 +347,11 @@ fn configure_cmake(
     // LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
     cfg.define("CMAKE_INSTALL_MESSAGE", "LAZY");
 
+    // Do not allow the user's value of DESTDIR to influence where
+    // LLVM will install itself. LLVM must always be installed in our
+    // own build directories.
+    cfg.env("DESTDIR", "");
+
     if builder.config.ninja {
         cfg.generator("Ninja");
     }