From 9b3b8f74bb974dcb7ecbfe2730296217532e3a42 Mon Sep 17 00:00:00 2001 From: pennae Date: Thu, 30 Sep 2021 17:29:55 +0200 Subject: [PATCH] fix nested calls to extendDerivation if extendDerivation is called on something that already had extendDerivation called on it (eg a mkDerivation result) the second call will set outputUnspecified=true on every output by way of propagating attributes of the full derivation to the individual outputs. this in turn causes buildEnv--and thus nix-shell and environment.systemPackages--to install every output of such a derivation even when only a specific output was requested, which renders the point of multiple outputs moot. this happens in python modules (see #139756), though it seems that tcl and possibly others should also be affected. --- lib/customisation.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index c17cb0d0f8e..a794b673d70 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -145,7 +145,8 @@ rec { let outputs = drv.outputs or [ "out" ]; - commonAttrs = drv // (builtins.listToAttrs outputsList) // + commonAttrs = (removeAttrs drv [ "outputUnspecified" ]) // + (builtins.listToAttrs outputsList) // ({ all = map (x: x.value) outputsList; }) // passthru; outputToAttrListElement = outputName: