-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unnecessary cache invalidation when setting environment variables #12434
Comments
Good catch. Thanks for reporting this! We should perhaps switch from cargo/src/cargo/core/compiler/fingerprint/mod.rs Lines 776 to 784 in 3a34fca
@rustbot label +A-rebuild-detection +A-environment-variables -S-triage +S-accepted |
@rustbot claim |
See also #10358. |
Sorry, did I make a mistake? It seems to have nothing to do with environment variables. As long as |
Going to close this, as it is essentially #10358. I'll post an update there. |
Problem
When an environment variable is set in configuration, build scripts unnecessarily rerun in the following scenarios:
FOO=BAR
is set both in the env and in the config file)force = true
, but explicitly setting that environment variable causes build scripts to rerunSteps
No response
Possible Solution(s)
No response
Notes
These cases were found when running
cargo build
from a process running undercargo run
. The nested build had env vars in the config explicitly set in its environment. Removing these vars caused build scripts to not rerun and caches to be reused.Version
The text was updated successfully, but these errors were encountered: