From 1e2f8f2a84f459719c5e9d33df9c9ed1cc31df41 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 20 Mar 2024 13:35:51 +1300 Subject: [PATCH] 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. --- pkgs/stdenv/generic/check-meta.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 63c853e3dc31..4f6011a3d5cb 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -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 { }