aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorGeoff Reedy <geoff@programmer-monk.net>2021-09-16 15:58:21 -0600
committerGeoff Reedy <geoff@programmer-monk.net>2021-09-16 15:58:21 -0600
commitcbe9ddfd1ad189f3b4c0b43fabe0444437b1fdd7 (patch)
treed3f0e5184a981eccf4ca9b4cfab291cc26d7d39a /src/libexpr
parent1ec4efa6c82fb6d90887c21aa7c7c6f3c644dd65 (diff)
Include subpath in flake fingerprint
Without this, flakes within the same tree and same lock data will have the same fingerprint and the eval cache for one flake will be incorrectly used for another.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/flake/flake.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index c1a099613..6893f157e 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -710,8 +710,9 @@ Fingerprint LockedFlake::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;%d;%d;%s",
+ fmt("%s;%s;%d;%d;%s",
flake.sourceInfo->storePath.to_string(),
+ flake.lockedRef.subdir,
flake.lockedRef.input.getRevCount().value_or(0),
flake.lockedRef.input.getLastModified().value_or(0),
lockFile));