Skip to content

Commit

Permalink
in llvm::is_ci_llvm_modified, check if it's rust-lang/rust CI job
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 29, 2024
1 parent 2d85139 commit 5840d87
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,7 @@ 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 {
// 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.
//
// This is very unlikely to happen on our (rust-lang/rust) CI runners, as we intentionally fetch all
// submodules in CI and most of the time (probably always) prefer `llvm.download-ci-llvm` to be set
// to "if-unchanged" or true.
if config.in_tree_llvm_info.is_managed_git_subrepository() {
return false;
}

CiEnv::is_ci() && {
CiEnv::is_rust_lang_managed_ci_job() && config.rust_info.is_managed_git_subrepository() && {
// 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

0 comments on commit 5840d87

Please sign in to comment.