aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/src/command-ref
diff options
context:
space:
mode:
authorValentin Gagarin <valentin.gagarin@tweag.io>2023-05-03 15:36:13 +0200
committerValentin Gagarin <valentin.gagarin@tweag.io>2023-08-31 21:25:39 +0200
commit1bc9257d7c5980fb048b519eeaa2a2b2e8925099 (patch)
treef8e1588ac343e3e1b6e69d75d3a66b7e28d0fe78 /doc/manual/src/command-ref
parent151120a1ae082c6460f9a54cf795c57d154f6c27 (diff)
reword description of how realisation works
Diffstat (limited to 'doc/manual/src/command-ref')
-rw-r--r--doc/manual/src/command-ref/nix-store/opt-common.md4
-rw-r--r--doc/manual/src/command-ref/nix-store/realise.md54
2 files changed, 29 insertions, 29 deletions
diff --git a/doc/manual/src/command-ref/nix-store/opt-common.md b/doc/manual/src/command-ref/nix-store/opt-common.md
index dd9a6bf21..104b20076 100644
--- a/doc/manual/src/command-ref/nix-store/opt-common.md
+++ b/doc/manual/src/command-ref/nix-store/opt-common.md
@@ -1,6 +1,6 @@
-# Options
+# Command options
-The following options are allowed for all `nix-store` operations, but may not always have an effect.
+The following options are allowed for all operations in the `nix-store` command, but may not always have an effect.
- <span id="opt-add-root">[`--add-root`](#opt-add-root)</span> *path*
diff --git a/doc/manual/src/command-ref/nix-store/realise.md b/doc/manual/src/command-ref/nix-store/realise.md
index c19aea75e..2881a69b3 100644
--- a/doc/manual/src/command-ref/nix-store/realise.md
+++ b/doc/manual/src/command-ref/nix-store/realise.md
@@ -8,33 +8,37 @@
# Description
-The operation `--realise` essentially “builds” the specified store
-paths. Realisation is a somewhat overloaded term:
-
- - If the store path is a *derivation*, realisation ensures that the
- output paths of the derivation are [valid] (i.e.,
- the output path and its closure exist in the file system). This
- can be done in several ways. First, it is possible that the
- outputs are already valid, in which case we are done
- immediately. Otherwise, there may be [substitutes]
- that produce the outputs (e.g., by downloading them). Finally, the
- outputs can be produced by running the build task described
- by the derivation.
-
- - If the store path is not a derivation, realisation ensures that the
- specified path is valid (i.e., it and its closure exist in the file
- system). If the path is already valid, we are done immediately.
- Otherwise, the path and any missing paths in its closure may be
- produced through substitutes. If there are no (successful)
- substitutes, realisation fails.
+Ensure that the given [store paths] are [valid].
+Realisation of a store path works as follows:
+
+- If the path is already valid, do nothing.
+- If the path leads to a [store derivation]:
+ 1. Realise the store derivation file itself, as a regular store path.
+ 2. Realise its [output paths]:
+ - Try to fetch from [substituters] the [store objects] associated with the output paths in the store derivation's [closure].
+ - With [content-addressed derivations] (experimental): Determine the output paths to realise by querying build certificates in the [Nix database].
+ - For any store paths that cannot be substituted, produce the required store objects by first realising all outputs of the derivation's dependencies and then running the derivation's build instructions.
+- Otherwise: Try to fetch the associated [store objects] in the paths' [closure] from the [substituters].
+
+If no substitutes are available and no store derivation is given, realisation fails.
+
+[store paths]: @docroot@/glossary.md#gloss-store-path
[valid]: @docroot@/glossary.md#gloss-validity
-[substitutes]: @docroot@/glossary.md#gloss-substitute
+[store derivation]: @docroot@/glossary.md#gloss-store-derivation
+[output paths]: @docroot@/glossary.md#gloss-output-path
+[store objects]: @docroot@/glossary.md#gloss-store-object
+[closure]: @docroot@/glossary.md#gloss-closure
+[substituters]: @docroot@/command-ref/conf-file.md#conf-substituters
+[content-addressed derivations]: @docroot@/contributing/experimental-features.md#xp-feature-ca-derivations
+[Nix database]: @docroot@/glossary.md#gloss-nix-database
+
+The resulting paths are printed on standard output.
+For non-derivation arguments, the argument itself is printed.
-The output path of each derivation is printed on standard output. (For
-non-derivations argument, the argument itself is printed.)
+{{#include ../status-build-failure.md}}
-The following flags are available:
+# Options
- `--dry-run`\
Print on standard error a description of what packages would be
@@ -54,8 +58,6 @@ The following flags are available:
previous build, the new output path is left in
`/nix/store/name.check.`
-{{#include ../status-build-failure.md}}
-
{{#include ./opt-common.md}}
{{#include ../opt-common.md}}
@@ -67,8 +69,6 @@ The following flags are available:
This operation is typically used to build [store derivation]s produced by
[`nix-instantiate`](@docroot@/command-ref/nix-instantiate.md):
-[store derivation]: @docroot@/glossary.md#gloss-store-derivation
-
```console
$ nix-store --realise $(nix-instantiate ./test.nix)
/nix/store/31axcgrlbfsxzmfff1gyj1bf62hvkby2-aterm-2.3.1