Skip to content

Commit

Permalink
check if the LLVM submodule is fetched in is_ci_llvm_modified
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Sep 23, 2024
1 parent 90745bd commit f076532
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {

/// Returns true if we're running in CI with modified LLVM (and thus can't download it)
pub(crate) fn is_ci_llvm_modified(config: &Config) -> bool {
CiEnv::is_ci() && config.rust_info.is_managed_git_subrepository() && {
// If the LLVM submodule is unavailable (which is the case when `llvm.download-ci-llvm` is set to true),
// LLVM cannot be modified which means it is unnecessary to run the git logic below.
if config.in_tree_llvm_info.is_managed_git_subrepository() {
return false;
}

CiEnv::is_ci() && {
// We assume we have access to git, so it's okay to unconditionally pass
// `true` here.
let llvm_sha = detect_llvm_sha(config, true);
Expand Down
2 changes: 0 additions & 2 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ impl Build {
let miri_info = config.miri_info.clone();
let rustfmt_info = config.rustfmt_info.clone();
let enzyme_info = config.enzyme_info.clone();

// we always try to use git for LLVM builds
let in_tree_llvm_info = config.in_tree_llvm_info.clone();
let in_tree_gcc_info = config.in_tree_gcc_info.clone();

Expand Down

0 comments on commit f076532

Please sign in to comment.