From 9053ac06930d8078eca04370898346a9417f95cf Mon Sep 17 00:00:00 2001 From: regnat Date: Thu, 3 Jun 2021 15:27:33 +0200 Subject: [PATCH] use the setEvalCache function at the flake root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Probably doesn’t change much, but much cleaner (and robust) --- src/libexpr/flake/flake.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc index 217bb1e8e..11112b07c 100644 --- a/src/libexpr/flake/flake.cc +++ b/src/libexpr/flake/flake.cc @@ -620,11 +620,12 @@ void callFlake(EvalState & state, state.callFunction(**vCallFlake, *vLocks, *vTmp1, noPos); state.callFunction(*vTmp1, *vRootSrc, *vTmp2, noPos); state.callFunction(*vTmp2, *vRootSubdir, vRes, noPos); - state.forceAttrs(vRes); // FIXME: Make more robust and lazy + state.forceValue(vRes); auto fingerprint = lockedFlake.getFingerprint(); - auto evalCache = state.openTreeCache(fingerprint); - auto cacheRoot = evalCache ? evalCache->getRoot() : nullptr; - vRes.attrs->eval_cache = ValueCache(cacheRoot); + auto treeCache = state.openTreeCache(fingerprint); + auto cacheRoot = treeCache ? treeCache->getRoot() : nullptr; + auto evalCache = ValueCache(cacheRoot); + vRes.setEvalCache(evalCache); } static void prim_getFlake(EvalState & state, const Pos & pos, Value * * args, Value & v)