about summary refs log tree commit diff
path: root/pkgs/build-support/buildenv
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-04-17 08:53:14 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-04-17 08:57:17 +0200
commitf57c6449dc1590a5277f6612384266bd8b2ef658 (patch)
treed5ad5cb5e3516477eaa0a3928b14dff2b45ed86f /pkgs/build-support/buildenv
parenta832a71c2c8d7bb8a9afb19f03a8f616de48a490 (diff)
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.
Diffstat (limited to 'pkgs/build-support/buildenv')
-rw-r--r--pkgs/build-support/buildenv/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix
index 8b2167a8e74f6..dc05ec1678cb4 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`.