about summary refs log tree commit diff
path: root/src/globals.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-15T16·28+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-15T16·28+0000
commitf5b6fa5256efce5f7a963386cd16e441446f5746 (patch)
treedd4ada2e432ea1e7bcdeada23583539575b1a342 /src/globals.hh
parent8898e86b4fe1ecf8b34a5cca2a7b9b38d395678c (diff)
* Basic work on allowing derive expressions to build multiple paths.
  This is not entirely trivial since this introduces the possibility
  of mutual recursion.
* Made normal forms self-contained.
* Use unique ids, not content hashes, for content referencing.

Diffstat (limited to 'src/globals.hh')
-rw-r--r--src/globals.hh37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/globals.hh b/src/globals.hh
index 0668ac40e57e..fbb020df7c91 100644
--- a/src/globals.hh
+++ b/src/globals.hh
@@ -8,33 +8,36 @@ using namespace std;
 
 /* Database names. */
 
-/* dbHash2Paths :: Hash -> [Path]
+/* dbPath2Id :: Path -> FSId
 
-   Maintains a mapping from hashes to lists of paths.  This is what we
-   use to resolve Hash(hash) content descriptors. */
-extern string dbHash2Paths;
+   Each pair (p, id) records that path $p$ contains an expansion of
+   $id$. */
+extern string dbPath2Id;
 
-/* dbSuccessors :: Hash -> Hash
 
-   Each pair (h1, h2) in this mapping records the fact that a
-   successor of an fstate expression with hash h1 is stored in a file
-   with hash h2.
+/* dbId2Paths :: FSId -> [Path]
+
+   A mapping from ids to lists of paths. */
+extern string dbId2Paths;
+
+
+/* dbSuccessors :: FSId -> FSId
+
+   Each pair $(id_1, id_2)$ in this mapping records the fact that a
+   successor of an fstate expression stored in a file with identifier
+   $id_1$ is stored in a file with identifier $id_2$.
 
    Note that a term $y$ is successor of $x$ iff there exists a
    sequence of rewrite steps that rewrites $x$ into $y$.
-
-   Also note that instead of a successor, $y$ can be any term
-   equivalent to $x$, that is, reducing to the same result, as long as
-   $x$ is equal to or a successor of $y$.  (This is useful, e.g., for
-   shared derivate caching over the network).
 */
 extern string dbSuccessors;
 
-/* dbSubstitutes :: Hash -> [Hash]
 
-   Each pair $(h, [hs])$ tells Nix that it can realise any of the
-   fstate expressions referenced by the hashes in $hs$ to obtain a Nix
-   archive that, when unpacked, will produce a path with hash $h$.
+/* dbSubstitutes :: FSId -> [FSId]
+
+   Each pair $(id, [ids])$ tells Nix that it can realise any of the
+   fstate expressions referenced by the identifiers in $ids$ to
+   generate a path with identifier $id$.
 
    The main purpose of this is for distributed caching of derivates.
    One system can compute a derivate with hash $h$ and put it on a