From 38a73203a4b304cb0987d4b32a17f7d2137575a4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jun 2025 20:02:18 +0200 Subject: [PATCH] Fix eval caching for path flakes This fix is somewhat hacky since the accessor/input fingerprint situation is a bit of a mess. --- src/libfetchers/fetchers.cc | 2 ++ tests/functional/flakes/flakes.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index d91f24b6a..4d2d66a72 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -354,6 +354,8 @@ std::pair, Input> Input::getAccessorUnchecked(ref sto if (!accessor->fingerprint) accessor->fingerprint = result.getFingerprint(store); + else + result.cachedFingerprint = accessor->fingerprint; return {accessor, std::move(result)}; } diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index ec5cc9c53..cfd204569 100755 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -374,6 +374,7 @@ nix build -o $TEST_ROOT/result git+file://$flakeGitBare mkdir -p $flake5Dir writeDependentFlake $flake5Dir nix flake lock path://$flake5Dir +[[ "$(nix flake metadata path://$flake5Dir --json | jq -r .fingerprint)" != null ]] # Test tarball flakes. tar cfz $TEST_ROOT/flake.tar.gz -C $TEST_ROOT flake5