rtorrent: 0.9.8-unstable -> 0.10.0 (#345364)
[NixPkgs.git] / pkgs / top-level / release-haskell.nix
blob65f0ad17b5127881b270eccbb18f0d377bb769c1
1 /*
2   This is the Hydra jobset for the `haskell-updates` branch in Nixpkgs.
3   You can see the status of this jobset at
4   https://hydra.nixos.org/jobset/nixpkgs/haskell-updates.
6   To debug this expression you can use `hydra-eval-jobs` from
7   `pkgs.hydra` which prints the jobset description
8   to `stdout`:
10   $ hydra-eval-jobs -I . pkgs/top-level/release-haskell.nix
12 { supportedSystems ? [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ] }:
14 let
16   releaseLib = import ./release-lib.nix {
17     inherit supportedSystems;
18   };
20   inherit (releaseLib)
21     lib
22     mapTestOn
23     packagePlatforms
24     pkgs
25     ;
27   # Helper function which traverses a (nested) set
28   # of derivations produced by mapTestOn and flattens
29   # it to a list of derivations suitable to be passed
30   # to `releaseTools.aggregate` as constituents.
31   # Removes all non derivations from the input jobList.
32   #
33   # accumulateDerivations :: [ Either Derivation AttrSet ] -> [ Derivation ]
34   #
35   # > accumulateDerivations [ drv1 "string" { foo = drv2; bar = { baz = drv3; }; } ]
36   # [ drv1 drv2 drv3 ]
37   accumulateDerivations = jobList:
38     lib.concatMap (
39       attrs:
40         if lib.isDerivation attrs
41         then [ attrs ]
42         else lib.optionals (lib.isAttrs attrs) (accumulateDerivations (lib.attrValues attrs))
43     ) jobList;
45   # names of all subsets of `pkgs.haskell.packages`
46   #
47   # compilerNames looks like the following:
48   #
49   # ```
50   # {
51   #   ghc810 = "ghc810";
52   #   ghc8107Binary = "ghc8107Binary";
53   #   ghc8107 = "ghc8107";
54   #   ghc924 = "ghc924";
55   #   ...
56   # }
57   # ```
58   compilerNames = lib.mapAttrs (name: _: name) pkgs.haskell.packages;
60   # list of all compilers to test specific packages on
61   released = with compilerNames; [
62     ghc8107
63     ghc902
64     ghc925
65     ghc926
66     ghc927
67     ghc928
68     ghc945
69     ghc946
70     ghc947
71     ghc948
72     ghc963
73     ghc964
74     ghc965
75     ghc966
76     ghc981
77     ghc982
78     ghc9101
79   ];
81   # packagePlatforms applied to `haskell.packages.*`
82   #
83   # This returns an attr set that looks like the following, where each Haskell
84   # package in the compiler attr set has its list of supported platforms as its
85   # value.
86   #
87   # ```
88   # {
89   #   ghc810 = {
90   #     conduit = [ ... ];
91   #     lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ]
92   #     ...
93   #   };
94   #   ghc902 = { ... };
95   #   ...
96   # }
97   # ```
98   compilerPlatforms = lib.mapAttrs
99     (_: v: packagePlatforms v)
100     pkgs.haskell.packages;
102   # This function lets you specify specific packages
103   # which are to be tested on a list of specific GHC
104   # versions and returns a job set for all specified
105   # combinations.
106   #
107   # You can call versionedCompilerJobs like the following:
108   #
109   # ```
110   # versionedCompilerJobs {
111   #   ghc-tags = ["ghc902" "ghc924"];
112   # }
113   # ```
114   #
115   # This would produce an output like the following:
116   #
117   # ```
118   # {
119   #   haskell.packages = {
120   #     ghc884 = {};
121   #     ghc810 = {};
122   #     ghc902 = {
123   #       ghc-tags = {
124   #         aarch64-darwin = <derivation...>;
125   #         aarch64-linux = <derivation...>;
126   #         ...
127   #       };
128   #     };
129   #     ghc924 = {
130   #       ghc-tags = { ... };
131   #     };
132   #     ...
133   #   };
134   # }
135   # ```
136   versionedCompilerJobs = config: mapTestOn {
137     haskell.packages =
138       let
139         # Mapping function that takes an attrset of jobs, and
140         # removes all jobs that are not specified in config.
141         #
142         # For example, imagine a call to onlyConfigJobs like:
143         #
144         # ```
145         # onlyConfigJobs
146         #   "ghc902"
147         #   {
148         #     conduit = [ ... ];
149         #     lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ];
150         #   }
151         # ```
152         #
153         # onlyConfigJobs pulls out only those jobs that are specified in config.
154         #
155         # For instance, if config is `{ lens = [ "ghc902" ]; }`, then the above
156         # example call to onlyConfigJobs will return:
157         #
158         # ```
159         # { lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ]; }
160         # ```
161         #
162         # If config is `{ lens = [ "ghc8107" ]; }`, then the above example call
163         # to onlyConfigJobs returns `{}`.
164         #
165         # onlyConfigJobs will also remove all platforms from a job that are not
166         # supported by the GHC it is compiled with.
167         onlyConfigJobs = ghc: jobs:
168           let
169             configFilteredJobset =
170               lib.filterAttrs
171                 (jobName: platforms: lib.elem ghc (config."${jobName}" or []))
172                 jobs;
174             # Remove platforms from each job that are not supported by GHC.
175             # This is important so that we don't build jobs for platforms
176             # where GHC can't be compiled.
177             jobsetWithGHCPlatforms =
178               lib.mapAttrs
179                 (_: platforms: lib.intersectLists jobs.ghc platforms)
180                 configFilteredJobset;
181           in
182           jobsetWithGHCPlatforms;
183       in
184       lib.mapAttrs onlyConfigJobs compilerPlatforms;
185   };
187   # hydra jobs for `pkgs` of which we import a subset of
188   pkgsPlatforms = packagePlatforms pkgs;
190   # names of packages in an attribute set that are maintained
191   maintainedPkgNames = set: builtins.attrNames
192     (lib.filterAttrs (
193       _: v: builtins.length (v.meta.maintainers or []) > 0
194     ) set);
196   recursiveUpdateMany = builtins.foldl' lib.recursiveUpdate {};
198   # Remove multiple elements from a list at once.
199   #
200   # removeMany
201   #   :: [a]  -- list of elements to remove
202   #   -> [a]  -- list of elements from which to remove
203   #   -> [a]
204   #
205   # > removeMany ["aarch64-linux" "x86_64-darwin"] ["aarch64-linux" "x86_64-darwin" "x86_64-linux"]
206   # ["x86_64-linux"]
207   removeMany = itemsToRemove: list: lib.foldr lib.remove list itemsToRemove;
209   # Recursively remove platforms from the values in an attribute set.
210   #
211   # removePlatforms
212   #   :: [String]
213   #   -> AttrSet
214   #   -> AttrSet
215   #
216   # > attrSet = {
217   #     foo = ["aarch64-linux" "x86_64-darwin" "x86_64-linux"];
218   #     bar.baz = ["aarch64-linux" "x86_64-linux"];
219   #     bar.quux = ["aarch64-linux" "x86_64-darwin"];
220   #   }
221   # > removePlatforms ["aarch64-linux" "x86_64-darwin"] attrSet
222   # {
223   #   foo = ["x86_64-linux"];
224   #   bar = {
225   #     baz = ["x86_64-linux"];
226   #     quux = [];
227   #   };
228   # }
229   removePlatforms = platformsToRemove: packageSet:
230     lib.mapAttrsRecursive
231       (_: val:
232         if lib.isList val
233           then removeMany platformsToRemove val
234           else val
235       )
236       packageSet;
238   jobs = recursiveUpdateMany [
239     (mapTestOn {
240       haskellPackages = packagePlatforms pkgs.haskellPackages;
241       haskell.compiler = packagePlatforms pkgs.haskell.compiler // (lib.genAttrs [
242         "ghcjs"
243         "ghcjs810"
244       ] (ghcjsName: {
245         # We can't build ghcjs itself, since it exceeds 3GB (Hydra's output limit) due
246         # to the size of its bundled libs. We can however save users a bit of compile
247         # time by building the bootstrap ghcjs on Hydra. For this reason, we overwrite
248         # the ghcjs attributes in haskell.compiler with a reference to the bootstrap
249         # ghcjs attribute in their bootstrap package set (exposed via passthru) which
250         # would otherwise be ignored by Hydra.
251         bootGhcjs = (packagePlatforms pkgs.haskell.compiler.${ghcjsName}.passthru).bootGhcjs;
252       }));
254       tests.haskell = packagePlatforms pkgs.tests.haskell;
256       nixosTests = {
257         inherit (packagePlatforms pkgs.nixosTests)
258           agda
259           xmonad
260           xmonad-xdg-autostart
261         ;
262       };
264       agdaPackages = packagePlatforms pkgs.agdaPackages;
266       # top-level packages that depend on haskellPackages
267       inherit (pkgsPlatforms)
268         agda
269         alex
270         arion
271         bench
272         blucontrol
273         cabal-install
274         cabal2nix
275         cachix
276         # carp broken on 2024-04-09
277         changelog-d
278         cornelis
279         cedille
280         client-ip-echo
281         darcs
282         dconf2nix
283         dhall
284         dhall-bash
285         dhall-docs
286         dhall-lsp-server
287         dhall-json
288         dhall-nix
289         dhall-nixpkgs
290         dhall-yaml
291         diagrams-builder
292         echidna
293         elm2nix
294         emanote
295         fffuu
296         futhark
297         ghcid
298         git-annex
299         git-brunch
300         gitit
301         glirc
302         hadolint
303         happy
304         haskell-ci
305         haskell-language-server
306         hasura-graphql-engine
307         hci
308         hercules-ci-agent
309         hinit
310         hedgewars
311         hledger
312         hledger-check-fancyassertions
313         hledger-iadd
314         hledger-interest
315         hledger-ui
316         hledger-web
317         hlint
318         hpack
319         hscolour
320         icepeak
321         ihaskell
322         jacinda
323         jl
324         json2yaml
325         koka
326         krank
327         lambdabot
328         lhs2tex
329         madlang
330         mailctl
331         matterhorn
332         mkjson
333         mueval
334         naproche
335         niv
336         nix-delegate
337         nix-deploy
338         nix-diff
339         nix-linter
340         nix-output-monitor
341         nix-script
342         nix-tree
343         nixfmt
344         nixfmt-classic
345         nixfmt-rfc-style
346         nota
347         nvfetcher
348         oama
349         ormolu
350         # pakcs broken by set-extra on 2024-03-15
351         pandoc
352         place-cursor-at
353         pinboard-notes-backup
354         pretty-simple
355         purenix
356         shake
357         shellcheck
358         shellcheck-minimal
359         sourceAndTags
360         spacecookie
361         spago
362         specup
363         splot
364         stack
365         stack2nix
366         stutter
367         stylish-haskell
368         taffybar
369         tamarin-prover
370         taskell
371         termonad
372         tldr-hs
373         tweet-hs
374         update-nix-fetchgit
375         uusi
376         uqm
377         uuagc
378         # vaultenv: broken by connection on 2024-03-16
379         wstunnel
380         xmobar
381         xmonadctl
382         xmonad-with-packages
383         zsh-git-prompt
384         ;
386       # Members of the elmPackages set that are Haskell derivations
387       elmPackages = {
388         inherit (pkgsPlatforms.elmPackages)
389           elm
390           elm-format
391           elm-instrument
392           elmi-to-json
393           ;
394       };
396       # GHCs linked to musl.
397       pkgsMusl.haskell.compiler = lib.recursiveUpdate
398         (packagePlatforms pkgs.pkgsMusl.haskell.compiler)
399         {
400           # remove musl ghc865Binary since it is known to be broken and
401           # causes an evaluation error on darwin.
402           ghc865Binary = {};
404           ghcjs = {};
405           ghcjs810 = {};
406         };
408       # Get some cache going for MUSL-enabled GHC.
409       pkgsMusl.haskellPackages =
410         removePlatforms
411           [
412             # pkgsMusl is compiled natively with musl.  It is not
413             # cross-compiled (unlike pkgsStatic).  We can only
414             # natively bootstrap GHC with musl on x86_64-linux because
415             # upstream doesn't provide a musl bindist for aarch64.
416             "aarch64-linux"
418             # musl only supports linux, not darwin.
419             "x86_64-darwin"
420             "aarch64-darwin"
421           ]
422           {
423             inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
424               hello
425               lens
426               random
427               ;
428           };
430       # Test some statically linked packages to catch regressions
431       # and get some cache going for static compilation with GHC.
432       # Use native-bignum to avoid GMP linking problems (LGPL)
433       pkgsStatic =
434         removePlatforms
435           [
436             "aarch64-linux" # times out on Hydra
438             # Static doesn't work on darwin
439             "x86_64-darwin"
440             "aarch64-darwin"
441           ] {
442             haskellPackages = {
443               inherit (packagePlatforms pkgs.pkgsStatic.haskellPackages)
444                 hello
445                 lens
446                 random
447                 QuickCheck
448                 cabal2nix
449                 terminfo # isn't bundled for cross
450                 xhtml # isn't bundled for cross
451               ;
452             };
454             haskell.packages.native-bignum.ghc948 = {
455               inherit (packagePlatforms pkgs.pkgsStatic.haskell.packages.native-bignum.ghc948)
456                 hello
457                 lens
458                 random
459                 QuickCheck
460                 cabal2nix
461                 terminfo # isn't bundled for cross
462                 xhtml # isn't bundled for cross
463               ;
464             };
466             haskell.packages.native-bignum.ghc982 = {
467               inherit (packagePlatforms pkgs.pkgsStatic.haskell.packages.native-bignum.ghc982)
468                 hello
469                 random
470                 QuickCheck
471                 terminfo # isn't bundled for cross
472                 ;
473             };
474           };
476       pkgsCross.ghcjs =
477         removePlatforms
478           [
479             # Hydra output size of 3GB is exceeded
480             "aarch64-linux"
481           ]
482           {
483             haskellPackages = {
484               inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
485                 ghc
486                 hello
487                 microlens
488               ;
489             };
491             haskell.packages.ghc98 = {
492               inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98)
493                 ghc
494                 hello
495                 microlens
496               ;
497             };
499             haskell.packages.ghcHEAD = {
500               inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
501                 ghc
502                 hello
503                 microlens
504               ;
505             };
506           };
507     })
508     (versionedCompilerJobs {
509       # Packages which should be checked on more than the
510       # default GHC version. This list can be used to test
511       # the state of the package set with newer compilers
512       # and to confirm that critical packages for the
513       # package sets (like Cabal, jailbreak-cabal) are
514       # working as expected.
515       cabal-install = lib.subtractLists [
516         # It is recommended to use pkgs.cabal-install instead of cabal-install
517         # from the package sets. Due to (transitively) requiring recent versions
518         # of core packages, it is not always reasonable to get cabal-install to
519         # work with older compilers.
520         compilerNames.ghc8107
521         compilerNames.ghc902
522         compilerNames.ghc925
523         compilerNames.ghc926
524         compilerNames.ghc927
525         compilerNames.ghc928
526         compilerNames.ghc945
527         compilerNames.ghc946
528         compilerNames.ghc947
529         compilerNames.ghc948
530         compilerNames.ghc9101
531       ] released;
532       Cabal_3_10_3_0 = released;
533       Cabal-syntax_3_10_3_0 = released;
534       Cabal_3_12_1_0 = released;
535       Cabal-syntax_3_12_1_0 = released;
536       cabal2nix = lib.subtractLists [
537         compilerNames.ghc9101
538       ] released;
539       cabal2nix-unstable = lib.subtractLists [
540         compilerNames.ghc9101
541       ] released;
542       funcmp = released;
543       haskell-language-server = lib.subtractLists [
544         # Support ceased as of 2.3.0.0
545         compilerNames.ghc8107
546         # Support ceased as of 2.5.0.0
547         compilerNames.ghc902
548         # No support yet (2024-05-12)
549         compilerNames.ghc9101
550       ] released;
551       hoogle = lib.subtractLists [
552         compilerNames.ghc9101
553       ] released;
554       hlint = lib.subtractLists [
555         compilerNames.ghc902
556         compilerNames.ghc9101
557       ] released;
558       hpack = lib.subtractLists [
559         compilerNames.ghc9101
560       ] released;
561       hsdns = released;
562       jailbreak-cabal = released;
563       language-nix = lib.subtractLists [
564         compilerNames.ghc9101
565       ] released;
566       large-hashable = [
567         compilerNames.ghc928
568       ];
569       nix-paths = released;
570       titlecase = lib.subtractLists [
571         compilerNames.ghc9101
572       ] released;
573       ghc-api-compat = [
574         compilerNames.ghc8107
575         compilerNames.ghc902
576       ];
577       ghc-bignum = [
578         compilerNames.ghc8107
579       ];
580       ghc-lib = lib.subtractLists [
581         compilerNames.ghc9101
582       ] released;
583       ghc-lib-parser = lib.subtractLists [
584         compilerNames.ghc9101
585       ] released;
586       ghc-lib-parser-ex = lib.subtractLists [
587         compilerNames.ghc9101
588       ] released;
589       ghc-source-gen = [
590         # Feel free to remove these as they break,
591         compilerNames.ghc8107
592         compilerNames.ghc902
593         compilerNames.ghc928
594       ];
595       ghc-tags = lib.subtractLists [
596         compilerNames.ghc9101
597       ] released;
598       hashable = lib.subtractLists [
599         compilerNames.ghc9101
600       ] released;
601       primitive = lib.subtractLists [
602         compilerNames.ghc9101
603       ] released;
604       weeder = lib.subtractLists [
605         compilerNames.ghc9101
606       ] released;
607     })
608     {
609       mergeable = pkgs.releaseTools.aggregate {
610         name = "haskell-updates-mergeable";
611         meta = {
612           description = ''
613             Critical haskell packages that should work at all times,
614             serves as minimum requirement for an update merge
615           '';
616           maintainers = lib.teams.haskell.members;
617         };
618         constituents =
619           accumulateDerivations [
620             # haskell specific tests
621             jobs.tests.haskell
622             # important top-level packages
623             jobs.cabal-install
624             jobs.cabal2nix
625             jobs.cachix
626             jobs.darcs
627             jobs.haskell-language-server
628             jobs.hledger
629             jobs.hledger-ui
630             jobs.hpack
631             jobs.niv
632             jobs.pandoc
633             jobs.stack
634             jobs.stylish-haskell
635             jobs.shellcheck
636             # important haskell (library) packages
637             jobs.haskellPackages.cabal-plan
638             jobs.haskellPackages.distribution-nixpkgs
639             jobs.haskellPackages.hackage-db
640             jobs.haskellPackages.xmonad
641             jobs.haskellPackages.xmonad-contrib
642             # haskell packages maintained by @peti
643             # imported from the old hydra jobset
644             jobs.haskellPackages.hopenssl
645             jobs.haskellPackages.hsemail
646             jobs.haskellPackages.hsyslog
647            ];
648       };
649       maintained = pkgs.releaseTools.aggregate {
650         name = "maintained-haskell-packages";
651         meta = {
652           description = "Aggregate jobset of all haskell packages with a maintainer";
653           maintainers = lib.teams.haskell.members;
654         };
655         constituents = accumulateDerivations
656           (builtins.map
657             (name: jobs.haskellPackages."${name}")
658             (maintainedPkgNames pkgs.haskellPackages));
659       };
661       muslGHCs = pkgs.releaseTools.aggregate {
662         name = "haskell-pkgsMusl-ghcs";
663         meta = {
664           description = "GHCs built with musl";
665           maintainers = with lib.maintainers; [
666             nh2
667           ];
668         };
669         constituents = accumulateDerivations [
670           jobs.pkgsMusl.haskell.compiler.ghc8107Binary
671           jobs.pkgsMusl.haskell.compiler.ghc8107
672           jobs.pkgsMusl.haskell.compiler.ghc902
673           jobs.pkgsMusl.haskell.compiler.ghc925
674           jobs.pkgsMusl.haskell.compiler.ghc926
675           jobs.pkgsMusl.haskell.compiler.ghc927
676           jobs.pkgsMusl.haskell.compiler.ghc928
677           jobs.pkgsMusl.haskell.compiler.ghcHEAD
678           jobs.pkgsMusl.haskell.compiler.integer-simple.ghc8107
679           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc902
680           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc925
681           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc926
682           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc927
683           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc928
684           jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD
685         ];
686       };
688       staticHaskellPackages = pkgs.releaseTools.aggregate {
689         name = "static-haskell-packages";
690         meta = {
691           description = "Static haskell builds using the pkgsStatic infrastructure";
692           maintainers = [
693             lib.maintainers.sternenseemann
694             lib.maintainers.rnhmjoj
695           ];
696         };
697         constituents = accumulateDerivations [
698           jobs.pkgsStatic.haskell.packages.native-bignum.ghc948 # non-hadrian
699           jobs.pkgsStatic.haskellPackages
700           jobs.pkgsStatic.haskell.packages.native-bignum.ghc982
701         ];
702       };
703     }
704   ];
706 in jobs