From f57c6449dc1590a5277f6612384266bd8b2ef658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 17 Apr 2016 08:53:14 +0200 Subject: [PATCH] buildEnv: fix #14682 evaluation in some edge cases I supplied meta.outputsToInstall automatically in all mkDerivation products, but some packages still don't use it. The reported case: jekyll -> bundlerEnv -> buildEnv -> runCommand. --- pkgs/build-support/buildenv/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 8b2167a8e74..dc05ec1678c 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -49,8 +49,11 @@ runCommand name pkgs = builtins.toJSON (map (drv: { paths = # First add the usual output(s): respect if user has chosen explicitly, - # and otherwise use `meta.outputsToInstall` (guaranteed to exist by stdenv). - (if (drv.outputUnspecified or false) + # and otherwise use `meta.outputsToInstall`. The attribute is guaranteed + # to exist in mkDerivation-created cases. The other cases (e.g. runCommand) + # aren't expected to have multiple outputs. + (if drv.outputUnspecified or false + && drv.meta.outputsToInstall or null != null then map (outName: drv.${outName}) drv.meta.outputsToInstall else [ drv ]) # Add any extra outputs specified by the caller of `buildEnv`.