Skip to content

Commit ea6b131

Browse files
committed
Auto merge of rust-lang#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 rust-lang#110087 issue before. cc `@RalfJung`
2 parents 4cb3bee + 2344642 commit ea6b131

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

config.example.toml

+6-9
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,15 @@ change-id = 116881
4242
# Unless you're developing for a target where Rust CI doesn't build a compiler
4343
# toolchain or changing LLVM locally, you probably want to leave this enabled.
4444
#
45-
# Set this to `"if-available"` if you are not sure whether you're on a tier 1
46-
# target. All tier 1 targets are currently supported;
47-
#
48-
# We also currently only support this when building LLVM for the build triple.
49-
#
50-
# Set this to `"if-unchanged"` to only download if the llvm-project have not
51-
# been modified. (If there are no changes or if built from tarball source,
52-
# the logic is the same as "if-available")
45+
# Set this to `"if-unchanged"` to download only if the llvm-project has not
46+
# been modified. You can also use this if you are unsure whether you're on a
47+
# tier 1 target. All tier 1 targets are currently supported.
48+
49+
# Currently, we only support this when building LLVM for the build triple.
5350
#
5451
# Note that many of the LLVM options are not currently supported for
5552
# downloading. Currently only the "assertions" option can be toggled.
56-
#download-ci-llvm = if rust.channel == "dev" { "if-available" } else { false }
53+
#download-ci-llvm = if rust.channel == "dev" { "if-unchanged" } else { false }
5754

5855
# Indicates whether the LLVM build is a Release or Debug build
5956
#optimize = true

src/bootstrap/defaults/config.compiler.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ lto = "off"
1717

1818
[llvm]
1919
# Will download LLVM from CI if available on your platform.
20-
download-ci-llvm = "if-available"
20+
download-ci-llvm = "if-unchanged"

src/bootstrap/defaults/config.library.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ lto = "off"
1313

1414
[llvm]
1515
# Will download LLVM from CI if available on your platform.
16-
download-ci-llvm = "if-available"
16+
download-ci-llvm = "if-unchanged"

src/bootstrap/defaults/config.tools.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ compiler-docs = true
2121

2222
[llvm]
2323
# Will download LLVM from CI if available on your platform.
24-
download-ci-llvm = "if-available"
24+
download-ci-llvm = "if-unchanged"

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

+2
Original file line numberDiff line numberDiff line change
@@ -2113,6 +2113,8 @@ impl Config {
21132113
match download_ci_llvm {
21142114
None => self.channel == "dev" && llvm::is_ci_llvm_available(&self, asserts),
21152115
Some(StringOrBool::Bool(b)) => b,
2116+
// FIXME: "if-available" is deprecated. Remove this block later (around mid 2024)
2117+
// to not break builds between the recent-to-old checkouts.
21162118
Some(StringOrBool::String(s)) if s == "if-available" => {
21172119
llvm::is_ci_llvm_available(&self, asserts)
21182120
}

src/bootstrap/src/tests/config.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ fn download_ci_llvm() {
2424
}
2525

2626
let parse_llvm = |s| parse(s).llvm_from_ci;
27-
let if_available = parse_llvm("llvm.download-ci-llvm = \"if-available\"");
27+
let if_unchanged = parse_llvm("llvm.download-ci-llvm = \"if-unchanged\"");
2828

2929
assert!(parse_llvm("llvm.download-ci-llvm = true"));
3030
assert!(!parse_llvm("llvm.download-ci-llvm = false"));
31-
assert_eq!(parse_llvm(""), if_available);
32-
assert_eq!(parse_llvm("rust.channel = \"dev\""), if_available);
31+
assert_eq!(parse_llvm(""), if_unchanged);
32+
assert_eq!(parse_llvm("rust.channel = \"dev\""), if_unchanged);
3333
assert!(!parse_llvm("rust.channel = \"stable\""));
3434
assert!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\""));
3535
assert!(parse_llvm(
36-
"llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-available\""
36+
"llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-unchanged\""
3737
));
3838
assert!(!parse_llvm(
39-
"llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-available\""
39+
"llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-unchanged\""
4040
));
4141
}
4242

src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ else
145145
# LLVM continuously on at least some builders to ensure it works, though.
146146
# (And PGO is its own can of worms).
147147
if [ "$NO_DOWNLOAD_CI_LLVM" = "" ]; then
148-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.download-ci-llvm=if-available"
148+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.download-ci-llvm=if-unchanged"
149149
else
150150
# When building for CI we want to use the static C++ Standard library
151151
# included with LLVM, since a dynamic libstdcpp may not be available.

src/ci/scripts/install-clang.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ elif isWindows && [[ ${CUSTOM_MINGW-0} -ne 1 ]]; then
5858
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
5959

6060
# Disable downloading CI LLVM on this builder;
61-
# setting up clang-cl just above conflicts with the default if-available option.
61+
# setting up clang-cl just above conflicts with the default if-unchanged option.
6262
ciCommandSetEnv NO_DOWNLOAD_CI_LLVM 1
6363
fi
6464

0 commit comments

Comments
 (0)