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

Fix x.py clippy to be less janky #95988

Closed
jyn514 opened this issue Apr 12, 2022 · 3 comments · Fixed by #117595
Closed

Fix x.py clippy to be less janky #95988

jyn514 opened this issue Apr 12, 2022 · 3 comments · Fixed by #117595
Labels
E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2022

I hacked this together when I implemented it originally (#77351) and it breaks quite frequently because it uses the host toolchain instead of being managed by bootstrap.

I think ideally the fix would look something like:

  • Download clippy for the bootstrap toolchain in bootstrap.py (look for add_component)
  • Remove all this hacky code running rustc --version; treat it just the same as --cfg=bootstrap for build and check.
  • Either put a todo!() for stages other than 0, or build tool::Clippy in-tree before running them, rather than the host clippy.

Originally posted by @jyn514 in #95766 (comment)

@jyn514
Copy link
Member Author

jyn514 commented Apr 12, 2022

@rustbot label +A-rustbuild +E-mentor +E-medium

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Apr 12, 2022
@matthiaskrgr
Copy link
Member

Note: right now an easy workaround that works 99% of the time for running x.py clippy is to just use clippy from the master toolchain (via rtim, switch master toolchain to the default one) and then run x.py clippy 😇

@jyn514
Copy link
Member Author

jyn514 commented Apr 12, 2022

Yes, that works. But it would be nice to not need the workaround.

(I think cargo +beta clippy should also work? but haven't tested in a while)

@sebblanchet sebblanchet removed their assignment May 1, 2022
@jyn514 jyn514 mentioned this issue Nov 5, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 16, 2023
x clippy

thanks to `@asquared31415` `@albertlarsan68` for all their help, most of this pr is their work

note that this also adds x clippy --stage 0 -Awarnings to x86_64-gnu-llvm-15 to make sure it stays working; that won't gate on any clippy warnings, just enforce that clippy doesn't give a hard error. we can't add --stage 1 until clippy fixes its debug assertions not to panic.

note that `x clippy --stage 1` currently breaks when combined with download-rustc.

unlike the previous prs, this doesn't require changes to clippy (it works by using RUSTC_WRAPPER instead), and supports stage 0

read this commit-by-commit

closes rust-lang#107628; see also rust-lang#106394, rust-lang#97443. fixes rust-lang#95988. helps with rust-lang#76495.

r? bootstrap
@bors bors closed this as completed in 4451777 Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
4 participants