Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at python-updates 753 lines 22 kB view raw
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 aarch64-android-prebuilt.pkgsStatic = 483 removePlatforms 484 [ 485 # Android NDK package doesn't support building on 486 "aarch64-darwin" 487 "aarch64-linux" 488 489 "x86_64-darwin" 490 ] 491 { 492 haskell.packages.ghc912 = { 493 inherit 494 (packagePlatforms pkgs.pkgsCross.aarch64-android-prebuilt.pkgsStatic.haskell.packages.ghc912) 495 ghc 496 hello 497 microlens 498 ; 499 }; 500 }; 501 502 ghcjs = 503 removePlatforms 504 [ 505 # Hydra output size of 3GB is exceeded 506 "aarch64-linux" 507 ] 508 { 509 haskellPackages = { 510 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskellPackages) 511 ghc 512 hello 513 microlens 514 ; 515 }; 516 517 haskell.packages.ghc98 = { 518 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc98) 519 ghc 520 hello 521 microlens 522 ; 523 }; 524 525 haskell.packages.ghc912 = { 526 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc912) 527 ghc 528 hello 529 microlens 530 miso 531 reflex-dom 532 ; 533 }; 534 535 haskell.packages.ghcHEAD = { 536 inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD) 537 ghc 538 hello 539 microlens 540 ; 541 }; 542 }; 543 544 ucrt64.haskell.packages.ghc912 = { 545 inherit (packagePlatforms pkgs.pkgsCross.ucrt64.haskell.packages.ghc912) 546 ghc 547 # hello # executables don't build yet 548 microlens 549 ; 550 }; 551 552 riscv64 = { 553 # Cross compilation of GHC 554 haskell.compiler = { 555 inherit (packagePlatforms pkgs.pkgsCross.riscv64.haskell.compiler) 556 # Our oldest GHC which still uses its own expression. 8.10.7 can 557 # theoretically be used to chain bootstrap all GHCs on riscv64 558 # which doesn't have official bindists. 559 ghc8107 560 # Latest GHC we are able to cross-compile. 561 ghc948 562 ; 563 }; 564 }; 565 566 aarch64-multiplatform = { 567 # Cross compilation of GHC 568 haskell.compiler = { 569 inherit (packagePlatforms pkgs.pkgsCross.aarch64-multiplatform.haskell.compiler) 570 # Uses a separate expression and LLVM backend for aarch64. 571 ghc8107 572 # Latest GHC we are able to cross-compile. Uses NCG backend. 573 ghc948 574 ; 575 }; 576 }; 577 }; 578 }) 579 (versionedCompilerJobs { 580 # Packages which should be checked on more than the 581 # default GHC version. This list can be used to test 582 # the state of the package set with newer compilers 583 # and to confirm that critical packages for the 584 # package sets (like Cabal, jailbreak-cabal) are 585 # working as expected. 586 cabal-install = lib.subtractLists [ 587 # It is recommended to use pkgs.cabal-install instead of cabal-install 588 # from the package sets. Due to (transitively) requiring recent versions 589 # of core packages, it is not always reasonable to get cabal-install to 590 # work with older compilers. 591 compilerNames.ghc8107 592 compilerNames.ghc902 593 compilerNames.ghc928 594 compilerNames.ghc947 595 compilerNames.ghc948 596 ] released; 597 Cabal_3_10_3_0 = lib.subtractLists [ 598 # time < 1.13 conflicts with time == 1.14.* 599 compilerNames.ghc9121 600 compilerNames.ghc9122 601 ] released; 602 Cabal_3_12_1_0 = released; 603 Cabal_3_14_2_0 = released; 604 cabal2nix = released; 605 cabal2nix-unstable = released; 606 funcmp = released; 607 git-annex = [ 608 # for 9.10, test that using filepath (instead of filepath-bytestring) works. 609 compilerNames.ghc9101 610 compilerNames.ghc9102 611 ]; 612 haskell-language-server = lib.subtractLists [ 613 # Support ceased as of 2.3.0.0 614 compilerNames.ghc8107 615 # Support ceased as of 2.5.0.0 616 compilerNames.ghc902 617 # Support ceased as of 2.10.0.0 618 compilerNames.ghc928 619 ] released; 620 hoogle = released; 621 hlint = lib.subtractLists [ 622 compilerNames.ghc902 623 compilerNames.ghc9101 624 compilerNames.ghc9102 625 compilerNames.ghc9122 626 ] released; 627 hpack = released; 628 hsdns = released; 629 jailbreak-cabal = released; 630 language-nix = released; 631 nix-paths = released; 632 titlecase = released; 633 ghc-api-compat = [ 634 compilerNames.ghc8107 635 compilerNames.ghc902 636 ]; 637 ghc-bignum = [ 638 compilerNames.ghc8107 639 ]; 640 ghc-lib = released; 641 ghc-lib-parser = released; 642 ghc-lib-parser-ex = released; 643 ghc-source-gen = lib.subtractLists [ 644 compilerNames.ghc9122 645 ] released; 646 ghc-tags = lib.subtractLists [ 647 compilerNames.ghc9122 648 ] released; 649 hashable = released; 650 primitive = released; 651 semaphore-compat = [ 652 # Compiler < 9.8 don't have the semaphore-compat core package, but 653 # requires unix >= 2.8.1.0 which implies GHC >= 9.6 for us. 654 compilerNames.ghc966 655 ]; 656 weeder = lib.subtractLists [ 657 compilerNames.ghc9101 658 compilerNames.ghc9102 659 compilerNames.ghc9122 660 ] released; 661 }) 662 { 663 mergeable = pkgs.releaseTools.aggregate { 664 name = "haskell-updates-mergeable"; 665 meta = { 666 description = '' 667 Critical haskell packages that should work at all times, 668 serves as minimum requirement for an update merge 669 ''; 670 teams = [ lib.teams.haskell ]; 671 }; 672 constituents = accumulateDerivations [ 673 # haskell specific tests 674 jobs.tests.haskell 675 # important top-level packages 676 jobs.cabal-install 677 jobs.cabal2nix 678 jobs.cachix 679 jobs.darcs 680 jobs.haskell-language-server 681 jobs.hledger 682 jobs.hledger-ui 683 jobs.hpack 684 jobs.niv 685 jobs.pandoc 686 jobs.stack 687 jobs.stylish-haskell 688 jobs.shellcheck 689 # important haskell (library) packages 690 jobs.haskellPackages.cabal-plan 691 jobs.haskellPackages.distribution-nixpkgs 692 jobs.haskellPackages.hackage-db 693 jobs.haskellPackages.xmonad 694 jobs.haskellPackages.xmonad-contrib 695 # haskell packages maintained by @peti 696 # imported from the old hydra jobset 697 jobs.haskellPackages.hopenssl 698 jobs.haskellPackages.hsemail 699 jobs.haskellPackages.hsyslog 700 ]; 701 }; 702 maintained = pkgs.releaseTools.aggregate { 703 name = "maintained-haskell-packages"; 704 meta = { 705 description = "Aggregate jobset of all haskell packages with a maintainer"; 706 teams = [ lib.teams.haskell ]; 707 }; 708 constituents = accumulateDerivations ( 709 builtins.map (name: jobs.haskellPackages."${name}") (maintainedPkgNames pkgs.haskellPackages) 710 ); 711 }; 712 713 muslGHCs = pkgs.releaseTools.aggregate { 714 name = "haskell-pkgsMusl-ghcs"; 715 meta = { 716 description = "GHCs built with musl"; 717 maintainers = with lib.maintainers; [ 718 nh2 719 ]; 720 }; 721 constituents = accumulateDerivations [ 722 jobs.pkgsMusl.haskell.compiler.ghc8107Binary 723 jobs.pkgsMusl.haskell.compiler.ghc8107 724 jobs.pkgsMusl.haskell.compiler.ghc902 725 jobs.pkgsMusl.haskell.compiler.ghc928 726 jobs.pkgsMusl.haskell.compiler.ghcHEAD 727 jobs.pkgsMusl.haskell.compiler.integer-simple.ghc8107 728 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc902 729 jobs.pkgsMusl.haskell.compiler.native-bignum.ghc928 730 jobs.pkgsMusl.haskell.compiler.native-bignum.ghcHEAD 731 ]; 732 }; 733 734 staticHaskellPackages = pkgs.releaseTools.aggregate { 735 name = "static-haskell-packages"; 736 meta = { 737 description = "Static haskell builds using the pkgsStatic infrastructure"; 738 maintainers = [ 739 lib.maintainers.sternenseemann 740 lib.maintainers.rnhmjoj 741 ]; 742 }; 743 constituents = accumulateDerivations [ 744 jobs.pkgsStatic.haskell.packages.native-bignum.ghc948 # non-hadrian 745 jobs.pkgsStatic.haskellPackages 746 jobs.pkgsStatic.haskell.packages.native-bignum.ghc984 747 ]; 748 }; 749 } 750 ]; 751 752in 753jobs