From bef40c29491ba9b31c85b9b89a5342979344f583 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Jun 2021 21:09:48 +0200 Subject: Add --eval-store option --- src/libexpr/eval.cc | 6 +++++- src/libexpr/eval.hh | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/libexpr') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index c3206a577..b3e952aaa 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -378,7 +378,10 @@ static Strings parseNixPath(const string & s) } -EvalState::EvalState(const Strings & _searchPath, ref store) +EvalState::EvalState( + const Strings & _searchPath, + ref store, + std::shared_ptr buildStore) : sWith(symbols.create("")) , sOutPath(symbols.create("outPath")) , sDrvPath(symbols.create("drvPath")) @@ -411,6 +414,7 @@ EvalState::EvalState(const Strings & _searchPath, ref store) , sEpsilon(symbols.create("")) , repair(NoRepair) , store(store) + , buildStore(buildStore ? buildStore : store) , regexCache(makeRegexCache()) , baseEnv(allocEnv(128)) , staticBaseEnv(false, 0) diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index e3eaed6d3..a7aebb8ef 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -94,8 +94,12 @@ public: Value vEmptySet; + /* Store used to materialise .drv files. */ const ref store; + /* Store used to build stuff. */ + const ref buildStore; + private: SrcToStore srcToStore; @@ -128,7 +132,10 @@ private: public: - EvalState(const Strings & _searchPath, ref store); + EvalState( + const Strings & _searchPath, + ref store, + std::shared_ptr buildStore = nullptr); ~EvalState(); void addToSearchPath(const string & s); -- cgit v1.2.3