Skip to content

Commit 13a5097

Browse files
committed
Auto merge of #130529 - onur-ozkan:better-ci-llvm-default, r=Kobzol
change `download-ci-llvm` default from `if-unchanged` to `true` Since #129473 and #130202, using `download-ci-llvm=true` is now the better default and it also fixes #130515.
2 parents b0af276 + 05f10f4 commit 13a5097

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

Diff for: config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#
5454
# Note that many of the LLVM options are not currently supported for
5555
# downloading. Currently only the "assertions" option can be toggled.
56-
#download-ci-llvm = if rust.channel == "dev" || rust.download-rustc != false { "if-unchanged" } else { false }
56+
#download-ci-llvm = true
5757

5858
# Indicates whether the LLVM build is a Release or Debug build
5959
#optimize = true

Diff for: src/bootstrap/src/core/config/config.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -2738,6 +2738,8 @@ impl Config {
27382738
download_ci_llvm: Option<StringOrBool>,
27392739
asserts: bool,
27402740
) -> bool {
2741+
let download_ci_llvm = download_ci_llvm.unwrap_or(StringOrBool::Bool(true));
2742+
27412743
let if_unchanged = || {
27422744
if self.rust_info.is_from_tarball() {
27432745
// Git is needed for running "if-unchanged" logic.
@@ -2761,10 +2763,7 @@ impl Config {
27612763
};
27622764

27632765
match download_ci_llvm {
2764-
None => {
2765-
(self.channel == "dev" || self.download_rustc_commit.is_some()) && if_unchanged()
2766-
}
2767-
Some(StringOrBool::Bool(b)) => {
2766+
StringOrBool::Bool(b) => {
27682767
if !b && self.download_rustc_commit.is_some() {
27692768
panic!(
27702769
"`llvm.download-ci-llvm` cannot be set to `false` if `rust.download-rustc` is set to `true` or `if-unchanged`."
@@ -2774,8 +2773,8 @@ impl Config {
27742773
// If download-ci-llvm=true we also want to check that CI llvm is available
27752774
b && llvm::is_ci_llvm_available(self, asserts)
27762775
}
2777-
Some(StringOrBool::String(s)) if s == "if-unchanged" => if_unchanged(),
2778-
Some(StringOrBool::String(other)) => {
2776+
StringOrBool::String(s) if s == "if-unchanged" => if_unchanged(),
2777+
StringOrBool::String(other) => {
27792778
panic!("unrecognized option for download-ci-llvm: {:?}", other)
27802779
}
27812780
}

Diff for: src/bootstrap/src/core/config/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn download_ci_llvm() {
3232
assert!(!parse_llvm("llvm.download-ci-llvm = false"));
3333
assert_eq!(parse_llvm(""), if_unchanged);
3434
assert_eq!(parse_llvm("rust.channel = \"dev\""), if_unchanged);
35-
assert!(!parse_llvm("rust.channel = \"stable\""));
35+
assert!(parse_llvm("rust.channel = \"stable\""));
3636
assert_eq!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\""), if_unchanged);
3737
assert_eq!(
3838
parse_llvm(

Diff for: src/bootstrap/src/utils/change_tracker.rs

+5
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
265265
severity: ChangeSeverity::Info,
266266
summary: "New option `dist.vendor` added to control whether bootstrap should vendor dependencies for dist tarball.",
267267
},
268+
ChangeInfo {
269+
change_id: 130529,
270+
severity: ChangeSeverity::Info,
271+
summary: "If `llvm.download-ci-llvm` is not defined, it defaults to `true`.",
272+
},
268273
];

0 commit comments

Comments
 (0)