From a6c78ba367725a81aa631a7df2d0840ddd25faf5 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Thu, 11 May 2023 13:44:16 +0200 Subject: [PATCH] getDefaultNixPath: ignore EPERM --- src/libexpr/eval.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 585670e69..61012f2ab 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -2620,12 +2620,17 @@ Strings EvalSettings::getDefaultNixPath() { Strings res; auto add = [&](const Path & p, const std::string & s = std::string()) { - if (pathExists(p)) { - if (s.empty()) { - res.push_back(p); - } else { - res.push_back(s + "=" + p); + try { + if (pathExists(p)) { + if (s.empty()) { + res.push_back(p); + } else { + res.push_back(s + "=" + p); + } } + } catch (SysError & e) { + // swallow EPERM + if (e.errNo != EPERM) throw; } };