mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
mkDerivation: make allowedReferences/allowedRequisites nullable when __structuredAttrs is true
This commit is contained in:
parent
4d3c76c4d3
commit
eddb12ac9d
2 changed files with 17 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ let
|
|||
elemAt
|
||||
extendDerivation
|
||||
filter
|
||||
filterAttrs
|
||||
getDev
|
||||
head
|
||||
imap1
|
||||
|
|
@ -709,8 +710,12 @@ let
|
|||
];
|
||||
}
|
||||
// (
|
||||
let
|
||||
attrsOutputChecks = makeOutputChecks attrs;
|
||||
attrsOutputChecksFiltered = filterAttrs (_: v: v != null) attrsOutputChecks;
|
||||
in
|
||||
if !__structuredAttrs then
|
||||
makeOutputChecks attrs
|
||||
attrsOutputChecks
|
||||
else
|
||||
{
|
||||
outputChecks = builtins.listToAttrs (
|
||||
|
|
@ -719,7 +724,7 @@ let
|
|||
value =
|
||||
let
|
||||
raw = zipAttrsWith (_: builtins.concatLists) [
|
||||
(makeOutputChecks attrs)
|
||||
attrsOutputChecksFiltered
|
||||
(makeOutputChecks attrs.outputChecks.${name} or { })
|
||||
];
|
||||
in
|
||||
|
|
|
|||
|
|
@ -68,6 +68,16 @@ let
|
|||
}).pname;
|
||||
expected = "hello-no-final-attrs-overridden";
|
||||
};
|
||||
structuredAttrs-allowedRequisites-nullability = {
|
||||
expr =
|
||||
lib.hasPrefix builtins.storeDir
|
||||
(pkgs.stdenv.mkDerivation {
|
||||
__structuredAttrs = true;
|
||||
inherit (pkgs.hello) pname version src;
|
||||
allowedRequisites = null;
|
||||
}).drvPath;
|
||||
expected = true;
|
||||
};
|
||||
};
|
||||
|
||||
test-extendMkDerivation =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue