From d9a8619762fa56bca8ddec5d9bcd5c411adb5b95 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Aug 2020 19:15:17 +0200 Subject: [PATCH] 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). --- src/libexpr/eval.cc | 12 ++++++++---- 1 file 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) 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); }