summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-04-27 20:37:42 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-30 12:59:03 -0400
commita52e317200eca8ef7b8c6d6b77336a6a9f397a0e (patch)
tree41e69059241b74436455309b1582d68e27dc5b1e /pkgs/stdenv
parent366f70e3455297ea4f0c9eafea08b8df4bd4bed6 (diff)
downloadnixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar.gz
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar.bz2
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar.lz
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar.xz
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.tar.zst
nixpkgs-a52e317200eca8ef7b8c6d6b77336a6a9f397a0e.zip
check-meta: use system tuple in platforms
Fixes #60345
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/check-meta.nix13
1 files changed, 5 insertions, 8 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 76e1c351ff4..33868c2e4ae 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -168,7 +168,7 @@ let
     license = either (listOf lib.types.attrs) (either lib.types.attrs str);
     maintainers = listOf (attrsOf str);
     priority = int;
-    platforms = listOf (either str lib.systems.parsedPlatform.types.system);
+    platforms = listOf str;
     hydraPlatforms = listOf str;
     broken = bool;
     # TODO: refactor once something like Profpatsch's types-simple will land
@@ -209,11 +209,6 @@ let
     else "key '${k}' is unrecognized; expected one of: \n\t      [${lib.concatMapStringsSep ", " (x: "'${x}'") (lib.attrNames metaTypes)}]";
   checkMeta = meta: if shouldCheckMeta then lib.remove null (lib.mapAttrsToList checkMetaAttr meta) else [];
 
-  checkPlatform = attrs: let
-      anyMatch = lib.any (lib.meta.platformMatch hostPlatform);
-    in  anyMatch (attrs.meta.platforms or lib.platforms.all) &&
-      ! anyMatch (attrs.meta.badPlatforms or []);
-
   checkOutputsToInstall = attrs: let
       expectedOutputs = attrs.meta.outputsToInstall or [];
       actualOutputs = attrs.outputs or [ "out" ];
@@ -235,8 +230,10 @@ let
       { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
     else if !allowBroken && attrs.meta.broken or false then
       { valid = false; reason = "broken"; errormsg = "is marked as broken"; }
-    else if !allowUnsupportedSystem && !(checkPlatform attrs) then
-      { valid = false; reason = "unsupported"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
+    else if !allowUnsupportedSystem &&
+            (!lib.lists.elem hostPlatform.system (attrs.meta.platforms or lib.platforms.all) ||
+              lib.lists.elem hostPlatform.system (attrs.meta.badPlatforms or [])) then
+      { valid = false; reason = "unsupported"; errormsg = "is not supported on ‘${hostPlatform.system}’"; }
     else if !(hasAllowedInsecure attrs) then
       { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
     else if checkOutputsToInstall attrs then