about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-07-24 04:31:12 +0900
committerGitHub <noreply@github.com>2021-07-24 04:31:12 +0900
commit1b9cd8bbb8c6c63bead5d278704f08b98a1b4eb6 (patch)
tree76d2d6bcbf4ad7c4356b5bce8a565edb772a5ee3
parent3fc79fde63cfa8472e8c867c0a54de58cffb5cd0 (diff)
parenta02756c14a587fe1834d4707240c0698bf7229b0 (diff)
downloadrust-1b9cd8bbb8c6c63bead5d278704f08b98a1b4eb6.tar.gz
rust-1b9cd8bbb8c6c63bead5d278704f08b98a1b4eb6.zip
Rollup merge of #87358 - jyn514:dry-run, r=Mark-Simulacrum
Fix `--dry-run` when download-ci-llvm is set

Previously it would error out:

```
$ x check --dry-run
thread 'main' panicked at 'std::fs::read_to_string(ci_llvm.join("link-type.txt")) failed with No such file or directory (os error 2) ("CI llvm missing: /home/joshua/rustc3/build/tmp-dry-run/x86_64-unknown-linux-gnu/ci-llvm")', src/bootstrap/config.rs:795:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:10
```
-rw-r--r--src/bootstrap/config.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 483816b98d6..1769899a6cd 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -792,8 +792,16 @@ impl Config {
 
                 // CI-built LLVM can be either dynamic or static.
                 let ci_llvm = config.out.join(&*config.build.triple).join("ci-llvm");
-                let link_type = t!(std::fs::read_to_string(ci_llvm.join("link-type.txt")));
-                config.llvm_link_shared = link_type == "dynamic";
+                config.llvm_link_shared = if config.dry_run {
+                    // just assume dynamic for now
+                    true
+                } else {
+                    let link_type = t!(
+                        std::fs::read_to_string(ci_llvm.join("link-type.txt")),
+                        format!("CI llvm missing: {}", ci_llvm.display())
+                    );
+                    link_type == "dynamic"
+                };
             }
 
             if config.llvm_thin_lto {