diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-11-06 12:01:37 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-11-06 12:01:37 +0100 |
commit | d5f1cc3e949ebb8c69b6c0d202302b12839b9bd5 (patch) | |
tree | 2c260ef27d90b65d245b83e2d4e4a78d5fed5125 | |
parent | 88c452d1603eb809358e509d5dca9c40c512cd20 (diff) |
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.
-rw-r--r-- | src/libexpr/flake/flake.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index d96c3c413..80726a257 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -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)); } } |