-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Don't hash FileTime value in PathSource::fingerprint #6835
Copy link
Copy link
Open
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-rebuild-detectionArea: rebuild detection and fingerprintingArea: rebuild detection and fingerprintingC-cleanupCategory: cleanup within the codebaseCategory: cleanup within the codebaseS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-rebuild-detectionArea: rebuild detection and fingerprintingArea: rebuild detection and fingerprintingC-cleanupCategory: cleanup within the codebaseCategory: cleanup within the codebaseS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently here in Cargo we will insert the
FileTimevalue, stringified, into aFingerprintfor a package. This is only ever used for build scripts which do not mentionrerun-if-*directives.Hashing
FileTimeis particularly brittle because filesystems are weird. The primary use case today is that Docker will rewrite file times to zero out the nanosecond field. This means that the hash for a build script changes between docker, even though nothing actually changed.We should instead thread through the set of files considered input to a build script to the
Fingerprint. These files would then be stored in theFingerprint(and deterministically hashed) where we would later determine at runtime what theFileTimemodification time is for each file for recompilation purposes.I'm spawning this off of #6832 for a separable unit of work. We'll know this is fixed when this test has its branch on
already_zeroremoved, because we should always consider everything fresh.