about summary refs log tree commit diff
path: root/src/libstore/storeexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-01-19T11·16+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-01-19T11·16+0000
commit863dcff6c5ffc163010ec1f9e6819bb9aaaadc29 (patch)
tree4747222c7f8c471e6cbfa07c49023853d2f6b957 /src/libstore/storeexpr.hh
parente9762e2d10c4a837e3d75d53e3a24452f07f47ec (diff)
* 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.

Diffstat (limited to 'src/libstore/storeexpr.hh')
-rw-r--r--src/libstore/storeexpr.hh16
1 files changed, 6 insertions, 10 deletions
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<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 */