Skip to content

Commit

Permalink
Add comment explaining why cc does not rebuild on env PATH change (#1247
Browse files Browse the repository at this point in the history
)
  • Loading branch information
NobodyXu authored Oct 19, 2024
1 parent 9aab242 commit e53eba3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3736,6 +3736,8 @@ impl Build {
if let Some(val) = self.env_cache.read().unwrap().get(v).cloned() {
return val;
}
// Excluding `PATH` prevents spurious rebuilds on Windows, see
// <https://github.com/rust-lang/cc-rs/pull/1215> for details.
if self.emit_rerun_if_env_changed && !provided_by_cargo(v) && v != "PATH" {
self.cargo_output
.print_metadata(&format_args!("cargo:rerun-if-env-changed={}", v));
Expand Down

0 comments on commit e53eba3

Please sign in to comment.