diff options
author | Dennis Gosnell <cdep.illabout@gmail.com> | 2023-03-24 11:43:31 +0900 |
---|---|---|
committer | Dennis Gosnell <cdep.illabout@gmail.com> | 2023-03-24 11:43:31 +0900 |
commit | 105e326f5fb9d8220c88775561053796e991b86a (patch) | |
tree | e383a91e0761b2bcf469fa14fd737eec04238aab /pkgs/top-level/release-haskell.nix | |
parent | 4a736e5ede53881ed86078e8a31301ba0a62057f (diff) |
haskellPackages: make sure versionedCompilerJobs doesn't try running on platforms ghc does not support
Diffstat (limited to 'pkgs/top-level/release-haskell.nix')
-rw-r--r-- | pkgs/top-level/release-haskell.nix | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index c745615f20d9c..4e86000093b4a 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -154,10 +154,25 @@ let # # If config is `{ lens = [ "ghc8107" ]; }`, then the above example call # to onlyConfigJobs returns `{}`. + # + # onlyConfigJobs will also remove all platforms from a job that are not + # supported by the GHC it is compiled with. onlyConfigJobs = ghc: jobs: - lib.filterAttrs - (jobName: platforms: lib.elem ghc (config."${jobName}" or [])) - jobs; + let + configFilteredJobset = + lib.filterAttrs + (jobName: platforms: lib.elem ghc (config."${jobName}" or [])) + jobs; + + # Remove platforms from each job that are not supported by GHC. + # This is important so that we don't build jobs for platforms + # where GHC can't be compiled. + jobsetWithGHCPlatforms = + lib.mapAttrs + (_: platforms: lib.intersectLists jobs.ghc platforms) + configFilteredJobset; + in + jobsetWithGHCPlatforms; in lib.mapAttrs onlyConfigJobs compilerPlatforms; }; |