diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/buildenv/default.nix | 7 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 8b8c3e3cbc20..10f7c69c3aa1 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -48,7 +48,12 @@ runCommand name meta pathsToLink extraPrefix postBuild buildInputs; pkgs = builtins.toJSON (map (drv: { paths = - [ drv ] + # 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) + then map (outName: drv.${outName}) drv.meta.outputsToInstall + else [ drv ]) + # Add any extra outputs specified by the caller of `buildEnv`. ++ lib.filter (p: p!=null) (builtins.map (outName: drv.${outName} or null) extraOutputsToLink); priority = drv.meta.priority or 5; diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 90cacd036c2a..547541d28246 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -225,6 +225,9 @@ let # If the packager hasn't specified `outputsToInstall`, choose a default, # namely `p.bin or p.out or p`; # if he has specified it, it will be overridden below in `// meta`. + # Note: This default probably shouldn't be globally configurable. + # Services and users should specify outputs explicitly, + # unless they are comfortable with this default. // { outputsToInstall = let outs = outputs'; # the value passed to derivation primitive |