Fix LocalOverlayStore::queryPathInfoUncached, FIXME in test

This commit is contained in:
John Ericson 2023-05-08 17:37:40 -04:00
parent 5406256d78
commit 59a8099038
2 changed files with 14 additions and 12 deletions

View file

@ -33,21 +33,24 @@ void LocalOverlayStore::queryPathInfoUncached(const StorePath & path,
auto callbackPtr = std::make_shared<decltype(callback)>(std::move(callback));
// If we don't have it, check lower store
LocalStore::queryPathInfoUncached(path,
{[this, path, callbackPtr](std::future<std::shared_ptr<const ValidPathInfo>> fut) {
try {
(*callbackPtr)(fut.get());
auto info = fut.get();
if (info)
return (*callbackPtr)(std::move(info));
} catch (...) {
lowerStore->queryPathInfo(path,
{[path, callbackPtr](std::future<ref<const ValidPathInfo>> fut) {
try {
(*callbackPtr)(fut.get().get_ptr());
} catch (...) {
callbackPtr->rethrow();
}
}});
return callbackPtr->rethrow();
}
// If we don't have it, check lower store
lowerStore->queryPathInfo(path,
{[path, callbackPtr](std::future<ref<const ValidPathInfo>> fut) {
try {
(*callbackPtr)(fut.get().get_ptr());
} catch (...) {
return callbackPtr->rethrow();
}
}});
}});
}

View file

@ -58,8 +58,7 @@ diff $(toRealPath "$storeA/nix/store" "$path") $(toRealPath "$TEST_ROOT/merged-s
nix-store --verify-path --store "$storeA" "$path"
# Verifying path in merged-store
# FIXME should succeed
expect 1 nix-store --verify-path --store "$storeB" "$path"
nix-store --verify-path --store "$storeB" "$path"
### Do a redundant add