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.
This commit is contained in:
parent
a832a71c2c
commit
f57c6449dc
|
@ -49,8 +49,11 @@ runCommand name
|
||||||
pkgs = builtins.toJSON (map (drv: {
|
pkgs = builtins.toJSON (map (drv: {
|
||||||
paths =
|
paths =
|
||||||
# First add the usual output(s): respect if user has chosen explicitly,
|
# First add the usual output(s): respect if user has chosen explicitly,
|
||||||
# and otherwise use `meta.outputsToInstall` (guaranteed to exist by stdenv).
|
# and otherwise use `meta.outputsToInstall`. The attribute is guaranteed
|
||||||
(if (drv.outputUnspecified or false)
|
# 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
|
then map (outName: drv.${outName}) drv.meta.outputsToInstall
|
||||||
else [ drv ])
|
else [ drv ])
|
||||||
# Add any extra outputs specified by the caller of `buildEnv`.
|
# Add any extra outputs specified by the caller of `buildEnv`.
|
||||||
|
|
Loading…
Reference in a new issue