Skip to content

Don't hash FileTime value in PathSource::fingerprint #6835

Open
@alexcrichton

Description

@alexcrichton

Currently here in Cargo we will insert the FileTime value, stringified, into a Fingerprint for a package. This is only ever used for build scripts which do not mention rerun-if-* directives.

Hashing FileTime is 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 the Fingerprint (and deterministically hashed) where we would later determine at runtime what the FileTime modification 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_zero removed, because we should always consider everything fresh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rebuild-detectionArea: rebuild detection and fingerprintingC-cleanupCategory: cleanup within the codebaseS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions