1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 20:51:00 +01:00

Move the InputCache to EvalState

This commit is contained in:
Eelco Dolstra 2025-04-14 14:29:14 +02:00
parent 62565ce7ce
commit e099a5bc67
7 changed files with 16 additions and 12 deletions

View file

@ -20,6 +20,7 @@
#include "nix/util/url.hh"
#include "nix/fetchers/fetch-to-store.hh"
#include "nix/fetchers/tarball.hh"
#include "nix/fetchers/input-cache.hh"
#include "parser-tab.hh"
@ -290,6 +291,7 @@ EvalState::EvalState(
)}
, store(store)
, buildStore(buildStore ? buildStore : store)
, inputCache(fetchers::InputCache::create())
, debugRepl(nullptr)
, debugStop(false)
, trylevel(0)
@ -1132,6 +1134,7 @@ void EvalState::resetFileCache()
{
fileEvalCache.clear();
fileParseCache.clear();
inputCache->clear();
}

View file

@ -33,7 +33,10 @@ namespace nix {
constexpr size_t maxPrimOpArity = 8;
class Store;
namespace fetchers { struct Settings; }
namespace fetchers {
struct Settings;
struct InputCache;
}
struct EvalSettings;
class EvalState;
class StorePath;
@ -301,6 +304,8 @@ public:
RootValue vImportedDrvToDerivation = nullptr;
ref<fetchers::InputCache> inputCache;
/**
* Debugger
*/

View file

@ -202,7 +202,7 @@ static void fetchTree(
throw Error("input '%s' is not allowed to use the '__final' attribute", input.to_string());
}
auto cachedInput = fetchers::InputCache::getCache()->getAccessor(state.store, input, false);
auto cachedInput = state.inputCache->getAccessor(state.store, input, false);
auto storePath = StorePath::random(input.getName());