From 188f69312c7f96a6e9c5fcb4a97ab4d52587d156 Mon Sep 17 00:00:00 2001 From: Nikita Krasnov Date: Wed, 18 Jun 2025 12:46:53 +0300 Subject: [PATCH] Fix typo (cherry picked from commit 86dda9884ae5aa8674470df051c3954d4e6665c4) # Conflicts: # doc/manual/source/store/store-object.md --- doc/manual/source/store/store-object.md | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/doc/manual/source/store/store-object.md b/doc/manual/source/store/store-object.md index caf5657d1f0..c67a8db4095 100644 --- a/doc/manual/source/store/store-object.md +++ b/doc/manual/source/store/store-object.md @@ -4,7 +4,55 @@ A Nix store is a collection of *store objects* with *references* between them. A store object consists of - A [file system object](./file-system-object.md) as data +<<<<<<< HEAD - A set of [store paths](./store-path.md) as references to other store objects +======= + + - A set of [store paths](./store-path.md) as references to store objects + +### References + +Store objects can refer to both other store objects and themselves. +References from a store object to itself are called *self-references*. + +Store objects and their references form a directed graph, where the store objects are the vertices, and the references are the edges. +In particular, the edge corresponding to a reference is from the store object that contains the reference, and to the store object that the store path (which is the reference) refers to. + +References other than a self-reference must not form a cycle. +The graph of references excluding self-references thus forms a [directed acyclic graph]. + +[directed acyclic graph]: @docroot@/glossary.md#gloss-directed acyclic graph + +We can take the [transitive closure] of the references graph, which any pair of store objects have an edge not if there is a single reference from the first to the second, but a path of one or more references from the first to the second. +The *requisites* of a store object are all store objects reachable by paths of references which start with given store object's references. + +[transitive closure]: https://en.wikipedia.org/wiki/Transitive_closure + +We can also take the [transpose graph] of the references graph, where we reverse the orientation of all edges. +The *referrers* of a store object are the store objects that reference it. + +[transpose graph]: https://en.wikipedia.org/wiki/Transpose_graph + +One can also combine both concepts: taking the transitive closure of the transposed references graph. +The *referrers closure* of a store object are the store objects that can reach the given store object via paths of references. + +> **Note** +> +> Care must be taken to distinguish between the intrinsic and extrinsic properties of store objects. +> We can create graphs from the store objects in a store, but the contents of the store is not, in general fixed, and may instead change over time. +> +> - The references of a store object --- the set of store paths called the references --- is a field of a store object, and thus intrinsic by definition. + Regardless of what store contains the store object in question, and what else that store may or may not contain, the references are the same. +> +> - The requisites of a store object are almost intrinsic --- some store paths due not precisely refer to a unique single store object. +> Exactly what store object is being referenced, and what in turn *its* references are, depends on the store in question. +> Different stores that disagree. +> +> - The referrers of a store object are completely extrinsic, and depends solely on the store which contains that store object, not the store object itself. +> Other store objects which refer to the store object in question may be added or removed from the store. + +### Immutability +>>>>>>> 86dda9884 (Fix typo) Store objects are [immutable](https://en.wikipedia.org/wiki/Immutable_object): Once created, they do not change until they are deleted.