about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-18 23:02:12 +0000
committerbors <bors@rust-lang.org>2023-11-18 23:02:12 +0000
commitea6b131132eb383e8f4ae136fc39c4dec53b8ec6 (patch)
tree185024c6243f641e144de99ba18546e63f211da3 /src/bootstrap
parent4cb3beec86178baff601529389306a4949b077ce (diff)
parent23446427fe476f8f767e6ef34439a0f3f11af788 (diff)
downloadrust-ea6b131132eb383e8f4ae136fc39c4dec53b8ec6.tar.gz
rust-ea6b131132eb383e8f4ae136fc39c4dec53b8ec6.zip
Auto merge of #117813 - onur-ozkan:simplify-download-ci-llvm-option, r=Mark-Simulacrum
deprecate `if-available` value of `download-ci-llvm`

This PR deprecates the use of the `if-available` value for `download-ci-llvm` since `if-unchanged` serves the same purpose when no changes are detected. In cases where changes are present, it is assumed that compiling LLVM is acceptable (otherwise, why make changes there?).

This was probably missing in the #110087 issue before.

cc `@RalfJung`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/defaults/config.compiler.toml2
-rw-r--r--src/bootstrap/defaults/config.library.toml2
-rw-r--r--src/bootstrap/defaults/config.tools.toml2
-rw-r--r--src/bootstrap/src/core/config/config.rs2
-rw-r--r--src/bootstrap/src/tests/config.rs10
5 files changed, 10 insertions, 8 deletions
diff --git a/src/bootstrap/defaults/config.compiler.toml b/src/bootstrap/defaults/config.compiler.toml
index b98b13119e8..b27b524b873 100644
--- a/src/bootstrap/defaults/config.compiler.toml
+++ b/src/bootstrap/defaults/config.compiler.toml
@@ -17,4 +17,4 @@ lto = "off"
 
 [llvm]
 # Will download LLVM from CI if available on your platform.
-download-ci-llvm = "if-available"
+download-ci-llvm = "if-unchanged"
diff --git a/src/bootstrap/defaults/config.library.toml b/src/bootstrap/defaults/config.library.toml
index f362c4111f1..087544397f5 100644
--- a/src/bootstrap/defaults/config.library.toml
+++ b/src/bootstrap/defaults/config.library.toml
@@ -13,4 +13,4 @@ lto = "off"
 
 [llvm]
 # Will download LLVM from CI if available on your platform.
-download-ci-llvm = "if-available"
+download-ci-llvm = "if-unchanged"
diff --git a/src/bootstrap/defaults/config.tools.toml b/src/bootstrap/defaults/config.tools.toml
index 79424f28d27..6e6c3660027 100644
--- a/src/bootstrap/defaults/config.tools.toml
+++ b/src/bootstrap/defaults/config.tools.toml
@@ -21,4 +21,4 @@ compiler-docs = true
 
 [llvm]
 # Will download LLVM from CI if available on your platform.
-download-ci-llvm = "if-available"
+download-ci-llvm = "if-unchanged"
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 0a9175aa3ea..fa8b0b20cec 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -2113,6 +2113,8 @@ impl Config {
         match download_ci_llvm {
             None => self.channel == "dev" && llvm::is_ci_llvm_available(&self, asserts),
             Some(StringOrBool::Bool(b)) => b,
+            // FIXME: "if-available" is deprecated. Remove this block later (around mid 2024)
+            // to not break builds between the recent-to-old checkouts.
             Some(StringOrBool::String(s)) if s == "if-available" => {
                 llvm::is_ci_llvm_available(&self, asserts)
             }
diff --git a/src/bootstrap/src/tests/config.rs b/src/bootstrap/src/tests/config.rs
index 59bd52a94dc..a8106ca8ff9 100644
--- a/src/bootstrap/src/tests/config.rs
+++ b/src/bootstrap/src/tests/config.rs
@@ -24,19 +24,19 @@ fn download_ci_llvm() {
     }
 
     let parse_llvm = |s| parse(s).llvm_from_ci;
-    let if_available = parse_llvm("llvm.download-ci-llvm = \"if-available\"");
+    let if_unchanged = parse_llvm("llvm.download-ci-llvm = \"if-unchanged\"");
 
     assert!(parse_llvm("llvm.download-ci-llvm = true"));
     assert!(!parse_llvm("llvm.download-ci-llvm = false"));
-    assert_eq!(parse_llvm(""), if_available);
-    assert_eq!(parse_llvm("rust.channel = \"dev\""), if_available);
+    assert_eq!(parse_llvm(""), if_unchanged);
+    assert_eq!(parse_llvm("rust.channel = \"dev\""), if_unchanged);
     assert!(!parse_llvm("rust.channel = \"stable\""));
     assert!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\""));
     assert!(parse_llvm(
-        "llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-available\""
+        "llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-unchanged\""
     ));
     assert!(!parse_llvm(
-        "llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-available\""
+        "llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-unchanged\""
     ));
 }