From cbe9ddfd1ad189f3b4c0b43fabe0444437b1fdd7 Mon Sep 17 00:00:00 2001 From: Geoff Reedy Date: Thu, 16 Sep 2021 15:58:21 -0600 Subject: [PATCH] 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. --- src/libexpr/flake/flake.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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));