aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-08-24 19:15:17 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-08-24 19:15:17 +0200
commitd9a8619762fa56bca8ddec5d9bcd5c411adb5b95 (patch)
tree05818d5a9decf57869eedc6b6d5be651c04ec325
parent6a67e57019f39e43866866661df17394c168d29b (diff)
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).
-rw-r--r--src/libexpr/eval.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 6ac8bbc9f..a5ebd1bf0 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -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);
}