From a5daf56af7acd0b94402e90729c6a1f30b6ef7a6 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Sun, 26 May 2024 15:54:01 +0100 Subject: [PATCH] detect 1 in a million changes --- src/cargo/core/compiler/fingerprint/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cargo/core/compiler/fingerprint/mod.rs b/src/cargo/core/compiler/fingerprint/mod.rs index ebb688e58ea..fa282286dd6 100644 --- a/src/cargo/core/compiler/fingerprint/mod.rs +++ b/src/cargo/core/compiler/fingerprint/mod.rs @@ -1952,6 +1952,13 @@ where }); } + // If a few files in many have a .0ns mtime then still regard them as changed files. + if total_checked > 1 && truncated_precision_count == 1 { + return first; + } else if truncated_precision_count > 0 { + debug!("ignoring files that look changed due to mtime precision differences"); + } + debug!( "all paths up-to-date relative to {:?} mtime={}", reference, reference_mtime