stdenv.mkDerivation: improve performance of outputChecks

As discussed in
https://github.com/NixOS/nixpkgs/pull/357054#discussion_r1864675075.
This commit is contained in:
Wolfgang Walther
2024-12-01 11:05:58 +01:00
parent 05342eb1de
commit 2a6f660292
+4 -5
View File
@@ -37,6 +37,7 @@ let
splitString
subtractLists
unique
zipAttrsWith
;
inherit (import ../../build-support/lib/cmake.nix { inherit lib stdenv; }) makeCMakeFlags;
@@ -493,17 +494,15 @@ else let
"/bin/sh"
];
__propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
}) // lib.optionalAttrs (!__structuredAttrs) (
makeOutputChecks attrs
) // lib.optionalAttrs (__structuredAttrs) {
}) // (if !__structuredAttrs then makeOutputChecks attrs else {
outputChecks = builtins.listToAttrs (map (name: {
inherit name;
value = lib.zipAttrsWith (_: builtins.concatLists) [
value = zipAttrsWith (_: builtins.concatLists) [
(makeOutputChecks attrs)
(makeOutputChecks attrs.outputChecks.${name} or {})
];
}) outputs);
};
});
in
derivationArg;