diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-01 17:47:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-01 17:47:05 +0200 |
| commit | 8b0e7d7cc9fd74cadaf33551352ce04e52d2c06e (patch) | |
| tree | 720b8d7dc8c129865b450e90f1cc9e8d972c8661 | |
| parent | 61bb0764596cbf39a76b16fe0f2af5e3434813bc (diff) | |
| parent | c2daa280209b5a72a4393cee9214fc773f13c6c7 (diff) | |
| download | rust-8b0e7d7cc9fd74cadaf33551352ce04e52d2c06e.tar.gz rust-8b0e7d7cc9fd74cadaf33551352ce04e52d2c06e.zip | |
Rollup merge of #143255 - Kobzol:disable-lld-by-default, r=jieyouxu
Do not enable LLD by default in the dist profile
History of us building & shipping LLD for `dist` builds:
1) We used to unconditionally build & ship LLD in bootstrap
2) This was causing problems for people doing custom `dist` builds (https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/MSVC.20Runtime.20mismatch.20when.20building.20LLD)
3) https://github.com/rust-lang/rust/pull/126701 made shipping of LLD optional, but to preserve previous behavior, it forcefully enabled `rust.lld = true` in the `dist` profile by default, and overwrote the default to `false` on our CI for external LLVM builds.
- This also didn't match the documentation of `rust.lld` in `bootstrap.example.toml`, which I previously missed.
4) However, since the external LLVM opt-out was only implemented for our CI, and not for all `dist` users, this started causing issues for people `dist`ing with external LLVM (https://github.com/rust-lang/rust/issues/143076). The problem is that the default shouldn't be "true", but "LLD is enabled when LLVM isn't external", but this is not possible to do only in TOML.
So this PR reverses the behavior. LLD is not enabled by default in `dist` anymore. We switch our CI to *opt into* disting LLD, unless an external LLVM is used. External `dist` users can still opt into enabling LLD, but if they do so while also using external LLVM, they will now get a [hard error](https://github.com/rust-lang/rust/pull/143175).
r? `@jieyouxu`
try-job: `x86_64-mingw*`
try-job: dist-x86_64-linux
| -rw-r--r-- | src/bootstrap/defaults/bootstrap.dist.toml | 1 | ||||
| -rw-r--r-- | src/bootstrap/src/utils/change_tracker.rs | 5 | ||||
| -rwxr-xr-x | src/ci/run.sh | 7 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/bootstrap/defaults/bootstrap.dist.toml b/src/bootstrap/defaults/bootstrap.dist.toml index f0cb34eb458..9daf9faac14 100644 --- a/src/bootstrap/defaults/bootstrap.dist.toml +++ b/src/bootstrap/defaults/bootstrap.dist.toml @@ -20,7 +20,6 @@ download-ci-llvm = false channel = "auto-detect" # Never download a rustc, distributions must build a fresh compiler. download-rustc = false -lld = true # Build the llvm-bitcode-linker llvm-bitcode-linker = true diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 006c294d445..f873c62588b 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -436,4 +436,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Info, summary: "It is no longer possible to combine `rust.lld = true` with configuring external LLVM using `llvm.llvm-config`.", }, + ChangeInfo { + change_id: 143255, + severity: ChangeSeverity::Warning, + summary: "`llvm.lld` is no longer enabled by default for the dist profile.", + }, ]; diff --git a/src/ci/run.sh b/src/ci/run.sh index a6721a818b3..f58a067041d 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -86,13 +86,12 @@ fi # space required for CI artifacts. RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --dist-compression-formats=xz" -if [ "$EXTERNAL_LLVM" = "1" ]; then - RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.lld=false" -fi - # Enable the `c` feature for compiler_builtins, but only when the `compiler-rt` source is available # (to avoid spending a lot of time cloning llvm) if [ "$EXTERNAL_LLVM" = "" ]; then + # Enable building & shipping lld + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.lld=true" + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.optimized-compiler-builtins" # Likewise, only demand we test all LLVM components if we know we built LLVM with them export COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS=1 |
