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

Investigate and implement a scheme to consistently apply lints for all compiler crates #138106

Closed
jieyouxu opened this issue Mar 6, 2025 · 1 comment · Fixed by #138331
Closed
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-needs-design This issue needs exploration and design to see how and if we can fix/implement it T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Mar 6, 2025

... Especially for build scripts or proc-macro crates.

There's caveats like:

  • RUSTFLAGS is only applied to target crates, not to host crates.
  • cargo's current [lints] only supports "regular" lints not tool lints like rustc::xxx.

One possible scheme may be to...

[..] unconditionally passing an arbitrary flag and asserting its presence in each compiler crate. Ugly, but it could work I think.
#138035 (comment)

Discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Consistent.20handling.20of.20compiler.2F*.20RUSTFLAGs.20and.20lints

@jieyouxu jieyouxu added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 6, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 6, 2025
@nnethercote
Copy link
Contributor

And #138035 was a hacky initial attempt at this. Probably not appropriate to merge, but a good reference.

@jieyouxu jieyouxu added the E-needs-design This issue needs exploration and design to see how and if we can fix/implement it label Mar 8, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? `@jieyouxu`
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ``@jieyouxu``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ```@jieyouxu```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ````@jieyouxu````
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 12, 2025
…ore, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? `````@jieyouxu`````
@bors bors closed this as completed in c9c8387 Mar 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 12, 2025
Rollup merge of rust-lang#138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, r=onur-ozkan,jieyouxu

Use `RUSTC_LINT_FLAGS` more

An alternative to the failed rust-lang#138084.

Fixes rust-lang#138106.

r? ````@jieyouxu````
@jieyouxu jieyouxu changed the title Investigate and implement a scheme to consistently apply RUSTFLAGS and lints for all compiler crates Investigate and implement a scheme to consistently apply lints for all compiler crates Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-needs-design This issue needs exploration and design to see how and if we can fix/implement it T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants