libexpr/builtins: Document derivationStrict

Co-authored-by: eldritch horrors <pennae@lix.systems>
Co-authored-by: Qyriad <qyriad@qyriad.me>

Change-Id: I4cf95683da54efe830514f3a6795057cadd223c6
This commit is contained in:
Tom Hubrecht
2025-11-21 14:59:03 +01:00
parent 428a0bcb5e
commit 8558cf781a
3 changed files with 23 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
---
name: derivationStrict
args: [args]
renameInGlobalScope: false
---
Constructs a [store derivation](../glossary.md#gloss-store-derivation) from the attribute set `args`
(c.f. [derivation](#builtins-derivation). Unlike `derivation` the produced store derivation is placed
in the store *immediately* when this builtin is called, while `derivation` may defer placing store
derivations in the store until it is proven that they are used.
It then returns a new attrset with *only* the following attributes:
- `drvPath` containing the path of the store derivation;
- For each output of the derivation (`out`, `dev`, etc): an attribute named after that output containing the output path
> **Note**
>
> In contrast to [`builtins.derivation`](#builtins-derivation), this computes
> the derivation set in a fully *strict* manner, i.e. the values of the attributes
> directly computed, whereas using `builtins.derivation` will produce an attrset
> whose values will be evaluated when they are used at a later point.
+1
View File
@@ -68,6 +68,7 @@ builtin_definitions = files(
'builtins/concatMap.md',
'builtins/concatStringsSep.md',
'builtins/deepSeq.md',
'builtins/derivationStrict.md',
'builtins/dirOf.md',
'builtins/div.md',
'builtins/elem.md',
-6
View File
@@ -1227,12 +1227,6 @@ drvName, Bindings * attrs, Value & v)
v.mkAttrs(result);
}
static RegisterPrimOp primop_derivationStrict(PrimOp{{
.name = "derivationStrict",
.arity = 1,
.fun = prim_derivationStrict,
}});
/* Return a placeholder string for the specified output that will be
substituted by the corresponding output path at build time. For
example, 'placeholder "out"' returns the string