Don't cache realiseContext() errors

Errors that depend on the configuration (such as whether
allow-import-from-derivation is set) should not be cached.
This commit is contained in:
Eelco Dolstra 2021-09-22 14:00:56 +02:00
parent bcd73ebf60
commit ff28fffce2

View file

@ -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. */