From b46c97e1dc27f78bcc1c72e9999e07c9b49ace6e Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:47:11 +0200 Subject: [PATCH] stdenv: generalise showPlatforms --- pkgs/stdenv/generic/check-meta.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 4c218b24d11d..1118e6837f29 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -113,7 +113,9 @@ let showLicenseOrSourceType = value: toString (map (v: v.shortName or "unknown") (lib.lists.toList value)); showLicense = showLicenseOrSourceType; - showPlatforms = value: lib.optionalString (builtins.isList value && builtins.all builtins.isString value) (toString value); + showPlatforms = attrs: toString (builtins.filter + (system: lib.meta.availableOn (lib.systems.elaborate { inherit system; }) attrs) + lib.platforms.all); showSourceType = showLicenseOrSourceType; pos_str = meta: meta.position or "«unknown-file»"; @@ -369,7 +371,7 @@ let else if !allowBroken && attrs.meta.broken or false then { valid = "no"; reason = "broken"; errormsg = "is marked as broken"; } else if !allowUnsupportedSystem && hasUnsupportedPlatform attrs then - { valid = "no"; reason = "unsupported"; errormsg = "is only supported on `${showPlatforms attrs.meta.platforms}` but not on requested ‘${hostPlatform.system}’"; } + { valid = "no"; reason = "unsupported"; errormsg = "is only supported on `${showPlatforms attrs}` but not on requested ‘${hostPlatform.system}’"; } else if !(hasAllowedInsecure attrs) then { valid = "no"; reason = "insecure"; errormsg = "is marked as insecure"; }