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:32:47 +0900
committerDennis Gosnell <cdep.illabout@gmail.com>2023-03-24 11:32:47 +0900
commit4a736e5ede53881ed86078e8a31301ba0a62057f (patch)
tree4b6d33285e223cc213cac0a1d54f0a0e4e0ce379 /pkgs/top-level/release-haskell.nix
parent0d364a0117111c1677f0685a9ec3cca38d9608b3 (diff)
haskellPackages: small refactoring and comments to versionedCompilerJobs in release-haskell.nix
Diffstat (limited to 'pkgs/top-level/release-haskell.nix')
-rw-r--r--pkgs/top-level/release-haskell.nix35
1 files changed, 30 insertions, 5 deletions
diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix
index 10673a02ad1d0..c745615f20d9c 100644
--- a/pkgs/top-level/release-haskell.nix
+++ b/pkgs/top-level/release-haskell.nix
@@ -128,13 +128,38 @@ let
   # ```
   versionedCompilerJobs = config: mapTestOn {
     haskell.packages =
-      lib.mapAttrs
-        (ghc: jobs:
+      let
+        # Mapping function that takes an attrset of jobs, and
+        # removes all jobs that are not specified in config.
+        #
+        # For example, imagine a call to onlyConfigJobs like:
+        #
+        # ```
+        # onlyConfigJobs
+        #   "ghc902"
+        #   {
+        #     conduit = [ ... ];
+        #     lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ];
+        #   }
+        # ```
+        #
+        # onlyConfigJobs pulls out only those jobs that are specified in config.
+        #
+        # For instance, if config is `{ lens = [ "ghc902" ]; }`, then the above
+        # example call to onlyConfigJobs will return:
+        #
+        # ```
+        # { lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ]; }
+        # ```
+        #
+        # If config is `{ lens = [ "ghc8107" ]; }`, then the above example call
+        # to onlyConfigJobs returns `{}`.
+        onlyConfigJobs = ghc: jobs:
           lib.filterAttrs
             (jobName: platforms: lib.elem ghc (config."${jobName}" or []))
-            jobs
-        )
-        compilerPlatforms;
+            jobs;
+      in
+      lib.mapAttrs onlyConfigJobs compilerPlatforms;
   };
 
   # hydra jobs for `pkgs` of which we import a subset of