stdenv/check-meta: Remove outputsToInstall list concat from common meta

Normally either of "bin" or "out" will hit first so we can avoid dynamic looping altogether.
This commit is contained in:
adisbladis 2024-03-20 13:35:51 +13:00
parent 7872526e9c
commit 1e2f8f2a84

View File

@ -443,6 +443,7 @@ let
commonMeta = { validity, attrs, pos ? null, references ? [ ] }:
let
outputs = attrs.outputs or [ "out" ];
hasOutput = out: builtins.elem out outputs;
in
{
# `name` derivation attribute includes cross-compilation cruft,
@ -461,10 +462,13 @@ let
# Services and users should specify outputs explicitly,
# unless they are comfortable with this default.
outputsToInstall =
let
hasOutput = out: builtins.elem out outputs;
in
[ (findFirst hasOutput null ([ "bin" "out" ] ++ outputs)) ]
[
(
if hasOutput "bin" then "bin"
else if hasOutput "out" then "out"
else findFirst hasOutput null outputs
)
]
++ optional (hasOutput "man") "man";
}
// attrs.meta or { }