Skip to content

Commit

Permalink
Don't cache realiseContext() errors
Browse files Browse the repository at this point in the history
Errors that depend on the configuration (such as whether
allow-import-from-derivation is set) should not be cached.
  • Loading branch information
edolstra committed Sep 22, 2021
1 parent bcd73eb commit ff28fff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit ff28fff

Please sign in to comment.