Skip to content

Commit f076532

Browse files
committed
check if the LLVM submodule is fetched in is_ci_llvm_modified
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 90745bd commit f076532

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,13 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
241241

242242
/// Returns true if we're running in CI with modified LLVM (and thus can't download it)
243243
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+
if config.in_tree_llvm_info.is_managed_git_subrepository() {
247+
return false;
248+
}
249+
250+
CiEnv::is_ci() && {
245251
// We assume we have access to git, so it's okay to unconditionally pass
246252
// `true` here.
247253
let llvm_sha = detect_llvm_sha(config, true);

src/bootstrap/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ impl Build {
312312
let miri_info = config.miri_info.clone();
313313
let rustfmt_info = config.rustfmt_info.clone();
314314
let enzyme_info = config.enzyme_info.clone();
315-
316-
// we always try to use git for LLVM builds
317315
let in_tree_llvm_info = config.in_tree_llvm_info.clone();
318316
let in_tree_gcc_info = config.in_tree_gcc_info.clone();
319317

0 commit comments

Comments
 (0)