aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-07 22:38:39 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-07 22:38:39 +0200
commitc47d2dac6c7b404714e4c3429f26791790a483f5 (patch)
tree4d48be5b00e80d65fb80c32394526b7cc3137bcd /src/libexpr/flake
parent6644b6099be2d3393206bf1c9c091c888c0a0f57 (diff)
Disable EvalCache in impure mode
Diffstat (limited to 'src/libexpr/flake')
-rw-r--r--src/libexpr/flake/eval-cache.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libexpr/flake/eval-cache.cc b/src/libexpr/flake/eval-cache.cc
index fece1a2b5..b32d502f7 100644
--- a/src/libexpr/flake/eval-cache.cc
+++ b/src/libexpr/flake/eval-cache.cc
@@ -1,5 +1,6 @@
#include "eval-cache.hh"
#include "sqlite.hh"
+#include "eval.hh"
#include <set>
@@ -62,6 +63,8 @@ void EvalCache::addDerivation(
const std::string & attrPath,
const Derivation & drv)
{
+ if (!evalSettings.pureEval) return;
+
auto state(_state->lock());
if (state->fingerprints.insert(fingerprint).second)
@@ -81,6 +84,8 @@ std::optional<EvalCache::Derivation> EvalCache::getDerivation(
const Fingerprint & fingerprint,
const std::string & attrPath)
{
+ if (!evalSettings.pureEval) return {};
+
auto state(_state->lock());
auto queryAttribute(state->queryAttribute.use()