From ff28fffce26bba37685f7e230d1285e7d034f748 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 22 Sep 2021 14:00:56 +0200 Subject: Don't cache realiseContext() errors Errors that depend on the configuration (such as whether allow-import-from-derivation is set) should not be cached. --- src/libexpr/primops.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libexpr') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 8a087a781..c98a30177 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -52,7 +52,8 @@ void EvalState::realiseContext(const PathSet & context) if (drvs.empty()) return; if (!evalSettings.enableImportFromDerivation) - throw EvalError("attempted to realize '%1%' during evaluation but 'allow-import-from-derivation' is false", + throw Error( + "cannot build '%1%' during evaluation because the option 'allow-import-from-derivation' is disabled", store->printStorePath(drvs.begin()->drvPath)); /* For performance, prefetch all substitute info. */ -- cgit v1.2.3