Skip to content

Commit 5e9539d

Browse files
authored
Unrolled build for #143255
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) #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 (#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](#143175). r? `@jieyouxu` try-job: `x86_64-mingw*` try-job: dist-x86_64-linux
2 parents 4e97337 + c2daa28 commit 5e9539d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/bootstrap/defaults/bootstrap.dist.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ download-ci-llvm = false
2020
channel = "auto-detect"
2121
# Never download a rustc, distributions must build a fresh compiler.
2222
download-rustc = false
23-
lld = true
2423
# Build the llvm-bitcode-linker
2524
llvm-bitcode-linker = true
2625

src/bootstrap/src/utils/change_tracker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,4 +436,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
436436
severity: ChangeSeverity::Info,
437437
summary: "It is no longer possible to combine `rust.lld = true` with configuring external LLVM using `llvm.llvm-config`.",
438438
},
439+
ChangeInfo {
440+
change_id: 143255,
441+
severity: ChangeSeverity::Warning,
442+
summary: "`llvm.lld` is no longer enabled by default for the dist profile.",
443+
},
439444
];

src/ci/run.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,12 @@ fi
8686
# space required for CI artifacts.
8787
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --dist-compression-formats=xz"
8888

89-
if [ "$EXTERNAL_LLVM" = "1" ]; then
90-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.lld=false"
91-
fi
92-
9389
# Enable the `c` feature for compiler_builtins, but only when the `compiler-rt` source is available
9490
# (to avoid spending a lot of time cloning llvm)
9591
if [ "$EXTERNAL_LLVM" = "" ]; then
92+
# Enable building & shipping lld
93+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.lld=true"
94+
9695
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.optimized-compiler-builtins"
9796
# Likewise, only demand we test all LLVM components if we know we built LLVM with them
9897
export COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS=1

0 commit comments

Comments
 (0)