git.iko.soy/typeable/nixpkgs
on master help sign in
release-lib: Adapt to work with new meta.platforms

`packagePlatforms` now filters `supportedSystems` with the new-style `meta.platforms`, rather than just plopping it in as is.

commiteae19f3c28503a8623b0fee10bfb0b3322122637 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateWed 31 Jan 2018, 16:36 (9 years ago) parentc26252a
1 file changed+12−1
pkgs/top-level/release-lib.nix+12−1
pkgs/top-level/release-lib.nix+12−1
@@ -98,7 +98,18 @@ rec {
9898 packagePlatforms = mapAttrs (name: value:
9999 let res = builtins.tryEval (
100100 if isDerivation value then
101− value.meta.hydraPlatforms or (value.meta.platforms or [ "x86_64-linux" ])
101+ # TODO(@Ericson2314) deduplicate with `checkPlatform` in
102+ # `pkgs/stdenv/generic/check-meta.nix`.
103+ value.meta.hydraPlatforms or (let
104+ raw = value.meta.platforms or [ "x86_64-linux" ];
105+ toPattern = x: if builtins.isString x
106+ then { system = x; }
107+ else { parsed = x; };
108+ uniform = map toPattern raw;
109+ pred = hostPlatform:
110+ lib.any (pat: lib.matchAttrs pat hostPlatform) uniform;
111+ pred' = system: pred (lib.systems.elaborate { inherit system; });
112+ in lib.filter pred' supportedSystems)
102113 else if value.recurseForDerivations or false || value.recurseForRelease or false then
103114 packagePlatforms value
104115 else