Skip to content

Enforce in bootstrap that clippy must have stage at least 1 #145131

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 8, 2025

This mostly piggybacks on the previous x check rework.

The new "rules" follow the new staging logic. So x clippy <foo> lints foo using stage0 Clippy. x clippy --stage 2 <foo> lints foo using stage1 Clippy (which is built from in-tree sources).

I had to fix some latent issues with prepare_compiler_for_check along the way.

Checking rustc_private tools should now check less compiler crates (or rather not check compiler examples/tests/etc.), potentially speeding it up slightly.

I also had to switch x clippy ci to stage 2, so that it actually lints stuff using in-tree Clippy.

r? @jieyouxu

@rustbot rustbot added A-bootstrap-stamp Area: bootstrap stamp logic A-CI Area: Our Github Actions CI 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 8, 2025

This PR modifies src/bootstrap/src/core/config.

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

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_compiler_no_explicit_stage
Source: src/bootstrap/src/core/builder/tests.rs:1278
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").path("compiler").render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ [check] rustc 0 <host> -> rustc 1 <host>
          1 │+[check] rustc 0 <host> -> rustc 1 <host>
    1     2 │ [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
    2     3 │ [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
────────────┴───────────────────────────────────────────────────────────────────
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

thread 'core::builder::tests::snapshot::check_compiler_no_explicit_stage' panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.43.1/src/runtime.rs:679:13:
snapshot assertion for 'check_compiler_no_explicit_stage' failed in line 1278
---
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_compiler_stage_1
Source: src/bootstrap/src/core/builder/tests.rs:1309
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").path("compiler").stage(1).render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ [check] rustc 0 <host> -> rustc 1 <host>
          1 │+[check] rustc 0 <host> -> rustc 1 <host>
    1     2 │ [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
    2     3 │ [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
────────────┴───────────────────────────────────────────────────────────────────
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

thread 'core::builder::tests::snapshot::check_compiler_stage_1' panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.43.1/src/runtime.rs:679:13:
snapshot assertion for 'check_compiler_stage_1' failed in line 1309

---- core::builder::tests::snapshot::check_compiler_stage_2 stdout ----
Running test in /tmp/.tmp0VdCSp
##[group]Building LLVM for aarch64-unknown-linux-gnu
##[endgroup]
---
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_compiler_stage_2
Source: src/bootstrap/src/core/builder/tests.rs:1323
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").path("compiler").stage(2).render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ [build] llvm <host>
    1     1 │ [build] rustc 0 <host> -> rustc 1 <host>
    2     2 │ [build] rustc 1 <host> -> std 1 <host>
    3     3 │ [check] rustc 1 <host> -> rustc 2 <host>
          4 │+[check] rustc 1 <host> -> rustc 2 <host>
    4     5 │ [check] rustc 1 <host> -> rustc_codegen_cranelift 2 <host>
    5     6 │ [check] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
────────────┴───────────────────────────────────────────────────────────────────
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

thread 'core::builder::tests::snapshot::check_compiler_stage_2' panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.43.1/src/runtime.rs:679:13:
snapshot assertion for 'check_compiler_stage_2' failed in line 1323

---- core::builder::tests::snapshot::check_cross_compile stdout ----
Running test in /tmp/.tmpGBifag
##[group]Building LLVM for aarch64-unknown-linux-gnu
##[endgroup]
---
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_cross_compile
Source: src/bootstrap/src/core/builder/tests.rs:1340
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").targets(&[TEST_TRIPLE_1]).hosts(&[TEST_TRIPLE_1]).render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    1     1 │ [build] rustc 0 <host> -> rustc 1 <host>
    2     2 │ [build] rustc 1 <host> -> std 1 <host>
    3     3 │ [build] rustc 1 <host> -> std 1 <target1>
    4     4 │ [check] rustc 1 <host> -> rustc 2 <target1>
          5 │+[check] rustc 1 <host> -> rustc 2 <target1>
    5     6 │ [check] rustc 1 <host> -> Rustdoc 2 <target1>
    6     7 │ [check] rustc 1 <host> -> rustc_codegen_cranelift 2 <target1>
    7     8 │ [check] rustc 1 <host> -> rustc_codegen_gcc 2 <target1>
    8     9 │ [check] rustc 1 <host> -> Clippy 2 <target1>
────────────┴───────────────────────────────────────────────────────────────────
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

thread 'core::builder::tests::snapshot::check_cross_compile' panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.43.1/src/runtime.rs:679:13:
snapshot assertion for 'check_cross_compile' failed in line 1340
---
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot: check_library_skip_without_download_rustc-2
Source: src/bootstrap/src/core/builder/tests.rs:1440
────────────────────────────────────────────────────────────────────────────────
Expression: ctx.config("check").paths(&["library", "compiler"]).args(&args).render_steps()
────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────
    0     0 │ [check] rustc 0 <host> -> rustc 1 <host>
          1 │+[check] rustc 0 <host> -> rustc 1 <host>
    1     2 │ [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
    2     3 │ [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
────────────┴───────────────────────────────────────────────────────────────────
Stopped on the first failure. Run `cargo insta test` to run all snapshots.

thread 'core::builder::tests::snapshot::check_library_skip_without_download_rustc' panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/insta-1.43.1/src/runtime.rs:679:13:
snapshot assertion for 'check_library_skip_without_download_rustc-2' failed in line 1440


failures:
    core::builder::tests::snapshot::check_compiler_no_explicit_stage
    core::builder::tests::snapshot::check_compiler_stage_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bootstrap-stamp Area: bootstrap stamp logic A-CI Area: Our Github Actions CI 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) 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