Skip to content

Commit 781ec55

Browse files
KobzolMuscraft
authored andcommitted
Simplify default value of download-ci-llvm
1 parent 64e698d commit 781ec55

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,15 +2134,7 @@ pub fn parse_download_ci_llvm<'a>(
21342134
asserts: bool,
21352135
) -> bool {
21362136
let dwn_ctx = dwn_ctx.as_ref();
2137-
2138-
// We don't ever want to use `true` on CI, as we should not
2139-
// download upstream artifacts if there are any local modifications.
2140-
let default = if dwn_ctx.is_running_on_ci {
2141-
StringOrBool::String("if-unchanged".to_string())
2142-
} else {
2143-
StringOrBool::Bool(true)
2144-
};
2145-
let download_ci_llvm = download_ci_llvm.unwrap_or(default);
2137+
let download_ci_llvm = download_ci_llvm.unwrap_or(StringOrBool::Bool(true));
21462138

21472139
let if_unchanged = || {
21482140
if rust_info.is_from_tarball() {
@@ -2174,8 +2166,9 @@ pub fn parse_download_ci_llvm<'a>(
21742166
);
21752167
}
21762168

2177-
if b && dwn_ctx.is_running_on_ci {
2178-
// On CI, we must always rebuild LLVM if there were any modifications to it
2169+
#[cfg(not(test))]
2170+
if b && dwn_ctx.is_running_on_ci && CiEnv::is_rust_lang_managed_ci_job() {
2171+
// On rust-lang CI, we must always rebuild LLVM if there were any modifications to it
21792172
panic!(
21802173
"`llvm.download-ci-llvm` cannot be set to `true` on CI. Use `if-unchanged` instead."
21812174
);

0 commit comments

Comments
 (0)