File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,17 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
241
241
242
242
/// Returns true if we're running in CI with modified LLVM (and thus can't download it)
243
243
pub ( crate ) fn is_ci_llvm_modified ( config : & Config ) -> bool {
244
- CiEnv :: is_ci ( ) && config. rust_info . is_managed_git_subrepository ( ) && {
244
+ // If the LLVM submodule is unavailable (which is the case when `llvm.download-ci-llvm` is set to true),
245
+ // LLVM cannot be modified which means it is unnecessary to run the git logic below.
246
+ //
247
+ // This is very unlikely to happen on our (rust-lang/rust) CI runners, as we intentionally fetch all
248
+ // submodules in CI and most of the time (probably always) prefer `llvm.download-ci-llvm` to be set
249
+ // to "if-unchanged" or true.
250
+ if config. in_tree_llvm_info . is_managed_git_subrepository ( ) {
251
+ return false ;
252
+ }
253
+
254
+ CiEnv :: is_ci ( ) && {
245
255
// We assume we have access to git, so it's okay to unconditionally pass
246
256
// `true` here.
247
257
let llvm_sha = detect_llvm_sha ( config, true ) ;
Original file line number Diff line number Diff line change @@ -312,8 +312,6 @@ impl Build {
312
312
let miri_info = config. miri_info . clone ( ) ;
313
313
let rustfmt_info = config. rustfmt_info . clone ( ) ;
314
314
let enzyme_info = config. enzyme_info . clone ( ) ;
315
-
316
- // we always try to use git for LLVM builds
317
315
let in_tree_llvm_info = config. in_tree_llvm_info . clone ( ) ;
318
316
let in_tree_gcc_info = config. in_tree_gcc_info . clone ( ) ;
319
317
You can’t perform that action at this time.
0 commit comments