Skip to content

bootstrap: explicitly request copying rustc-dev artifacts for rustfmt/clippy under download-rustc#156528

Open
jieyouxu wants to merge 1 commit into
rust-lang:mainfrom
jieyouxu:jieyouxu/fix/rustfmt-download-rustc
Open

bootstrap: explicitly request copying rustc-dev artifacts for rustfmt/clippy under download-rustc#156528
jieyouxu wants to merge 1 commit into
rust-lang:mainfrom
jieyouxu:jieyouxu/fix/rustfmt-download-rustc

Conversation

@jieyouxu
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu commented May 13, 2026

Summary

#t-infra/bootstrap > x run rustfmt works but x test rustfmt fails to compile reported that ./x test rustfmt --stage={1,2} no longer works with download-rustc.

  • This seems to be due to us removing some manual builder.ensure(Rustc)s around the times of stage 0 rejiggling.
  • Because compile::Sysroot::run has a quirky non-trivial behavior regarding rustc-dev artifact copying under download-rustc, tracing back to sysroot dep resolution troubles (cf. tests/ui/allocator/no_std-alloc-error-handler* fail when download-rustc is enabled #108767), we need to explicitly ensure(Rustc) to opt-in to rustc-dev artifact copying under download-rustc.
  • For the short-term, let's insert manual ensures to force rustc-dev artifact copying under download-rustc to unblock rustfmt/clippy contributors who want to use download-rustc (to avoid having to build the compiler).

Testing

Use a dummy config: bootstrap.rustfmt.toml

profile = "tools"
change-id = "ignore"

[rust]
# Force download-rustc, needed because we modify bootstrap which makes
# `if-unchanged` ineligible.
download-rustc = true

Run:

  • ./x test rustfmt --config=bootstrap.rustfmt.toml --stage=1
  • ./x test rustfmt --config=bootstrap.rustfmt.toml --stage=2
  • ./x test clippy --config=bootstrap.rustfmt.toml --stage=1
  • ./x test clippy --config=bootstrap.rustfmt.toml --stage=2

When reviewing, also check that if you revert the commit / this PR, that invocations above fail (which is the case against main for me).

Tested also without download-rustc to make sure ./x test {rustfmt,clippy} --stage={1,2} still works.

Notes

This is by no means a proper fix, but it should unblock local tool profile workflows trying to use download-rustc with {rustfmt,clippy}. I don't think it's worth blocking over that.

Efforts for a more proper fix should be tracked by #156525, I left FIXMEs pointing to that.

…download-rustc

This is by no means a proper fix, but it should unblock local tool
profile workflows trying to use `download-rustc` with {rustfmt,clippy}.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 13, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 13, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789

@jieyouxu jieyouxu added the A-download-rustc Area: The `rust.download-rustc` build option. label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-download-rustc Area: The `rust.download-rustc` build option. A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants