* Started removing closure store expressions, i.e., the explicit
representation of closures as ATerms in the Nix store. Instead, the
file system pointer graph is now stored in the Nix database. This
has many advantages:
- It greatly simplifies the implementation (we can drop the notion
of `successors', and so on).
- It makes registering roots for the garbage collector much easier.
Instead of specifying the closure expression as a root, you can
simply specify the store path that must be retained as a root.
This could not be done previously, since there was no way to find
the closure store expression containing a given store path.
- Better traceability: it is now possible to query what paths are
referenced by a path, and what paths refer to a path.
This commit is contained in:
parent
e9762e2d10
commit
863dcff6c5
15 changed files with 407 additions and 890 deletions
|
|
@ -14,11 +14,13 @@ struct ClosureElem
|
|||
|
||||
typedef map<Path, ClosureElem> ClosureElems;
|
||||
|
||||
/*
|
||||
struct Closure
|
||||
{
|
||||
PathSet roots;
|
||||
ClosureElems elems;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
struct DerivationOutput
|
||||
|
|
@ -43,20 +45,14 @@ typedef map<string, string> StringPairs;
|
|||
struct Derivation
|
||||
{
|
||||
DerivationOutputs outputs; /* keyed on symbolic IDs */
|
||||
PathSet inputs; /* store expressions, not actual inputs */
|
||||
PathSet inputDrvs; /* inputs that are sub-derivations */
|
||||
PathSet inputSrcs; /* inputs that are sources */
|
||||
string platform;
|
||||
Path builder;
|
||||
Strings args;
|
||||
StringPairs env;
|
||||
};
|
||||
|
||||
struct StoreExpr
|
||||
{
|
||||
enum { neClosure, neDerivation } type;
|
||||
Closure closure;
|
||||
Derivation derivation;
|
||||
};
|
||||
|
||||
|
||||
/* Hash an aterm. */
|
||||
Hash hashTerm(ATerm t);
|
||||
|
|
@ -65,10 +61,10 @@ Hash hashTerm(ATerm t);
|
|||
Path writeTerm(ATerm t, const string & suffix);
|
||||
|
||||
/* Parse a store expression. */
|
||||
StoreExpr parseStoreExpr(ATerm t);
|
||||
Derivation parseDerivation(ATerm t);
|
||||
|
||||
/* Parse a store expression. */
|
||||
ATerm unparseStoreExpr(const StoreExpr & ne);
|
||||
ATerm unparseDerivation(const Derivation & drv);
|
||||
|
||||
|
||||
#endif /* !__STOREEXPR_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue