Skip to main content

source_stamp

Function source_stamp 

Source
pub fn source_stamp(source_dir: &Path) -> String
Expand description

A fingerprint of source_dir’s contents, for staleness comparison.

Max mtime plus file count, walking the source tree and skipping target/, .git/ and hidden entries. The file count is what makes a deletion register: mtimes only ever move forward, so a removed file would otherwise leave the stamp unchanged and the artifact wrongly considered current.

Not a content hash. Hashing every byte of a cargo project on every boot is real I/O for a check that runs before we know whether we even need to build, and mtime+count is what cargo itself trusts for the same job.