From 93f863be9626e5455458abf9e449586270e98163 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 8 Mar 2017 08:46:12 -0500 Subject: Add option to disable import-from-derivation completely, even if the drv is already realized --- src/libexpr/primops.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 5a570cefb2fa..93097f3d1bf3 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -59,6 +59,8 @@ void EvalState::realiseContext(const PathSet & context) drvs.insert(decoded.first + "!" + decoded.second); } if (!drvs.empty()) { + if (!settings.enableImportFromDerivation) + throw EvalError(format("attempted to realize ‘%1%’ during evaluation but 'allow-import-from-derivation' is false") % *(drvs.begin())); /* For performance, prefetch all substitute info. */ PathSet willBuild, willSubstitute, unknown; unsigned long long downloadSize, narSize; -- cgit 1.4.1