From 863dcff6c5ffc163010ec1f9e6819bb9aaaadc29 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Jan 2005 11:16:11 +0000 Subject: * 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. --- src/libstore/storeexpr.hh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/libstore/storeexpr.hh') diff --git a/src/libstore/storeexpr.hh b/src/libstore/storeexpr.hh index d8b8b2a96cbf..8eb80a19a845 100644 --- a/src/libstore/storeexpr.hh +++ b/src/libstore/storeexpr.hh @@ -14,11 +14,13 @@ struct ClosureElem typedef map ClosureElems; +/* struct Closure { PathSet roots; ClosureElems elems; }; +*/ struct DerivationOutput @@ -43,20 +45,14 @@ typedef map 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 */ -- cgit 1.4.1