From 2059866080f73876486d11d2be85062cff7e5815 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Thu, 7 May 2026 01:19:14 -0400 Subject: [PATCH] stdenv/check-meta: avoid running platformMatch if we can help it --- pkgs/stdenv/generic/check-meta.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 404debbf1b06..910fe5d1aa32 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -125,7 +125,11 @@ let # Logical inversion of meta.availableOn for hostPlatform hasUnsupportedPlatform = let - anyHostPlatform = any (platformMatch hostPlatform); + inherit (hostPlatform) system; + # in almost all cases, meta.platforms is a simple list of strings, and we + # can just check if it contains the current system. we only run the more + # intensive platformMatch if necessary + anyHostPlatform = list: elem system list || any (platformMatch hostPlatform) list; in pkg: pkg ? meta.platforms && !(anyHostPlatform pkg.meta.platforms)