about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroxalica <oxalicc@pm.me>2022-07-11 05:40:48 +0800
committeroxalica <oxalicc@pm.me>2022-07-11 05:40:48 +0800
commit6245d725a251325f29902656ac3ca5adb4c51f2a (patch)
treeaf6e745ec019e360cea7f9f409260830378a8bc5
parent95e77648e466c780a9adce2fa3d3eb5e423dc04e (diff)
downloadrust-6245d725a251325f29902656ac3ca5adb4c51f2a.tar.gz
rust-6245d725a251325f29902656ac3ca5adb4c51f2a.zip
Fix `download-ci-llvm` NixOS patching for binaries
LLVM tools should also be patched, since they are used in some tests,
specially,
- src/test/run-make-fulldeps/cross-lang-lto (llvm-ar)
- src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs (llvm-ar)
- src/test/run-make-fulldeps/issue-64153 (llvm-objdump)

To be more future proof, we should patch all binaries in `bin`.
-rw-r--r--src/bootstrap/native.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 7ddd0ba5c3d..8254f01ce87 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -147,8 +147,8 @@ pub(crate) fn maybe_download_ci_llvm(builder: &Builder<'_>) {
     let key = format!("{}{}", llvm_sha, config.llvm_assertions);
     if program_out_of_date(&llvm_stamp, &key) && !config.dry_run {
         download_ci_llvm(builder, &llvm_sha);
-        for binary in ["llvm-config", "FileCheck"] {
-            builder.fix_bin_or_dylib(&llvm_root.join("bin").join(binary));
+        for entry in t!(fs::read_dir(llvm_root.join("bin"))) {
+            builder.fix_bin_or_dylib(&t!(entry).path());
         }
 
         // Update the timestamp of llvm-config to force rustc_llvm to be