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 14 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

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Aug 11, 2025

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

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, some questions

@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 11, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 11, 2025

Rebased.

@@ -28,7 +28,7 @@ RUN sh /scripts/sccache.sh

ENV SCRIPT \
python3 ../x.py check && \
python3 ../x.py clippy ci && \
python3 ../x.py clippy ci --stage 2 && \
Copy link
Member

Choose a reason for hiding this comment

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

Question: wait, this involves building stage 2 rustc, right...?

[build] rustc 0 <host> -> clippy-driver 1 <host>
[build] rustc 0 <host> -> cargo-clippy 1 <host>
[clippy] rustc 1 <host> -> bootstrap 2 <host>
[build] rustc 1 <host> -> rustc 2 <host>
Copy link
Member

Choose a reason for hiding this comment

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

^ this

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, not building, but linting stage2 rustc. That should be the same as before, because we linted rustc (stage2) using in-tree Clippy (stage1).

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, the log shows [build], I see xD I'll check.

@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Member Author

Kobzol commented Aug 11, 2025

I realized that x clippy ci is special enough to warrant a custom/manual selection of the invoked steps, effectively bypassing normal staging. I tried to optimize it to build as few things as possible.

@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Member Author

Kobzol commented Aug 12, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 12, 2025
@rust-log-analyzer

This comment has been minimized.

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.

5 participants