Skip to content

Commit 0b6a771

Browse files
borsMuscraft
authored andcommitted
Auto merge of rust-lang#146771 - Kobzol:download-ci-llvm-default-value, r=jieyouxu
Simplify default value of `download-ci-llvm` Just set it to true, rather than having different default values on CI and locally, and then only deny `true` on our own CI, not elsewhere. Closes: rust-lang#146768 r? `@jieyouxu`
2 parents fac933a + 781ec55 commit 0b6a771

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
@@ -2137,15 +2137,7 @@ pub fn parse_download_ci_llvm<'a>(
21372137
asserts: bool,
21382138
) -> bool {
21392139
let dwn_ctx = dwn_ctx.as_ref();
2140-
2141-
// We don't ever want to use `true` on CI, as we should not
2142-
// download upstream artifacts if there are any local modifications.
2143-
let default = if dwn_ctx.is_running_on_ci {
2144-
StringOrBool::String("if-unchanged".to_string())
2145-
} else {
2146-
StringOrBool::Bool(true)
2147-
};
2148-
let download_ci_llvm = download_ci_llvm.unwrap_or(default);
2140+
let download_ci_llvm = download_ci_llvm.unwrap_or(StringOrBool::Bool(true));
21492141

21502142
let if_unchanged = || {
21512143
if rust_info.is_from_tarball() {
@@ -2177,8 +2169,9 @@ pub fn parse_download_ci_llvm<'a>(
21772169
);
21782170
}
21792171

2180-
if b && dwn_ctx.is_running_on_ci {
2181-
// On CI, we must always rebuild LLVM if there were any modifications to it
2172+
#[cfg(not(test))]
2173+
if b && dwn_ctx.is_running_on_ci && CiEnv::is_rust_lang_managed_ci_job() {
2174+
// On rust-lang CI, we must always rebuild LLVM if there were any modifications to it
21822175
panic!(
21832176
"`llvm.download-ci-llvm` cannot be set to `true` on CI. Use `if-unchanged` instead."
21842177
);

0 commit comments

Comments
 (0)