in llvm::is_ci_llvm_modified, check if it's rust-lang/rust CI job

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-09-25 19:50:42 +03:00
parent 2d85139f87
commit 5840d8791c

View File

@ -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);