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