diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix index 41221f8b89f3..c7581c47d341 100644 --- a/pkgs/top-level/release-lib.nix +++ b/pkgs/top-level/release-lib.nix @@ -163,19 +163,26 @@ let (addMetaAttrs { maintainers = crossMaintainers; }); - /* Recursively map a (nested) set of derivations to an isomorphic - set of meta.platforms values. */ - packagePlatforms = mapAttrs (name: value: + /* Recursive for packages and apply a function to them */ + recursiveMapPackages = f: mapAttrs (name: value: if isDerivation value then - value.meta.hydraPlatforms - or (subtractLists (value.meta.badPlatforms or []) - (value.meta.platforms or supportedSystems)) + f value else if value.recurseForDerivations or false || value.recurseForRelease or false then - packagePlatforms value + recursiveMapPackages f value else [] ); + /* Gets the list of Hydra platforms for a derivation */ + getPlatforms = drv: + drv.meta.hydraPlatforms + or (subtractLists (drv.meta.badPlatforms or []) + (drv.meta.platforms or supportedSystems)); + + /* Recursively map a (nested) set of derivations to an isomorphic + set of meta.platforms values. */ + packagePlatforms = recursiveMapPackages getPlatforms; + in { /* Common platform groups on which to test packages. */ inherit (platforms) unix linux darwin cygwin all; @@ -188,6 +195,8 @@ in { lib mapTestOn mapTestOnCross + recursiveMapPackages + getPlatforms packagePlatforms pkgs pkgsFor diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index 3d9de8660282..a8e65a6a7415 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -321,8 +321,9 @@ let # Conflicts usually cause silent job drops like in # https://github.com/NixOS/nixpkgs/pull/182058 jobs = let - packagePlatforms = if attrNamesOnly then id else release-lib.packagePlatforms; - packageJobs = { + packagePlatforms = release-lib.recursiveMapPackages + (if attrNamesOnly then id else release-lib.getPlatforms); + packageJobs = packagePlatforms pkgs // { haskell.compiler = packagePlatforms pkgs.haskell.compiler; haskellPackages = packagePlatforms pkgs.haskellPackages; # Build selected packages (HLS) for multiple Haskell compilers to rebuild @@ -363,8 +364,8 @@ let }; mapTestOn-packages = if attrNamesOnly - then pkgs // packageJobs - else mapTestOn ((packagePlatforms pkgs) // packageJobs); + then packageJobs + else mapTestOn packageJobs; in unionOfDisjoint nonPackageJobs mapTestOn-packages;