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

Lints shouldn't trigger a full rebuild #9055

Closed
c410-f3r opened this issue Jan 8, 2021 · 4 comments
Closed

Lints shouldn't trigger a full rebuild #9055

c410-f3r opened this issue Jan 8, 2021 · 4 comments
Labels
C-bug Category: bug

Comments

@c410-f3r
Copy link

c410-f3r commented Jan 8, 2021

If duplicated or Rustc stuff, feel free to close to it.

When using environment variables, lints can be declared within RUSTFLAGS but anytime RUSTFLAGS changes, a full rebuild is triggered and this can lead to expensive and time consuming tasks/compilations. Forgive my ignorance since I am not a cargo expert but looks like that all lints should only affect the target crate instead of all dependencies.

@c410-f3r c410-f3r added the C-bug Category: bug label Jan 8, 2021
@c410-f3r c410-f3r changed the title Lints shouldn't trigger a full crate rebuild Lints shouldn't trigger a full rebuild Jan 8, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 8, 2021

Changes to RUSTFLAGS currently requires a full rebuild because including the flags in the filename causes problems in some situations (see #8716 for tracking this issue). Giving higher-level controls over lints is tracked in #5034. The only workaround right now is to use cargo rustc -- -Dfoo or to use different target directories.

@c410-f3r
Copy link
Author

c410-f3r commented Jan 8, 2021

@ehuss Thanks for the explanation. A different target directory looks like a reasonable alternative

I was thinking about adding something like RUSTLINTS to workaround rebuilds. Not sure is it is something feasible or if the cargo team is willing to accept such thing.

@ehuss
Copy link
Contributor

ehuss commented Jan 9, 2021

I think it would be best to have a design for #5034 and/or #8424 for controlling lints and that would hopefully consider the one-off command-line or env-var options. Unfortunately it is not clear which direction that should go, and I don't have much time to help it along. But feel free to engage on those issues or the forums to discuss various use cases and options.

@ehuss
Copy link
Contributor

ehuss commented Feb 13, 2021

Closing in preference for the linked issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants