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