From 7d579046c80d3de3143dcb8b2db5640f95b5383c Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 19 Sep 2024 11:29:37 +0300 Subject: [PATCH 1/3] change download-ci-llvm default from "if-unchanged" to true Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 11 +++++------ src/bootstrap/src/core/config/tests.rs | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 555a6a7f8bd..dcecd7f8084 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2738,6 +2738,8 @@ impl Config { download_ci_llvm: Option, asserts: bool, ) -> bool { + let download_ci_llvm = download_ci_llvm.unwrap_or(StringOrBool::Bool(true)); + let if_unchanged = || { if self.rust_info.is_from_tarball() { // Git is needed for running "if-unchanged" logic. @@ -2761,10 +2763,7 @@ impl Config { }; match download_ci_llvm { - None => { - (self.channel == "dev" || self.download_rustc_commit.is_some()) && if_unchanged() - } - Some(StringOrBool::Bool(b)) => { + StringOrBool::Bool(b) => { if !b && self.download_rustc_commit.is_some() { panic!( "`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 { // If download-ci-llvm=true we also want to check that CI llvm is available b && llvm::is_ci_llvm_available(self, asserts) } - Some(StringOrBool::String(s)) if s == "if-unchanged" => if_unchanged(), - Some(StringOrBool::String(other)) => { + StringOrBool::String(s) if s == "if-unchanged" => if_unchanged(), + StringOrBool::String(other) => { panic!("unrecognized option for download-ci-llvm: {:?}", other) } } diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs index f54a5d3b512..a45e73b5d95 100644 --- a/src/bootstrap/src/core/config/tests.rs +++ b/src/bootstrap/src/core/config/tests.rs @@ -32,7 +32,7 @@ fn download_ci_llvm() { assert!(!parse_llvm("llvm.download-ci-llvm = false")); assert_eq!(parse_llvm(""), if_unchanged); assert_eq!(parse_llvm("rust.channel = \"dev\""), if_unchanged); - assert!(!parse_llvm("rust.channel = \"stable\"")); + assert!(parse_llvm("rust.channel = \"stable\"")); assert_eq!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\""), if_unchanged); assert_eq!( parse_llvm( From 4e090e70d16328db375fed1e8729680c27ba7935 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 19 Sep 2024 11:25:45 +0300 Subject: [PATCH 2/3] update `llvm.download-ci-llvm` documentation Signed-off-by: onur-ozkan --- config.example.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.toml b/config.example.toml index c66d65e639a..47ebb20d8fa 100644 --- a/config.example.toml +++ b/config.example.toml @@ -53,7 +53,7 @@ # # Note that many of the LLVM options are not currently supported for # downloading. Currently only the "assertions" option can be toggled. -#download-ci-llvm = if rust.channel == "dev" || rust.download-rustc != false { "if-unchanged" } else { false } +#download-ci-llvm = true # Indicates whether the LLVM build is a Release or Debug build #optimize = true From 05f10f4765893b53901f6e5543690a08d7a7da90 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Thu, 19 Sep 2024 11:27:55 +0300 Subject: [PATCH 3/3] add change-tracker for new download-ci-llvm default Signed-off-by: onur-ozkan --- src/bootstrap/src/utils/change_tracker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 379cd568647..e6f7f105fa2 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -265,4 +265,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "New option `dist.vendor` added to control whether bootstrap should vendor dependencies for dist tarball.", }, + ChangeInfo { + change_id: 130529, + severity: ChangeSeverity::Info, + summary: "If `llvm.download-ci-llvm` is not defined, it defaults to `true`.", + }, ];