-
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
Cargo fails to detect environment variable is newly set and rebuild if the environment variable is set in config.toml
#13280
Comments
config.toml
config.toml
Hmm… I don't quite think so. It is related to cargo's own dep-info file failed to track env vars from cargo/src/cargo/core/compiler/fingerprint/mod.rs Lines 2017 to 2019 in 0c98d6e
env vars from |
Note: #13596 was an attempt of addressing this issue. In that PR, maintainers expected that kind of environment variable detection to be in the fingerprint code, where Cargo's dep-info logic is located. |
#14154 is another case that Cargo's depinfo strips internal set environment variables (such as |
If the user just wants the environment variables in the [env] table to trigger recompilation, can we just fix that This is a likely solution,
|
Problem
The problem can be only reproduced if the environment variable is "not set" in the first run, and "set" in the second run.
Steps
Incorrect behaivor
.cargo/config.toml:
src/main.rs:
run these commands:
Correct behaivor if we do not use a
config.toml
src/main.rs:
run these commands:
Correct behaivor if we change the environment variable from a value to another value
.cargo/config.toml:
src/main.rs:
run these commands:
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: