Skip to content

Commit

Permalink
stdenv.mkDerivation: improve performance of outputChecks
Browse files Browse the repository at this point in the history
As discussed in
NixOS#357054 (comment).
  • Loading branch information
wolfgangwalther committed Dec 1, 2024
1 parent 05342eb commit 2a6f660
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let
splitString
subtractLists
unique
zipAttrsWith
;

inherit (import ../../build-support/lib/cmake.nix { inherit lib stdenv; }) makeCMakeFlags;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2a6f660

Please sign in to comment.