1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

Forbid drvPath in strictDerivation outputs attribute

builtins.strictDerivation returns an attribute set with drvPath and
output paths. For some reason, current implementation forbids drv
instead of drvPath.
This commit is contained in:
Ivan Trubach 2024-05-08 18:09:51 +03:00
parent fcbc36cf78
commit 081faeda8c
2 changed files with 145 additions and 65 deletions

View file

@ -1184,11 +1184,11 @@ static void derivationStrictInternal(
.debugThrow();
/* !!! Check whether j is a valid attribute
name. */
/* Derivations cannot be named drv, because
then we'd have an attribute drvPath in
the resulting set. */
if (j == "drv")
state.error<EvalError>("invalid derivation output name 'drv'")
/* Derivations cannot be named drvPath, because
we already have an attribute drvPath in
the resulting set (see state.sDrvPath). */
if (j == "drvPath")
state.error<EvalError>("invalid derivation output name 'drvPath'")
.atPos(v)
.debugThrow();
outputs.insert(j);