Skip to content

Conversation

@GuillaumeGomez
Copy link
Member

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

@rustbot rustbot added 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Nov 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2025

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

--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 && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 29, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

Fixed bootstrap tests and CI is happy. :)

Copy link
Member

@Kobzol Kobzol left a 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.

View changes since this review

@GuillaumeGomez
Copy link
Member Author

I suppose it's fine if updating clippy triggers new lints in cg_gcc, no?

@Kobzol
Copy link
Member

Kobzol commented Dec 6, 2025

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 :)

@GuillaumeGomez
Copy link
Member Author

Fair enough!

@flip1995 would it be ok if we deny clippy warnings in cg_gcc, potentially meaning that clippy syncs will involve fixing these new warnings as well?

@antoyo
Copy link
Contributor

antoyo commented Dec 6, 2025

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.

So, what's probably missing is running clippy without the default features, then. That is what I noticed here.

@flip1995
Copy link
Member

flip1995 commented Dec 8, 2025

Yes that is fine. I've already been doing this

since January 2025

(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 cg_gcc repo. But I don't think there will be a lot of conflicts in this direction, as Clippy in this repo is always the newest possible version.

@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2025

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.

@rust-log-analyzer

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")
Copy link
Member

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?

Copy link
Member Author

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. :-/

Copy link
Member

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.

Copy link
Member Author

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.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

CI failed so all good. Sending fix for cg_gcc now. :)

@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2025

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rust-log-analyzer

This comment has been minimized.

@antoyo
Copy link
Contributor

antoyo commented Dec 9, 2025

Is there some way to make it more obvious in the error message that these errors come with --no-default-features so that people understand more easily where they come from?
Would that be helpful?

@GuillaumeGomez
Copy link
Member Author

Is there some way to make it more obvious in the error message that these errors come with --no-default-features so that people understand more easily where they come from? Would that be helpful?

Hum... Except adding a println! right before I make the call, I don't see how we can do. Sounds like something for a follow-up. :p

@Kobzol
Copy link
Member

Kobzol commented Dec 9, 2025

You can r=me with or without the print (I agree that a print should be enough).

@GuillaumeGomez
Copy link
Member Author

Let's add a print then.

@GuillaumeGomez
Copy link
Member Author

Added the print. Let's go then.

@bors r=kobzol rollup

@bors
Copy link
Collaborator

bors commented Dec 9, 2025

📌 Commit 06500aa has been approved by kobzol

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 Dec 9, 2025
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_parse v0.0.0 (/checkout/compiler/rustc_parse)
[RUSTC-TIMING] rustc_session test:false 24.082
   Compiling rustc_next_trait_solver v0.0.0 (/checkout/compiler/rustc_next_trait_solver)

Session terminated, killing shell...::group::Clock drift check
  local time: Tue Dec  9 17:13:03 UTC 2025
##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
  network time: Tue, 09 Dec 2025 17:13:03 GMT
##[endgroup]
 ...killed.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 9, 2025
…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`
bors added a commit that referenced this pull request Dec 9, 2025
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
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 10, 2025
…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``
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 10, 2025
…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```
bors added a commit that referenced this pull request Dec 10, 2025
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
bors added a commit that referenced this pull request Dec 10, 2025
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
@bors bors merged commit 573ed40 into rust-lang:main Dec 10, 2025
3 of 11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 10, 2025
rust-timer added a commit that referenced this pull request Dec 10, 2025
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````
@GuillaumeGomez GuillaumeGomez deleted the clippy-cg_gcc branch December 10, 2025 13:35
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 11, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI 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.

7 participants