2019-06-07 20:25:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sync.hh"
|
|
|
|
#include "flake.hh"
|
2019-12-11 13:53:30 +00:00
|
|
|
#include "path.hh"
|
2019-06-07 20:25:48 +00:00
|
|
|
|
|
|
|
namespace nix { struct SQLite; struct SQLiteStmt; }
|
|
|
|
|
|
|
|
namespace nix::flake {
|
|
|
|
|
|
|
|
class EvalCache
|
|
|
|
{
|
|
|
|
struct State;
|
|
|
|
|
|
|
|
std::unique_ptr<Sync<State>> _state;
|
|
|
|
|
|
|
|
EvalCache();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct Derivation
|
|
|
|
{
|
2019-12-11 13:53:30 +00:00
|
|
|
StorePath drvPath;
|
|
|
|
StorePath outPath;
|
2019-06-07 20:25:48 +00:00
|
|
|
std::string outputName;
|
|
|
|
};
|
|
|
|
|
|
|
|
void addDerivation(
|
|
|
|
const Fingerprint & fingerprint,
|
|
|
|
const std::string & attrPath,
|
|
|
|
const Derivation & drv);
|
|
|
|
|
|
|
|
std::optional<Derivation> getDerivation(
|
|
|
|
const Fingerprint & fingerprint,
|
|
|
|
const std::string & attrPath);
|
|
|
|
|
|
|
|
static EvalCache & singleton();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|