stdenv/check-meta: avoid running platformMatch if we can help it (#517542)

This commit is contained in:
adisbladis
2026-05-07 10:22:56 +00:00
committed by GitHub
+5 -1
View File
@@ -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)