summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-06-04 11:29:48 -0400
committerGitHub <noreply@github.com>2019-06-04 11:29:48 -0400
commit760c9995b0601e8679d303ce5c301fdb33fb2c5d (patch)
tree9b6c72336df80af5becb13c3d5400102b18bac67 /pkgs/stdenv/generic
parent9120dbf180fd173d8aa95ca4a89ac2ab529b675c (diff)
parent635b7625690d9f8f61da0a187e7ed4a7ec274fdc (diff)
downloadnixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar.gz
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar.bz2
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar.lz
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar.xz
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.tar.zst
nixpkgs-760c9995b0601e8679d303ce5c301fdb33fb2c5d.zip
Merge pull request #60349 from matthewbauer/fix-60345
check-meta: use system tuple in platforms
Diffstat (limited to 'pkgs/stdenv/generic')
-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 8cb0ad79587..89e2a7a8031 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -169,7 +169,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
@@ -210,11 +210,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" ];
@@ -236,8 +231,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