mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Auto merge of #11281 - smheidrich:fix-stale-mtime-log-ineq, r=ehuss
Fix inequality in "stale mtime" log messages ### What does this PR try to resolve? If `CARGO_LOG=cargo::core::compiler::fingerprint=info` is set, cargo will print log messages that are useful for finding out why something is being recompiled. E.g. if the modification time (mtime) of a source file is newer than the cached build result, it will print something like: ``` stale: changed "/host//home/runner/.cargo/registry/src/github.com-1285ae84e5963aae/proc-macro2-1.0.47/build.rs" (vs) "/host/home/runner/target/release/build/proc-macro2-45f04ea9067a46ed/output" FileTime { seconds: 1666559031, nanos: 16426033 } != FileTime { seconds: 1666559080, nanos: 324117075 } ``` However, the `!=` in the log message is misleading, as equality is not the [criterion that's actually used](071eeaf210/src/cargo/core/compiler/fingerprint.rs (L1761)
) to determine when to rebuild. This PR fixes that by changing `!=` to `<`, corresponding to the actual criterion. ### How should we test and review this PR? Look at the [criterion](071eeaf210/src/cargo/core/compiler/fingerprint.rs (L1761)
) I linked and trace `stale_mtime` in the log message back to `path_mtime` in said criterion to see why it has to be `<`.
This commit is contained in:
commit
8adf1df292
@ -1194,7 +1194,7 @@ impl StaleItem {
|
||||
} => {
|
||||
info!("stale: changed {:?}", stale);
|
||||
info!(" (vs) {:?}", reference);
|
||||
info!(" {:?} != {:?}", reference_mtime, stale_mtime);
|
||||
info!(" {:?} < {:?}", reference_mtime, stale_mtime);
|
||||
}
|
||||
StaleItem::ChangedEnv {
|
||||
var,
|
||||
|
Loading…
x
Reference in New Issue
Block a user