diff options
author | pennae <github@quasiparticle.net> | 2021-10-15 16:30:58 +0200 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2021-10-15 16:39:10 +0200 |
commit | dc895fb2815032adbcc49f090812fa355074d9be (patch) | |
tree | 3e95c4f67892d841c69c4036e12ae51d1ed419a7 /lib/customisation.nix | |
parent | dcfa5952754e5cc6cbbf7df40b62aabb3792bdc9 (diff) |
lib: make extendDerivation lighter on eval
the fix to extendDerivation in #140051 unwittingly worsened eval performance by quite a bit. set elements alone needed over 1GB extra after the change, which seems disproportionate to how small it was. if we flip the logic used to determine which outputs to install around and keep a "this one exactly" flag in the specific outputs instead of a "all of them" in the root we can avoid most of that cost.
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r-- | lib/customisation.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix index a794b673d70c2..234a528527d3c 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -145,14 +145,14 @@ rec { let outputs = drv.outputs or [ "out" ]; - commonAttrs = (removeAttrs drv [ "outputUnspecified" ]) // - (builtins.listToAttrs outputsList) // + commonAttrs = drv // (builtins.listToAttrs outputsList) // ({ all = map (x: x.value) outputsList; }) // passthru; outputToAttrListElement = outputName: { name = outputName; value = commonAttrs // { inherit (drv.${outputName}) type outputName; + outputSpecified = true; drvPath = assert condition; drv.${outputName}.drvPath; outPath = assert condition; drv.${outputName}.outPath; }; @@ -160,7 +160,6 @@ rec { outputsList = map outputToAttrListElement outputs; in commonAttrs // { - outputUnspecified = true; drvPath = assert condition; drv.drvPath; outPath = assert condition; drv.outPath; }; |