python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / top-level / release-haskell.nix
blobbaa93c2bff76ff9f06972ec847bffae8ff372c74
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_unstable` 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" ] }:
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 if lib.isAttrs attrs
43         then accumulateDerivations (lib.attrValues attrs)
44         else []
45     ) jobList;
47   # names of all subsets of `pkgs.haskell.packages`
48   compilerNames = lib.mapAttrs (name: _: name) pkgs.haskell.packages;
50   # list of all compilers to test specific packages on
51   released = with compilerNames; [
52     ghc884
53     ghc8107
54     ghc902
55     ghc924
56     ghc942
57   ];
59   # packagePlatforms applied to `haskell.packages.*`
60   compilerPlatforms = lib.mapAttrs
61     (_: v: packagePlatforms v)
62     pkgs.haskell.packages;
64   # This function lets you specify specific packages
65   # which are to be tested on a list of specific GHC
66   # versions and returns a job set for all specified
67   # combinations. See `jobs` below for an example.
68   versionedCompilerJobs = config: mapTestOn {
69     haskell.packages =
70       (lib.mapAttrs (
71         ghc: jobs:
72         lib.filterAttrs (
73           jobName: platforms:
74           lib.elem ghc (config."${jobName}" or [])
75         ) jobs
76       ) compilerPlatforms);
77   };
79   # hydra jobs for `pkgs` of which we import a subset of
80   pkgsPlatforms = packagePlatforms pkgs;
82   # names of packages in an attribute set that are maintained
83   maintainedPkgNames = set: builtins.attrNames
84     (lib.filterAttrs (
85       _: v: builtins.length (v.meta.maintainers or []) > 0
86     ) set);
88   recursiveUpdateMany = builtins.foldl' lib.recursiveUpdate {};
90   # Remove multiple elements from a list at once.
91   #
92   # removeMany
93   #   :: [a]  -- list of elements to remove
94   #   -> [a]  -- list of elements from which to remove
95   #   -> [a]
96   #
97   # > removeMany ["aarch64-linux" "x86_64-darwin"] ["aarch64-linux" "x86_64-darwin" "x86_64-linux"]
98   # ["x86_64-linux"]
99   removeMany = itemsToRemove: list: lib.foldr lib.remove list itemsToRemove;
101   # Recursively remove platforms from the values in an attribute set.
102   #
103   # removePlatforms
104   #   :: [String]
105   #   -> AttrSet
106   #   -> AttrSet
107   #
108   # > attrSet = {
109   #     foo = ["aarch64-linux" "x86_64-darwin" "x86_64-linux"];
110   #     bar.baz = ["aarch64-linux" "x86_64-linux"];
111   #     bar.quux = ["aarch64-linux" "x86_64-darwin"];
112   #   }
113   # > removePlatforms ["aarch64-linux" "x86_64-darwin"] attrSet
114   # {
115   #   foo = ["x86_64-linux"];
116   #   bar = {
117   #     baz = ["x86_64-linux"];
118   #     quux = [];
119   #   };
120   # }
121   removePlatforms = platformsToRemove: packageSet:
122     lib.mapAttrsRecursive
123       (_: val:
124         if lib.isList val
125           then removeMany platformsToRemove val
126           else val
127       )
128       packageSet;
130   jobs = recursiveUpdateMany [
131     (mapTestOn {
132       haskellPackages = packagePlatforms pkgs.haskellPackages;
133       haskell.compiler = packagePlatforms pkgs.haskell.compiler // (lib.genAttrs [
134         "ghcjs"
135         "ghcjs810"
136       ] (ghcjsName: {
137         # We can't build ghcjs itself, since it exceeds 3GB (Hydra's output limit) due
138         # to the size of its bundled libs. We can however save users a bit of compile
139         # time by building the bootstrap ghcjs on Hydra. For this reason, we overwrite
140         # the ghcjs attributes in haskell.compiler with a reference to the bootstrap
141         # ghcjs attribute in their bootstrap package set (exposed via passthru) which
142         # would otherwise be ignored by Hydra.
143         bootGhcjs = (packagePlatforms pkgs.haskell.compiler.${ghcjsName}.passthru).bootGhcjs;
144       }));
146       tests.haskell = packagePlatforms pkgs.tests.haskell;
148       nixosTests = {
149         inherit (packagePlatforms pkgs.nixosTests)
150           agda
151           xmonad
152           xmonad-xdg-autostart
153         ;
154       };
156       agdaPackages = packagePlatforms pkgs.agdaPackages;
158       # top-level packages that depend on haskellPackages
159       inherit (pkgsPlatforms)
160         agda
161         arion
162         bench
163         bustle
164         blucontrol
165         cabal-install
166         cabal2nix
167         cachix
168         carp
169         cedille
170         client-ip-echo
171         darcs
172         dconf2nix
173         dhall
174         dhall-bash
175         dhall-docs
176         dhall-lsp-server
177         dhall-json
178         dhall-nix
179         diagrams-builder
180         elm2nix
181         fffuu
182         futhark
183         ghcid
184         git-annex
185         git-brunch
186         gitit
187         glirc
188         hadolint
189         haskell-ci
190         haskell-language-server
191         hasura-graphql-engine
192         hci
193         hercules-ci-agent
194         hinit
195         hedgewars
196         hledger
197         hledger-check-fancyassertions
198         hledger-iadd
199         hledger-interest
200         hledger-ui
201         hledger-web
202         hlint
203         hpack
204         # hyper-haskell  # depends on electron-10.4.7 which is marked as insecure
205         hyper-haskell-server-with-packages
206         icepeak
207         idris
208         ihaskell
209         jacinda
210         jl
211         koka
212         krank
213         lambdabot
214         lhs2tex
215         madlang
216         matterhorn
217         mueval
218         naproche
219         neuron-notes
220         niv
221         nix-delegate
222         nix-deploy
223         nix-diff
224         nix-linter
225         nix-output-monitor
226         nix-script
227         nix-tree
228         nixfmt
229         nota
230         nvfetcher
231         ormolu
232         pandoc
233         pakcs
234         petrinizer
235         place-cursor-at
236         pinboard-notes-backup
237         pretty-simple
238         shake
239         shellcheck
240         sourceAndTags
241         spacecookie
242         spago
243         splot
244         stack
245         stack2nix
246         stutter
247         stylish-haskell
248         taffybar
249         tamarin-prover
250         taskell
251         termonad
252         tldr-hs
253         tweet-hs
254         update-nix-fetchgit
255         uusi
256         uqm
257         uuagc
258         vaultenv
259         wstunnel
260         xmobar
261         xmonadctl
262         xmonad-with-packages
263         yi
264         zsh-git-prompt
265         ;
267       # Members of the elmPackages set that are Haskell derivations
268       elmPackages = {
269         inherit (pkgsPlatforms.elmPackages)
270           elm
271           elm-format
272           elm-instrument
273           elmi-to-json
274           ;
275       };
277       # GHCs linked to musl.
278       pkgsMusl.haskell.compiler = lib.recursiveUpdate
279         (packagePlatforms pkgs.pkgsMusl.haskell.compiler)
280         {
281           # remove musl ghc865Binary since it is known to be broken and
282           # causes an evaluation error on darwin.
283           # TODO: remove ghc865Binary altogether and use ghc8102Binary
284           ghc865Binary = {};
286           ghcjs = {};
287           ghcjs810 = {};
289           # Can't be built with musl, see meta.broken comment in the drv
290           integer-simple.ghc884 = {};
291           integer-simple.ghc88 = {};
292         };
294       # Get some cache going for MUSL-enabled GHC.
295       pkgsMusl.haskellPackages =
296         removePlatforms
297           [
298             # pkgsMusl is compiled natively with musl.  It is not
299             # cross-compiled (unlike pkgsStatic).  We can only
300             # natively bootstrap GHC with musl on x86_64-linux because
301             # upstream doesn't provide a musl bindist for aarch64.
302             "aarch64-linux"
304             # musl only supports linux, not darwin.
305             "x86_64-darwin"
306           ]
307           {
308             inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages)
309               hello
310               lens
311               random
312               ;
313           };
315       # Test some statically linked packages to catch regressions
316       # and get some cache going for static compilation with GHC.
317       # Use integer-simple to avoid GMP linking problems (LGPL)
318       pkgsStatic =
319         removePlatforms
320           [
321             "aarch64-linux" # times out on Hydra
322             "x86_64-darwin" # TODO: reenable when static libiconv works on darwin
323           ] {
324             haskellPackages = {
325               inherit (packagePlatforms pkgs.pkgsStatic.haskellPackages)
326                 hello
327                 lens
328                 random
329                 QuickCheck
330                 cabal2nix
331                 terminfo # isn't bundled for cross
332                 xhtml # isn't bundled for cross
333               ;
334             };
336             haskell.packages.native-bignum.ghc924 = {
337               inherit (packagePlatforms pkgs.pkgsStatic.haskell.packages.native-bignum.ghc92)
338                 hello
339                 lens
340                 random
341                 QuickCheck
342                 cabal2nix
343                 terminfo # isn't bundled for cross
344                 xhtml # isn't bundled for cross
345               ;
346             };
347           };
348     })
349     (versionedCompilerJobs {
350       # Packages which should be checked on more than the
351       # default GHC version. This list can be used to test
352       # the state of the package set with newer compilers
353       # and to confirm that critical packages for the
354       # package sets (like Cabal, jailbreak-cabal) are
355       # working as expected.
356       cabal-install = released;
357       Cabal_3_6_3_0 = released;
358       Cabal_3_8_1_0 = released;
359       cabal2nix = released;
360       cabal2nix-unstable = released;
361       funcmp = released;
362       haskell-language-server = released;
363       hoogle = released;
364       hlint = [
365         compilerNames.ghc884
366         compilerNames.ghc8107
367         compilerNames.ghc902
368         compilerNames.ghc924
369         # https://github.com/ndmitchell/hlint/issues/1413
370       ];
371       hpack = released;
372       hsdns = released;
373       jailbreak-cabal = released;
374       language-nix = released;
375       nix-paths = released;
376       titlecase = released;
377       ghc-api-compat = [
378         compilerNames.ghc884
379         compilerNames.ghc8107
380         compilerNames.ghc902
381       ];
382       ghc-bignum = [
383         compilerNames.ghc884
384         compilerNames.ghc8107
385       ];
386       ghc-lib = released;
387       ghc-lib-parser = released;
388       ghc-lib-parser-ex = released;
389       spectacle = [
390         compilerNames.ghc8107
391       ];
392       weeder = [
393         compilerNames.ghc8107
394         compilerNames.ghc902
395         compilerNames.ghc924
396       ];
397       purescript = [
398         compilerNames.ghc924
399       ];
400       purescript-cst = [
401         compilerNames.ghc8107
402       ];
403       purescript-ast = [
404         compilerNames.ghc8107
405       ];
406     })
407     {
408       mergeable = pkgs.releaseTools.aggregate {
409         name = "haskell-updates-mergeable";
410         meta = {
411           description = ''
412             Critical haskell packages that should work at all times,
413             serves as minimum requirement for an update merge
414           '';
415           maintainers = lib.teams.haskell.members;
416         };
417         constituents = accumulateDerivations [
418           # haskell specific tests
419           jobs.tests.haskell
420           # important top-level packages
421           jobs.cabal-install
422           jobs.cabal2nix
423           jobs.cachix
424           jobs.darcs
425           jobs.haskell-language-server
426           jobs.hledger
427           jobs.hledger-ui
428           jobs.hpack
429           jobs.niv
430           jobs.pandoc
431           jobs.stack
432           jobs.stylish-haskell
433           # important haskell (library) packages
434           jobs.haskellPackages.cabal-plan
435           jobs.haskellPackages.distribution-nixpkgs
436           jobs.haskellPackages.hackage-db
437           jobs.haskellPackages.xmonad
438           jobs.haskellPackages.xmonad-contrib
439           # haskell packages maintained by @peti
440           # imported from the old hydra jobset
441           jobs.haskellPackages.hopenssl
442           jobs.haskellPackages.hsemail
443           jobs.haskellPackages.hsyslog
444         ];
445       };
446       maintained = pkgs.releaseTools.aggregate {
447         name = "maintained-haskell-packages";
448         meta = {
449           description = "Aggregate jobset of all haskell packages with a maintainer";
450           maintainers = lib.teams.haskell.members;
451         };
452         constituents = accumulateDerivations
453           (builtins.map
454             (name: jobs.haskellPackages."${name}")
455             (maintainedPkgNames pkgs.haskellPackages));
456       };
458       muslGHCs = pkgs.releaseTools.aggregate {
459         name = "haskell-pkgsMusl-ghcs";
460         meta = {
461           description = "GHCs built with musl";
462           maintainers = with lib.maintainers; [
463             nh2
464           ];
465         };
466         constituents = accumulateDerivations [
467           jobs.pkgsMusl.haskell.compiler.ghc8102Binary
468           jobs.pkgsMusl.haskell.compiler.ghc8107Binary
469           jobs.pkgsMusl.haskell.compiler.ghc884
470           jobs.pkgsMusl.haskell.compiler.ghc8107
471           jobs.pkgsMusl.haskell.compiler.ghc902
472           jobs.pkgsMusl.haskell.compiler.ghc924
473           jobs.pkgsMusl.haskell.compiler.ghcHEAD
474           jobs.pkgsMusl.haskell.compiler.integer-simple.ghc8107
475           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc902
476           jobs.pkgsMusl.haskell.compiler.native-bignum.ghc924
477           jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD
478         ];
479       };
481       staticHaskellPackages = pkgs.releaseTools.aggregate {
482         name = "static-haskell-packages";
483         meta = {
484           description = "Static haskell builds using the pkgsStatic infrastructure";
485           maintainers = [
486             lib.maintainers.sternenseemann
487             lib.maintainers.rnhmjoj
488           ];
489         };
490         constituents = accumulateDerivations [
491           jobs.pkgsStatic.haskellPackages
492           jobs.pkgsStatic.haskell.packages.native-bignum.ghc924
493         ];
494       };
495     }
496   ];
498 in jobs