about summary refs log tree commit diff
path: root/pkgs/top-level/release-haskell.nix
diff options
context:
space:
mode:
authorDennis Gosnell <cdep.illabout@gmail.com>2023-03-24 11:43:31 +0900
committerDennis Gosnell <cdep.illabout@gmail.com>2023-03-24 11:43:31 +0900
commit105e326f5fb9d8220c88775561053796e991b86a (patch)
treee383a91e0761b2bcf469fa14fd737eec04238aab /pkgs/top-level/release-haskell.nix
parent4a736e5ede53881ed86078e8a31301ba0a62057f (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.nix21
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;
   };