diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-19T11·16+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-19T11·16+0000 |
commit | 863dcff6c5ffc163010ec1f9e6819bb9aaaadc29 (patch) | |
tree | 4747222c7f8c471e6cbfa07c49023853d2f6b957 /src/libstore/normalise.hh | |
parent | e9762e2d10c4a837e3d75d53e3a24452f07f47ec (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/normalise.hh')
-rw-r--r-- | src/libstore/normalise.hh | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/libstore/normalise.hh b/src/libstore/normalise.hh index 7b0835b45ef4..2a084b7ed467 100644 --- a/src/libstore/normalise.hh +++ b/src/libstore/normalise.hh @@ -4,28 +4,31 @@ #include "storeexpr.hh" -/* Normalise a store expression. That is, if the expression is a - derivation, a path containing an equivalent closure expression is - returned. This requires that the derivation is performed, unless a - successor is known. */ -Path normaliseStoreExpr(const Path & nePath); - -/* Realise a store expression. If the expression is a derivation, it - is first normalised into a closure. The closure is then realised - in the file system (i.e., it is ensured that each path in the - closure exists in the file system, if necessary by using the - substitute mechanism). Returns the normal form of the expression - (i.e., its closure expression). */ -Path realiseStoreExpr(const Path & nePath); +/* Perform the specified derivation, if necessary. That is, do + whatever is necessary to create the output paths of the + derivation. If the output paths already exists, we're done. If + they have substitutes, we can use those instead. Otherwise, the + build action described by the derivation is performed, after + recursively building any sub-derivations. */ +void buildDerivation(const Path & drvPath); /* Ensure that a path exists, possibly by instantiating it by realising a substitute. */ -void ensurePath(const Path & path); +void ensurePath(const Path & storePath); -/* Read a store expression, after ensuring its existence through - ensurePath(). */ -StoreExpr storeExprFromPath(const Path & path); +/* Read a derivation store expression, after ensuring its existence + through ensurePath(). */ +Derivation derivationFromPath(const Path & drvPath); + +/* Places in `paths' the set of all store paths in the file system + closure of `storePath'; that is, all paths than can be directly or + indirectly reached from it. `paths' is not cleared. */ +void computeFSClosure(const Path & storePath, + PathSet & paths); + + +#if 0 /* Get the list of root (output) paths of the given store expression. */ PathSet storeExprRoots(const Path & nePath); @@ -39,6 +42,7 @@ PathSet storeExprRoots(const Path & nePath); successors. */ PathSet storeExprRequisites(const Path & nePath, bool includeExprs, bool includeSuccessors); +#endif #endif /* !__NORMALISE_H */ |