-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Run clippy on cg_gcc in CI #149458
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
Run clippy on cg_gcc in CI #149458
Conversation
|
|
| --set llvm.libzstd=true \ | ||
| --set 'rust.codegen-backends=[\"llvm\",\"gcc\"]' | ||
| ENV SCRIPT python3 ../x.py \ | ||
| ENV SCRIPT python3 ../x.py --stage 2 clippy compiler/rustc_codegen_gcc && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test both with and without --no-default-features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't. I can add that as a follow-up in the clippy rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice since the above issue would only happens without the master feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8578319 to
43bd395
Compare
This comment has been minimized.
This comment has been minimized.
43bd395 to
0626c7a
Compare
|
Fixed bootstrap tests and CI is happy. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I'm a bit confused by this 😅 We have been running Clippy on cg_gcc on CI since January 2025 (#135478). So this PR probably doesn't do exactly what you expect it to.
#149425 was blocked exactly because we run Clippy on cg_gcc in this repository, otherwise it wouldn't fail.
We could ensure that cg_gcc's Clippy version and this repo's Clippy version will stay more up-to-date, or we can change the Clippy configuration in this repo, if needed. But other than that, if we run Clippy on cg_gcc, sometimes the Clippy update will break if there are new lints triggered in cg_gcc, that's just how it is. This does not happen so much for the compiler and library, because they only apply a subset of Clippy lints. While cg_gcc is configured to -Dwarnings in this repository. This was prophesized expected.
|
I suppose it's fine if updating clippy triggers new lints in |
|
As long as it doesn't happen too often and isn't too annoying to fix, I would say that it is fine, yes. But it would be better to ask the people who do the Clippy syncs :) |
|
Fair enough! @flip1995 would it be ok if we deny clippy warnings in |
|
Yes that is fine. I've already been doing this
(apparently). I think I had to fix something twice in cg_gcc since then. This also really helps to detect bugs in Clippy during the sync! So feel free to adjust the configuration in this repo to be as close as possible with the one in the cg_gcc repo. The only thing I can't promise is that the fixes done with the Clippy version in this repo won't conflict with what Clippy sees in the |
0626c7a to
c714bb9
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
|
||
| fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | ||
| run.alias("rustc_codegen_gcc") | ||
| run.alias("rustc_codegen_gcc").path("compiler/rustc_codegen_gcc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I specifically got rid of this recently, as having subpaths of the compiler directory was causing weird behavior and conflicts with x <something> compiler. Do you need it for something specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was completely unable to figure out how to run clippy on cg_gcc (well until I looked at the bootstrap source code). Wouldn't it be better to fix the conflict issues instead because having to look at bootstrap source code to understand how to run a command is really bad. :-/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would require rewriting large parts of bootstrap xD I could swear that there way a way to list all bootstrap steps for a given command 🤔 If not, it would be nice to have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine fine, removing this change. But please note I'm very sad about it.
c714bb9 to
d63c326
Compare
This comment has been minimized.
This comment has been minimized.
d63c326 to
4c6544b
Compare
This comment has been minimized.
This comment has been minimized.
|
CI failed so all good. Sending fix for |
|
Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
|
Is there some way to make it more obvious in the error message that these errors come with |
90a1362 to
4501327
Compare
Hum... Except adding a |
|
You can r=me with or without the print (I agree that a print should be enough). |
|
Let's add a print then. |
|
Added the print. Let's go then. @bors r=kobzol rollup |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc `@antoyo` r? `@Kobzol`
Rollup of 6 pull requests Successful merges: - #147602 (Deduplicate higher-ranked lifetime capture errors in impl Trait) - #147725 (Remove -Zoom=panic) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #148717 (Point at span within local macros even when error happens in nested external macro) - #149458 (Run clippy on cg_gcc in CI) - #149816 (Make typo in field and name suggestions verbose) r? `@ghost` `@rustbot` modify labels: rollup
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ``@antoyo`` r? ``@Kobzol``
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ```@antoyo``` r? ```@Kobzol```
Rollup of 12 pull requests Successful merges: - #147602 (Deduplicate higher-ranked lifetime capture errors in impl Trait) - #147725 (Remove -Zoom=panic) - #148294 (callconv: fix mips64 aggregate argument passing for C FFI) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #149417 (tidy: Detect outdated workspaces in workspace list) - #149458 (Run clippy on cg_gcc in CI) - #149679 (Restrict spe_acc to PowerPC SPE targets) - #149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - #149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - #149816 (Make typo in field and name suggestions verbose) - #149824 (Add a regression test for issue 145748) - #149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 10 pull requests Successful merges: - #147725 (Remove -Zoom=panic) - #148294 (callconv: fix mips64 aggregate argument passing for C FFI) - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - #149458 (Run clippy on cg_gcc in CI) - #149679 (Restrict spe_acc to PowerPC SPE targets) - #149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - #149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - #149816 (Make typo in field and name suggestions verbose) - #149824 (Add a regression test for issue 145748) - #149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #149458 - GuillaumeGomez:clippy-cg_gcc, r=kobzol Run clippy on cg_gcc in CI This is to prevent [this issue](#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Rollup of 10 pull requests Successful merges: - rust-lang/rust#147725 (Remove -Zoom=panic) - rust-lang/rust#148294 (callconv: fix mips64 aggregate argument passing for C FFI) - rust-lang/rust#148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type) - rust-lang/rust#149458 (Run clippy on cg_gcc in CI) - rust-lang/rust#149679 (Restrict spe_acc to PowerPC SPE targets) - rust-lang/rust#149781 (Don't suggest wrapping attr in unsafe if it may come from proc macro) - rust-lang/rust#149795 (Use `let`...`else` instead of `match foo { ... _ => return };` and `if let ... else return` in std) - rust-lang/rust#149816 (Make typo in field and name suggestions verbose) - rust-lang/rust#149824 (Add a regression test for issue 145748) - rust-lang/rust#149826 (compiletest: tidy up `adb_path`/`adb_test_dir` handling) r? `@ghost` `@rustbot` modify labels: rollup
This is to prevent this issue: in cg_gcc repository, we run clippy on our code but not in here, which can create issues.
cc @antoyo
r? @Kobzol