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_unstable` which prints the jobset description
10 $ hydra-eval-jobs -I . pkgs/top-level/release-haskell.nix
12 { supportedSystems ? [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ] }:
16 releaseLib = import ./release-lib.nix {
17 inherit supportedSystems;
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.
33 # accumulateDerivations :: [ Either Derivation AttrSet ] -> [ Derivation ]
35 # > accumulateDerivations [ drv1 "string" { foo = drv2; bar = { baz = drv3; }; } ]
37 accumulateDerivations = jobList:
40 if lib.isDerivation attrs
42 else lib.optionals (lib.isAttrs attrs) (accumulateDerivations (lib.attrValues attrs))
45 # names of all subsets of `pkgs.haskell.packages`
47 # compilerNames looks like the following:
52 # ghc8102Binary = "ghc8102Binary";
53 # ghc8102BinaryMinimal = "ghc8102BinaryMinimal";
54 # ghc8107 = "ghc8107";
59 compilerNames = lib.mapAttrs (name: _: name) pkgs.haskell.packages;
61 # list of all compilers to test specific packages on
62 released = with compilerNames; [
79 # packagePlatforms applied to `haskell.packages.*`
81 # This returns an attr set that looks like the following, where each Haskell
82 # package in the compiler attr set has its list of supported platforms as its
89 # lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ]
96 compilerPlatforms = lib.mapAttrs
97 (_: v: packagePlatforms v)
98 pkgs.haskell.packages;
100 # This function lets you specify specific packages
101 # which are to be tested on a list of specific GHC
102 # versions and returns a job set for all specified
105 # You can call versionedCompilerJobs like the following:
108 # versionedCompilerJobs {
109 # ghc-tags = ["ghc902" "ghc924"];
113 # This would produce an output like the following:
117 # haskell.packages = {
122 # aarch64-darwin = <derivation...>;
123 # aarch64-linux = <derivation...>;
128 # ghc-tags = { ... };
134 versionedCompilerJobs = config: mapTestOn {
137 # Mapping function that takes an attrset of jobs, and
138 # removes all jobs that are not specified in config.
140 # For example, imagine a call to onlyConfigJobs like:
147 # lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ];
151 # onlyConfigJobs pulls out only those jobs that are specified in config.
153 # For instance, if config is `{ lens = [ "ghc902" ]; }`, then the above
154 # example call to onlyConfigJobs will return:
157 # { lens = [ "i686-cygwin" "x86_64-cygwin" ... "x86_64-windows" "i686-windows" ]; }
160 # If config is `{ lens = [ "ghc8107" ]; }`, then the above example call
161 # to onlyConfigJobs returns `{}`.
163 # onlyConfigJobs will also remove all platforms from a job that are not
164 # supported by the GHC it is compiled with.
165 onlyConfigJobs = ghc: jobs:
167 configFilteredJobset =
169 (jobName: platforms: lib.elem ghc (config."${jobName}" or []))
172 # Remove platforms from each job that are not supported by GHC.
173 # This is important so that we don't build jobs for platforms
174 # where GHC can't be compiled.
175 jobsetWithGHCPlatforms =
177 (_: platforms: lib.intersectLists jobs.ghc platforms)
178 configFilteredJobset;
180 jobsetWithGHCPlatforms;
182 lib.mapAttrs onlyConfigJobs compilerPlatforms;
185 # hydra jobs for `pkgs` of which we import a subset of
186 pkgsPlatforms = packagePlatforms pkgs;
188 # names of packages in an attribute set that are maintained
189 maintainedPkgNames = set: builtins.attrNames
191 _: v: builtins.length (v.meta.maintainers or []) > 0
194 recursiveUpdateMany = builtins.foldl' lib.recursiveUpdate {};
196 # Remove multiple elements from a list at once.
199 # :: [a] -- list of elements to remove
200 # -> [a] -- list of elements from which to remove
203 # > removeMany ["aarch64-linux" "x86_64-darwin"] ["aarch64-linux" "x86_64-darwin" "x86_64-linux"]
205 removeMany = itemsToRemove: list: lib.foldr lib.remove list itemsToRemove;
207 # Recursively remove platforms from the values in an attribute set.
215 # foo = ["aarch64-linux" "x86_64-darwin" "x86_64-linux"];
216 # bar.baz = ["aarch64-linux" "x86_64-linux"];
217 # bar.quux = ["aarch64-linux" "x86_64-darwin"];
219 # > removePlatforms ["aarch64-linux" "x86_64-darwin"] attrSet
221 # foo = ["x86_64-linux"];
223 # baz = ["x86_64-linux"];
227 removePlatforms = platformsToRemove: packageSet:
228 lib.mapAttrsRecursive
231 then removeMany platformsToRemove val
236 jobs = recursiveUpdateMany [
238 haskellPackages = packagePlatforms pkgs.haskellPackages;
239 haskell.compiler = packagePlatforms pkgs.haskell.compiler // (lib.genAttrs [
243 # We can't build ghcjs itself, since it exceeds 3GB (Hydra's output limit) due
244 # to the size of its bundled libs. We can however save users a bit of compile
245 # time by building the bootstrap ghcjs on Hydra. For this reason, we overwrite
246 # the ghcjs attributes in haskell.compiler with a reference to the bootstrap
247 # ghcjs attribute in their bootstrap package set (exposed via passthru) which
248 # would otherwise be ignored by Hydra.
249 bootGhcjs = (packagePlatforms pkgs.haskell.compiler.${ghcjsName}.passthru).bootGhcjs;
252 tests.haskell = packagePlatforms pkgs.tests.haskell;
255 inherit (packagePlatforms pkgs.nixosTests)
262 agdaPackages = packagePlatforms pkgs.agdaPackages;
264 # top-level packages that depend on haskellPackages
265 inherit (pkgsPlatforms)
297 haskell-language-server
298 hasura-graphql-engine
304 hledger-check-fancyassertions
311 # hyper-haskell # depends on electron-10.4.7 which is marked as insecure
312 # hyper-haskell-server-with-packages # hyper-haskell-server is broken
341 pinboard-notes-backup
372 # Members of the elmPackages set that are Haskell derivations
374 inherit (pkgsPlatforms.elmPackages)
382 # GHCs linked to musl.
383 pkgsMusl.haskell.compiler = lib.recursiveUpdate
384 (packagePlatforms pkgs.pkgsMusl.haskell.compiler)
386 # remove musl ghc865Binary since it is known to be broken and
387 # causes an evaluation error on darwin.
388 # TODO: remove ghc865Binary altogether and use ghc8102Binary
394 # Can't be built with musl, see meta.broken comment in the drv
395 integer-simple.ghc884 = {};
396 integer-simple.ghc88 = {};
399 # Get some cache going for MUSL-enabled GHC.
400 pkgsMusl.haskellPackages =
403 # pkgsMusl is compiled natively with musl. It is not
404 # cross-compiled (unlike pkgsStatic). We can only
405 # natively bootstrap GHC with musl on x86_64-linux because
406 # upstream doesn't provide a musl bindist for aarch64.
409 # musl only supports linux, not darwin.
414 inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
421 # Test some statically linked packages to catch regressions
422 # and get some cache going for static compilation with GHC.
423 # Use integer-simple to avoid GMP linking problems (LGPL)
427 "aarch64-linux" # times out on Hydra
429 # Static doesn't work on darwin
434 inherit (packagePlatforms pkgs.pkgsStatic.haskellPackages)
440 terminfo # isn't bundled for cross
441 xhtml # isn't bundled for cross
445 haskell.packages.native-bignum.ghc928 = {
446 inherit (packagePlatforms pkgs.pkgsStatic.haskell.packages.native-bignum.ghc928)
452 terminfo # isn't bundled for cross
453 xhtml # isn't bundled for cross
461 # Hydra output size of 3GB is exceeded
466 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages)
472 haskell.packages.ghcHEAD = {
473 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD)
480 (versionedCompilerJobs {
481 # Packages which should be checked on more than the
482 # default GHC version. This list can be used to test
483 # the state of the package set with newer compilers
484 # and to confirm that critical packages for the
485 # package sets (like Cabal, jailbreak-cabal) are
486 # working as expected.
487 cabal-install = lib.subtractLists [
490 Cabal_3_10_2_1 = lib.subtractLists [
493 Cabal-syntax_3_10_1_0 = lib.subtractLists [
496 cabal2nix = lib.subtractLists [
499 cabal2nix-unstable = lib.subtractLists [
503 haskell-language-server = lib.subtractLists [
504 # Support ceased as of 1.9.0.0
506 # Support ceased as of 2.3.0.0
507 compilerNames.ghc8107
511 hoogle = lib.subtractLists [
516 hlint = lib.subtractLists [
521 hpack = lib.subtractLists [
525 jailbreak-cabal = released;
526 language-nix = lib.subtractLists [
532 nix-paths = released;
533 titlecase = lib.subtractLists [
538 compilerNames.ghc8107
543 compilerNames.ghc8107
545 ghc-lib = lib.subtractLists [
548 ghc-lib-parser = lib.subtractLists [
551 ghc-lib-parser-ex = lib.subtractLists [
555 # Feel free to remove these as they break,
556 # ghc-source-gen currently doesn't support GHC 9.4
558 compilerNames.ghc8107
562 ghc-tags = lib.subtractLists [
566 hashable = lib.subtractLists [
569 primitive = released;
571 compilerNames.ghc8107
586 mergeable = pkgs.releaseTools.aggregate {
587 name = "haskell-updates-mergeable";
590 Critical haskell packages that should work at all times,
591 serves as minimum requirement for an update merge
593 maintainers = lib.teams.haskell.members;
597 # Filter out all Darwin derivations. We don't want flakey Darwin
598 # derivations and flakey Hydra Darwin builders to block the
599 # mergeable job from successfully building.
601 lib.filter (drv: drv.system == "x86_64-linux" || drv.system == "aarch64-linux");
604 (accumulateDerivations [
605 # haskell specific tests
607 # important top-level packages
612 jobs.haskell-language-server
620 # important haskell (library) packages
621 jobs.haskellPackages.cabal-plan
622 jobs.haskellPackages.distribution-nixpkgs
623 jobs.haskellPackages.hackage-db
624 jobs.haskellPackages.xmonad
625 jobs.haskellPackages.xmonad-contrib
626 # haskell packages maintained by @peti
627 # imported from the old hydra jobset
628 jobs.haskellPackages.hopenssl
629 jobs.haskellPackages.hsemail
630 jobs.haskellPackages.hsyslog
633 maintained = pkgs.releaseTools.aggregate {
634 name = "maintained-haskell-packages";
636 description = "Aggregate jobset of all haskell packages with a maintainer";
637 maintainers = lib.teams.haskell.members;
639 constituents = accumulateDerivations
641 (name: jobs.haskellPackages."${name}")
642 (maintainedPkgNames pkgs.haskellPackages));
645 muslGHCs = pkgs.releaseTools.aggregate {
646 name = "haskell-pkgsMusl-ghcs";
648 description = "GHCs built with musl";
649 maintainers = with lib.maintainers; [
653 constituents = accumulateDerivations [
654 jobs.pkgsMusl.haskell.compiler.ghc8102Binary
655 jobs.pkgsMusl.haskell.compiler.ghc8107Binary
656 jobs.pkgsMusl.haskell.compiler.ghc884
657 jobs.pkgsMusl.haskell.compiler.ghc8107
658 jobs.pkgsMusl.haskell.compiler.ghc902
659 jobs.pkgsMusl.haskell.compiler.ghc924
660 jobs.pkgsMusl.haskell.compiler.ghc925
661 jobs.pkgsMusl.haskell.compiler.ghc926
662 jobs.pkgsMusl.haskell.compiler.ghc927
663 jobs.pkgsMusl.haskell.compiler.ghc928
664 jobs.pkgsMusl.haskell.compiler.ghcHEAD
665 jobs.pkgsMusl.haskell.compiler.integer-simple.ghc8107
666 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc902
667 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc924
668 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc925
669 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc926
670 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc927
671 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc928
672 jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD
676 staticHaskellPackages = pkgs.releaseTools.aggregate {
677 name = "static-haskell-packages";
679 description = "Static haskell builds using the pkgsStatic infrastructure";
681 lib.maintainers.sternenseemann
682 lib.maintainers.rnhmjoj
685 constituents = accumulateDerivations [
686 jobs.pkgsStatic.haskellPackages
687 jobs.pkgsStatic.haskell.packages.native-bignum.ghc928