Use revcount/last-modified for computing the flake fingerprint

The store path is not enough. For example, when we build a dirty tree,
commit, and build the clean tree, a re-evaluation is necessary because
the flake may depend on the lastModified or revCount attributes.
This commit is contained in:
Eelco Dolstra 2019-11-06 12:01:37 +01:00
parent 88c452d160
commit d5f1cc3e94
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -686,7 +686,11 @@ Fingerprint ResolvedFlake::getFingerprint() const
// and we haven't changed it, then it's sufficient to use
// flake.sourceInfo.storePath for the fingerprint.
return hashString(htSHA256,
fmt("%s;%s", flake.sourceInfo.storePath, lockFile));
fmt("%s;%d;%d;%s",
flake.sourceInfo.storePath,
flake.sourceInfo.revCount.value_or(0),
flake.sourceInfo.lastModified.value_or(0),
lockFile));
}
}