reword description of how realisation works
This commit is contained in:
parent
151120a1ae
commit
1bc9257d7c
|
@ -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*
|
- <span id="opt-add-root">[`--add-root`](#opt-add-root)</span> *path*
|
||||||
|
|
||||||
|
|
|
@ -8,33 +8,37 @@
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
|
||||||
The operation `--realise` essentially “builds” the specified store
|
Ensure that the given [store paths] are [valid].
|
||||||
paths. Realisation is a somewhat overloaded term:
|
|
||||||
|
|
||||||
- If the store path is a *derivation*, realisation ensures that the
|
Realisation of a store path works as follows:
|
||||||
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
|
- If the path is already valid, do nothing.
|
||||||
specified path is valid (i.e., it and its closure exist in the file
|
- If the path leads to a [store derivation]:
|
||||||
system). If the path is already valid, we are done immediately.
|
1. Realise the store derivation file itself, as a regular store path.
|
||||||
Otherwise, the path and any missing paths in its closure may be
|
2. Realise its [output paths]:
|
||||||
produced through substitutes. If there are no (successful)
|
- Try to fetch from [substituters] the [store objects] associated with the output paths in the store derivation's [closure].
|
||||||
substitutes, realisation fails.
|
- 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
|
[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 output path of each derivation is printed on standard output. (For
|
The resulting paths are printed on standard output.
|
||||||
non-derivations argument, the argument itself is printed.)
|
For non-derivation arguments, the argument itself is printed.
|
||||||
|
|
||||||
The following flags are available:
|
{{#include ../status-build-failure.md}}
|
||||||
|
|
||||||
|
# Options
|
||||||
|
|
||||||
- `--dry-run`\
|
- `--dry-run`\
|
||||||
Print on standard error a description of what packages would be
|
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
|
previous build, the new output path is left in
|
||||||
`/nix/store/name.check.`
|
`/nix/store/name.check.`
|
||||||
|
|
||||||
{{#include ../status-build-failure.md}}
|
|
||||||
|
|
||||||
{{#include ./opt-common.md}}
|
{{#include ./opt-common.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
|
This operation is typically used to build [store derivation]s produced by
|
||||||
[`nix-instantiate`](@docroot@/command-ref/nix-instantiate.md):
|
[`nix-instantiate`](@docroot@/command-ref/nix-instantiate.md):
|
||||||
|
|
||||||
[store derivation]: @docroot@/glossary.md#gloss-store-derivation
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ nix-store --realise $(nix-instantiate ./test.nix)
|
$ nix-store --realise $(nix-instantiate ./test.nix)
|
||||||
/nix/store/31axcgrlbfsxzmfff1gyj1bf62hvkby2-aterm-2.3.1
|
/nix/store/31axcgrlbfsxzmfff1gyj1bf62hvkby2-aterm-2.3.1
|
||||||
|
|
Loading…
Reference in a new issue