-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(env): cargo:rerun-if-env-changed doesn't work with env configuration #14058
base: master
Are you sure you want to change the base?
Conversation
0a264a9
to
877da76
Compare
513422b
to
cbe3643
Compare
c422491
to
08bbb58
Compare
08bbb58
to
d19af49
Compare
} else { | ||
envs.get(key).and_then(|v| v.to_owned()) | ||
} | ||
.xor(env::var_os(key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before, why are we using xor
rather than or
?
|
||
#[cfg(windows)] | ||
#[cargo_test] | ||
fn rerun_if_env_changes_config_in_windows() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add all tests in commits before any functionality changes?
#[allow(clippy::disallowed_methods)] | ||
fn from_env<K: AsRef<str>>(key: K) -> LocalFingerprint { | ||
let key = key.as_ref(); | ||
fn from_env<K: AsRef<str>>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would likely need to revert #12482.
Don't we need to update the documentation with this?
@@ -5,6 +5,109 @@ use cargo_test_support::project; | |||
use cargo_test_support::sleep_ms; | |||
use cargo_test_support::str; | |||
|
|||
#[cargo_test] | |||
fn rerun_if_env_changes_config() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw I believe this would also fix #8693.
Since we should be getting that fix "for free", could you add a test for a cargo-set env variable (don't think it has to literally be that one) and mark this PR as fixing that issue as well?
What does this PR try to resolve?
Fixes #10358
Additional information
Due to my stupidity, I screwed up the previous PR. I didn't know what to do with it, so I created a new PR.
r?@epage