Don't barf if corepkgs is in the store but not a valid path

This can happen when using a dummy store (or indeed any non-local store).
This commit is contained in:
Eelco Dolstra 2020-08-24 19:15:17 +02:00
parent 6a67e57019
commit d9a8619762
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -381,10 +381,14 @@ EvalState::EvalState(const Strings & _searchPath, ref<Store> store)
auto path = r.second;
if (store->isInStore(r.second)) {
StorePathSet closure;
store->computeFSClosure(store->toStorePath(r.second).first, closure);
for (auto & path : closure)
allowedPaths->insert(store->printStorePath(path));
try {
StorePathSet closure;
store->computeFSClosure(store->toStorePath(r.second).first, closure);
for (auto & path : closure)
allowedPaths->insert(store->printStorePath(path));
} catch (InvalidPath &) {
allowedPaths->insert(r.second);
}
} else
allowedPaths->insert(r.second);
}