diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2020-12-12 18:02:37 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2020-12-12 18:06:07 +0100 |
| commit | 16f69b5430cd543d5767401d760cc644dc836906 (patch) | |
| tree | 4ae53d1c9717d4a2a71c5efce08bf1e3a4a92dfc /src/bootstrap/bootstrap.py | |
| parent | 3f2088aa603d2cd3f43c20795872de9cd6ec7735 (diff) | |
| download | rust-16f69b5430cd543d5767401d760cc644dc836906.tar.gz rust-16f69b5430cd543d5767401d760cc644dc836906.zip | |
Don't checkout llvm-project when the LLVM backend isn't built
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index a819e1b6e2f..63975c6deda 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -892,13 +892,17 @@ class RustBuild(object): filtered_submodules = [] submodules_names = [] llvm_checked_out = os.path.exists(os.path.join(self.rust_root, "src/llvm-project/.git")) + external_llvm_provided = self.get_toml('llvm-config') or self.downloading_llvm() + llvm_needed = not self.get_toml('codegen-backends', 'rust') \ + or "llvm" in self.get_toml('codegen-backends', 'rust') for module in submodules: if module.endswith("llvm-project"): - # Don't sync the llvm-project submodule either if an external LLVM - # was provided, or if we are downloading LLVM. Also, if the - # submodule has been initialized already, sync it anyways so that - # it doesn't mess up contributor pull requests. - if self.get_toml('llvm-config') or self.downloading_llvm(): + # Don't sync the llvm-project submodule if an external LLVM was + # provided, if we are downloading LLVM or if the LLVM backend is + # not being built. Also, if the submodule has been initialized + # already, sync it anyways so that it doesn't mess up contributor + # pull requests. + if external_llvm_provided or not llvm_needed: if self.get_toml('lld') != 'true' and not llvm_checked_out: continue check = self.check_submodule(module, slow_submodules) |
