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
```
This commit is contained in:
Joshua Nelson 2021-07-22 02:01:42 +00:00
parent 32c9b7b091
commit a02756c14a

View File

@ -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 {