Skip to content
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

refactor clippy in bootstrap #122883

Merged
merged 8 commits into from
Apr 17, 2024
Merged

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Mar 22, 2024

Previously, using clippy in bootstrap was not very useful as explained in #122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run x clippy compiler -Aclippy::all -Dclippy::correctness and x clippy library/std -Dclippy::all and none of them will affect each other).

Resolves #122825

@rustbot rustbot added 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 Mar 22, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 22, 2024
@onur-ozkan onur-ozkan marked this pull request as ready for review March 22, 2024 16:08
@rustbot
Copy link
Collaborator

rustbot commented Mar 22, 2024

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.

@onur-ozkan onur-ozkan 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 Mar 22, 2024
@onur-ozkan onur-ozkan force-pushed the clippy-build-step branch 2 times, most recently from 879b09a to e6a675c Compare March 22, 2024 21:22
@onur-ozkan
Copy link
Member Author

I was planning to run clippy on bootstrap and various other tools on CI, which means I will need to make some more changes to fix clippy warnings. As it makes this PR difficult to review, I will do that as a follow-up to this PR once it's merged.

r? bootstrap

@onur-ozkan onur-ozkan 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 Mar 22, 2024
@onur-ozkan onur-ozkan changed the title WIP: refactor clippy in bootstrap refactor clippy in bootstrap Mar 22, 2024
@albertlarsan68
Copy link
Member

Thanks for the PR!
@bors r+

@bors
Copy link
Contributor

bors commented Apr 16, 2024

📌 Commit e6a675c has been approved by albertlarsan68

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 Apr 16, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 16, 2024
…bertlarsan68

refactor clippy in bootstrap

Previously, using clippy in bootstrap was not very useful as explained in rust-lang#122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run `x clippy compiler -Aclippy::all -Dclippy::correctness` and `x clippy library/std -Dclippy::all` and none of them will affect each other).

Resolves rust-lang#122825
@matthiaskrgr
Copy link
Member

probably failing in #124025 (comment)

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Previously this command was linting compiler and library together.
As we no longer run clippy on the entire tree unless it's explicitly
requested, we need to update this command by adding `library` path.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan
Copy link
Member Author

probably failing in #124025 (comment)

Rebased. @bors r=albertlarsan68

@bors
Copy link
Contributor

bors commented Apr 16, 2024

📌 Commit 16cf0e6 has been approved by albertlarsan68

It is now in the queue for this repository.

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#122813 (Qualifier tweaking)
 - rust-lang#122883 (refactor clippy in bootstrap)
 - rust-lang#123997 (Delay span bug when `Self` kw resolves to `DefKind::{Mod,Trait}`)
 - rust-lang#124045 (Reinstate nnethercote to the review rotation.)
 - rust-lang#124051 (Fix empty-set symbol in comments)
 - rust-lang#124052 (Make the comments for `ReturnDest` variants doc comments)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8229a34 into rust-lang:master Apr 17, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2024
Rollup merge of rust-lang#122883 - onur-ozkan:clippy-build-step, r=albertlarsan68

refactor clippy in bootstrap

Previously, using clippy in bootstrap was not very useful as explained in rust-lang#122825. In short, regardless of the given path clippy would always check the entire compiler and std tree. This makes it impossible to run clippy on different paths with different set of rules. This PR fixes that by allowing developers to run clippy with specific rules on specific paths (e.g., we can run `x clippy compiler -Aclippy::all -Dclippy::correctness` and `x clippy library/std -Dclippy::all` and none of them will affect each other).

Resolves rust-lang#122825
@onur-ozkan onur-ozkan deleted the clippy-build-step branch April 17, 2024 06:18
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.

x clippy implementation is deeply coupled with the core bootstrap
6 participants