mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 04:56:01 +01:00
Fix broken fetchToStore() caching on unlocked inputs
This commit is contained in:
parent
e84daa23f7
commit
cbedb8e19a
2 changed files with 7 additions and 1 deletions
|
|
@ -355,7 +355,7 @@ std::pair<ref<SourceAccessor>, Input> Input::getAccessorUnchecked(ref<Store> sto
|
|||
|
||||
assert(!accessor->getFingerprint(CanonPath::root));
|
||||
|
||||
if (auto fingerprint = getFingerprint(store))
|
||||
if (auto fingerprint = result.getFingerprint(store))
|
||||
accessor->setFingerprint(*fingerprint);
|
||||
|
||||
return {accessor, std::move(result)};
|
||||
|
|
|
|||
|
|
@ -112,6 +112,12 @@ nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir#default"
|
|||
nix build -o "$TEST_ROOT/result" "$flake1Dir?ref=HEAD#default"
|
||||
nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir?ref=HEAD#default"
|
||||
|
||||
# Check that the fetcher cache works.
|
||||
if [[ $(nix config show lazy-trees) = false ]]; then
|
||||
nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir?ref=HEAD#default" -vvvvv 2>&1 | grepQuietInverse "source path.*is uncacheable"
|
||||
nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir?ref=HEAD#default" -vvvvv 2>&1 | grepQuiet "store path cache hit"
|
||||
fi
|
||||
|
||||
# Check that relative paths are allowed for git flakes.
|
||||
# This may change in the future once git submodule support is refined.
|
||||
# See: https://discourse.nixos.org/t/57783 and #9708.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue