Skip to content

Do not enable LLD by default in the dist profile #143255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jun 30, 2025

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. ignore llvm::Lld if lld is not enabled #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 disting with external LLVM (rustc-1.88.0 does not build using external LLVM due to missing rust-lld #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.

r? @jieyouxu

try-job: x86_64-mingw*
try-job: dist-x86_64-linux

@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2025

jieyouxu is not on the review rotation at the moment.
They may take a while to respond.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jun 30, 2025
@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 30, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 30, 2025

⌛ Trying commit 595b89b with merge a41cd18

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 30, 2025
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
@rust-bors
Copy link

rust-bors bot commented Jun 30, 2025

💔 Test failed

@Kobzol
Copy link
Contributor Author

Kobzol commented Jun 30, 2025

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 30, 2025

⌛ Trying commit 595b89b with merge 0006654

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 30, 2025
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
@rust-bors
Copy link

rust-bors bot commented Jun 30, 2025

☀️ Try build successful (CI)
Build commit: 0006654 (000665474f1545b250d77cc0e26fedb2ebd07279, parent: c65dccabacdfd6c8a7f7439eba13422fdd89b91e)

@bors
Copy link
Collaborator

bors commented Jul 1, 2025

☔ The latest upstream changes (presumably #143254) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 1, 2025
@Kobzol Kobzol force-pushed the disable-lld-by-default branch from 595b89b to c2daa28 Compare July 1, 2025 06:20
@Kobzol Kobzol marked this pull request as ready for review July 1, 2025 06:20
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2025

This PR modifies src/bootstrap/defaults.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@jieyouxu jieyouxu removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 1, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jieyouxu
Copy link
Member

jieyouxu commented Jul 1, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 1, 2025

📌 Commit c2daa28 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 1, 2025
bors added a commit that referenced this pull request Jul 1, 2025
Rollup of 12 pull requests

Successful merges:

 - #136801 (Implement `Random` for tuple)
 - #141867 (Describe Future invariants more precisely)
 - #142760 (docs(fs): Touch up grammar on lock api)
 - #143181 (Improve testing and error messages for malformed attributes)
 - #143210 (`tests/ui`: A New Order [19/N] )
 - #143212 (`tests/ui`: A New Order [20/N])
 - #143230 ([COMPILETEST-UNTANGLE 2/N] Make some compiletest errors/warnings/help more visually obvious)
 - #143240 (Port `#[rustc_object_lifetime_default]` to the new attribute parsing …)
 - #143255 (Do not enable LLD by default in the dist profile)
 - #143262 (mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`)
 - #143269 (bootstrap: make comment more clear)
 - #143279 (Remove `ItemKind::descr` method)

Failed merges:

 - #143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8b0e7d7 into rust-lang:master Jul 1, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 1, 2025
rust-timer added a commit that referenced this pull request Jul 1, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants