]> git.lizzy.rs Git - rust.git/commitdiff
Don't allow `DESTDIR` to influence LLVM builds
authorJake Goulding <jake.goulding@gmail.com>
Sat, 11 Jul 2020 13:38:01 +0000 (09:38 -0400)
committerJake Goulding <jake.goulding@gmail.com>
Sun, 12 Jul 2020 18:34:33 +0000 (14:34 -0400)
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.

src/bootstrap/native.rs

index e8ec575ea37466379f6ab1e75ccc3134f5c22ddd..ca0b3ddc920ed6d9faeda24a0578266d7032646a 100644 (file)
@@ -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");
     }