|
32 | 32 | ])."${approach}",
|
33 | 33 |
|
34 | 34 | # When changing this, also change the default version of Cabal declared below
|
35 |
| - compiler ? "ghc864", |
| 35 | + compiler ? "ghc865", |
36 | 36 |
|
37 | 37 | defaultCabalPackageVersionComingWithGhc ?
|
38 | 38 | ({
|
39 | 39 | ghc822 = "Cabal_2_2_0_1"; # TODO this is technically incorrect for ghc 8.2.2, should be 2.0.1.0, but nixpkgs doesn't have that
|
40 | 40 | ghc844 = "Cabal_2_2_0_1";
|
41 | 41 | ghc863 = throw "static-haskell-nix: ghc863 is no longer supported, please upgrade";
|
42 |
| - ghc864 = "Cabal_2_4_1_0"; # TODO this is technically incorrect for ghc 8.6.4, should be 2.4.0.1, but nixpkgs doesn't have that |
| 42 | + ghc864 = throw "static-haskell-nix: ghc863 is no longer supported, please upgrade"; |
43 | 43 | ghc865 = "Cabal_2_4_1_0"; # TODO this is technically incorrect for ghc 8.6.5, should be 2.4.0.1, but nixpkgs doesn't have that
|
| 44 | + ghc881 = "Cabal_3_0_0_0"; |
44 | 45 | }."${compiler}"),
|
45 | 46 |
|
46 | 47 | # Use `integer-simple` instead of `integer-gmp` to avoid linking in
|
@@ -338,53 +339,57 @@ let
|
338 | 339 | # (we include them conditionally here anyway, for the case
|
339 | 340 | # that the user specifies a different Cabal version e.g. via
|
340 | 341 | # `stack2nix`):
|
341 |
| - (builtins.concatLists [ |
342 |
| - # -L flag deduplication |
343 |
| - # https://github.com/haskell/cabal/pull/5356 |
344 |
| - (lib.optional (pkgs.lib.versionOlder cabalDrv.version "2.4.0.0") (makeCabalPatch { |
345 |
| - name = "5356.patch"; |
346 |
| - url = "https://github.com/haskell/cabal/commit/fd6ff29e268063f8a5135b06aed35856b87dd991.patch"; |
347 |
| - sha256 = "1l5zwrbdrra789c2sppvdrw3b8jq241fgavb8lnvlaqq7sagzd1r"; |
348 |
| - })) |
349 |
| - # Patches that as of writing aren't merged yet: |
350 |
| - ]) ++ [ |
351 |
| - # TODO Move this into the above section when merged in some Cabal version: |
352 |
| - # --enable-executable-static |
353 |
| - # https://github.com/haskell/cabal/pull/5446 |
354 |
| - (if pkgs.lib.versionOlder cabalDrv.version "2.4.0.0" |
355 |
| - then |
356 |
| - # Older cabal, from https://github.com/nh2/cabal/commits/dedupe-more-include-and-linker-flags-enable-static-executables-flag-pass-ld-options-to-ghc-Cabal-v2.2.0.1 |
357 |
| - (makeCabalPatch { |
358 |
| - name = "5446.patch"; |
359 |
| - url = "https://github.com/haskell/cabal/commit/748f07b50724f2618798d200894f387020afc300.patch"; |
360 |
| - sha256 = "1zmbalkdbd1xyf0kw5js74bpifhzhm16c98kn7kkgrwql1pbdyp5"; |
361 |
| - }) |
362 |
| - else |
363 |
| - (makeCabalPatch { |
364 |
| - name = "5446.patch"; |
365 |
| - url = "https://github.com/haskell/cabal/commit/cb221c23c274f79dcab65aef3756377af113ae21.patch"; |
366 |
| - sha256 = "02qalj5y35lq22f19sz3c18syym53d6bdqzbnx9f6z3m7xg591p1"; |
367 |
| - }) |
368 |
| - ) |
369 |
| - # TODO Move this into the above section when merged in some Cabal version: |
370 |
| - # ld-option passthrough |
371 |
| - # https://github.com/haskell/cabal/pull/5451 |
372 |
| - (if pkgs.lib.versionOlder cabalDrv.version "2.4.0.0" |
373 |
| - then |
374 |
| - # Older cabal, from https://github.com/nh2/cabal/commits/dedupe-more-include-and-linker-flags-enable-static-executables-flag-pass-ld-options-to-ghc-Cabal-v2.2.0.1 |
375 |
| - (makeCabalPatch { |
376 |
| - name = "5451.patch"; |
377 |
| - url = "https://github.com/haskell/cabal/commit/b66be72db3b34ea63144b45fcaf61822e0fade87.patch"; |
378 |
| - sha256 = "0hndkfb96ry925xzx85km8y8pfv5ka5jz3jvy3m4l23jsrsd06c9"; |
379 |
| - }) |
380 |
| - else |
381 |
| - (makeCabalPatch { |
382 |
| - name = "5451.patch"; |
383 |
| - url = "https://github.com/haskell/cabal/commit/0aeb541393c0fce6099ea7b0366c956e18937791.patch"; |
384 |
| - sha256 = "0pa9r79730n1kah8x54jrd6zraahri21jahasn7k4ng30rnnidgz"; |
385 |
| - }) |
386 |
| - ) |
387 |
| - ]; |
| 342 | + if pkgs.lib.versionOlder cabalDrv.version "3.0.0.0" |
| 343 | + then |
| 344 | + (builtins.concatLists [ |
| 345 | + # -L flag deduplication |
| 346 | + # https://github.com/haskell/cabal/pull/5356 |
| 347 | + (lib.optional (pkgs.lib.versionOlder cabalDrv.version "2.4.0.0") (makeCabalPatch { |
| 348 | + name = "5356.patch"; |
| 349 | + url = "https://github.com/haskell/cabal/commit/fd6ff29e268063f8a5135b06aed35856b87dd991.patch"; |
| 350 | + sha256 = "1l5zwrbdrra789c2sppvdrw3b8jq241fgavb8lnvlaqq7sagzd1r"; |
| 351 | + })) |
| 352 | + # Patches that as of writing aren't merged yet: |
| 353 | + ]) ++ [ |
| 354 | + # TODO Move this into the above section when merged in some Cabal version: |
| 355 | + # --enable-executable-static |
| 356 | + # https://github.com/haskell/cabal/pull/5446 |
| 357 | + (if pkgs.lib.versionOlder cabalDrv.version "2.4.0.0" |
| 358 | + then |
| 359 | + # Older cabal, from https://github.com/nh2/cabal/commits/dedupe-more-include-and-linker-flags-enable-static-executables-flag-pass-ld-options-to-ghc-Cabal-v2.2.0.1 |
| 360 | + (makeCabalPatch { |
| 361 | + name = "5446.patch"; |
| 362 | + url = "https://github.com/haskell/cabal/commit/748f07b50724f2618798d200894f387020afc300.patch"; |
| 363 | + sha256 = "1zmbalkdbd1xyf0kw5js74bpifhzhm16c98kn7kkgrwql1pbdyp5"; |
| 364 | + }) |
| 365 | + else |
| 366 | + (makeCabalPatch { |
| 367 | + name = "5446.patch"; |
| 368 | + url = "https://github.com/haskell/cabal/commit/cb221c23c274f79dcab65aef3756377af113ae21.patch"; |
| 369 | + sha256 = "02qalj5y35lq22f19sz3c18syym53d6bdqzbnx9f6z3m7xg591p1"; |
| 370 | + }) |
| 371 | + ) |
| 372 | + # TODO Move this into the above section when merged in some Cabal version: |
| 373 | + # ld-option passthrough |
| 374 | + # https://github.com/haskell/cabal/pull/5451 |
| 375 | + (if pkgs.lib.versionOlder cabalDrv.version "2.4.0.0" |
| 376 | + then |
| 377 | + # Older cabal, from https://github.com/nh2/cabal/commits/dedupe-more-include-and-linker-flags-enable-static-executables-flag-pass-ld-options-to-ghc-Cabal-v2.2.0.1 |
| 378 | + (makeCabalPatch { |
| 379 | + name = "5451.patch"; |
| 380 | + url = "https://github.com/haskell/cabal/commit/b66be72db3b34ea63144b45fcaf61822e0fade87.patch"; |
| 381 | + sha256 = "0hndkfb96ry925xzx85km8y8pfv5ka5jz3jvy3m4l23jsrsd06c9"; |
| 382 | + }) |
| 383 | + else |
| 384 | + (makeCabalPatch { |
| 385 | + name = "5451.patch"; |
| 386 | + url = "https://github.com/haskell/cabal/commit/0aeb541393c0fce6099ea7b0366c956e18937791.patch"; |
| 387 | + sha256 = "0pa9r79730n1kah8x54jrd6zraahri21jahasn7k4ng30rnnidgz"; |
| 388 | + }) |
| 389 | + ) |
| 390 | + ] |
| 391 | + # cabal >= 3.0.0.0 currently needs no patches. |
| 392 | + else []; |
388 | 393 | });
|
389 | 394 |
|
390 | 395 | useFixedCabal =
|
|
460 | 465 |
|
461 | 466 | # Takes a curl derivation and overrides it to have both .a and .so files,
|
462 | 467 | # and have the `curl` executable be statically linked.
|
463 |
| - statify_curl_including_exe = curl_drv: |
| 468 | + statify_curl_including_exe = curl_drv: zlib_both: |
464 | 469 | (curl_drv.override (old: {
|
465 | 470 | # Disable gss support, because that requires `krb5`, which
|
466 | 471 | # (as mentioned in note [krb5 can only be static XOR shared]) is a
|
|
469 | 474 | # dynamically-linked `curl` binary from the overlay
|
470 | 475 | # `archiveFilesOverlay` below where `statify_curl_including_exe` is used.
|
471 | 476 | gssSupport = false;
|
472 |
| - zlib = statify_zlib old.zlib; |
| 477 | + zlib = zlib_both; |
473 | 478 | })).overrideAttrs (old: {
|
474 | 479 | dontDisableStatic = true;
|
475 | 480 |
|
|
562 | 567 | zlib_both = statify_zlib previous.zlib;
|
563 | 568 | # Also override the original packages with a throw (which as of writing
|
564 | 569 | # has no effect) so we can know when the bug gets fixed in the future.
|
565 |
| - acl = issue_61682_throw "acl" previous.acl; |
566 |
| - attr = issue_61682_throw "attr" previous.attr; |
567 |
| - bash = issue_61682_throw "bash" previous.bash; |
568 |
| - coreutils = issue_61682_throw "coreutils" previous.coreutils; |
569 |
| - diffutils = issue_61682_throw "diffutils" previous.diffutils; |
570 |
| - findutils = issue_61682_throw "findutils" previous.findutils; |
571 |
| - gawk = issue_61682_throw "gawk" previous.gawk; |
572 |
| - gnugrep = issue_61682_throw "gnugrep" previous.gnugrep; |
573 |
| - gnumake = issue_61682_throw "gnumake" previous.gnumake; |
574 |
| - gnupatch = issue_61682_throw "gnupatch" previous.gnupatch; |
575 |
| - gnused = issue_61682_throw "gnused" previous.gnused; |
576 |
| - gnutar = issue_61682_throw "gnutar" previous.gnutar; |
577 |
| - gzip = issue_61682_throw "gzip" previous.gzip; |
578 |
| - patchelf = issue_61682_throw "patchelf" previous.patchelf; |
579 |
| - xz = issue_61682_throw "xz" previous.xz; |
| 570 | + # [previously there were overrides here, but they stopped working, read below] |
580 | 571 | # For unknown reason we can't do this check on `zlib`, because if we do, we get:
|
581 | 572 | #
|
582 | 573 | # while evaluating the attribute 'zlib_static' at /home/niklas/src/haskell/static-haskell-nix/survey/default.nix:498:5:
|
|
591 | 582 | # https://github.com/nh2/static-haskell-nix/issues/47.
|
592 | 583 | #bzip2 = issue_61682_throw "bzip2" previous.bzip2;
|
593 | 584 | #pcre = issue_61682_throw "pcre" previous.pcre;
|
| 585 | + # Since the update to nixpkgs master for #61 also for these, |
| 586 | + # see https://github.com/NixOS/nixpkgs/issues/61682#issuecomment-544215621 |
| 587 | + #acl = issue_61682_throw "acl" previous.acl; |
| 588 | + #attr = issue_61682_throw "attr" previous.attr; |
| 589 | + #bash = issue_61682_throw "bash" previous.bash; |
| 590 | + #coreutils = issue_61682_throw "coreutils" previous.coreutils; |
| 591 | + #diffutils = issue_61682_throw "diffutils" previous.diffutils; |
| 592 | + #findutils = issue_61682_throw "findutils" previous.findutils; |
| 593 | + #gawk = issue_61682_throw "gawk" previous.gawk; |
| 594 | + #gnugrep = issue_61682_throw "gnugrep" previous.gnugrep; |
| 595 | + #gnumake = issue_61682_throw "gnumake" previous.gnumake; |
| 596 | + #gnupatch = issue_61682_throw "gnupatch" previous.gnupatch; |
| 597 | + #gnused = issue_61682_throw "gnused" previous.gnused; |
| 598 | + #gnutar = issue_61682_throw "gnutar" previous.gnutar; |
| 599 | + #gzip = issue_61682_throw "gzip" previous.gzip; |
| 600 | + #patchelf = issue_61682_throw "patchelf" previous.patchelf; |
| 601 | + #xz = issue_61682_throw "xz" previous.xz; |
594 | 602 |
|
595 | 603 | postgresql = (previous.postgresql.overrideAttrs (old: { dontDisableStatic = true; })).override {
|
596 | 604 | # We need libpq, which does not need systemd,
|
|
652 | 660 | };
|
653 | 661 |
|
654 | 662 | # See comments on `statify_curl_including_exe` for the interaction with krb5!
|
655 |
| - curl = statify_curl_including_exe previous.curl; |
| 663 | + # As mentioned in [Packages that can't be overridden by overlays], we can't |
| 664 | + # override zlib to have static libs, so we have to pass in `zlib_both` explicitly |
| 665 | + # so that `curl` can use it. |
| 666 | + curl = statify_curl_including_exe previous.curl final.zlib_both; |
| 667 | + |
| 668 | + # `fetchurl` uses our overridden `curl` above, but `fetchurl` overrides |
| 669 | + # `zlib` in `curl`, see |
| 670 | + # https://github.com/NixOS/nixpkgs/blob/4a5c0e029ddbe89aa4eb4da7949219fe4e3f8472/pkgs/top-level/all-packages.nix#L296-L299 |
| 671 | + # so because of [Packages that can't be overridden by overlays], |
| 672 | + # it will undo our `zlib` override in `curl` done above (for `curl` |
| 673 | + # use via `fetchurl`). |
| 674 | + # So we need to explicitly put our zlib into that one's curl here. |
| 675 | + fetchurl = previous.fetchurl.override (old: { |
| 676 | + # Can't use `zlib_both` here (infinite recursion), so we |
| 677 | + # re-`statify_zlib` `final.zlib` here (interesting that |
| 678 | + # `previous.zlib` also leads to infinite recursion at time of writing). |
| 679 | + curl = old.curl.override { zlib = statify_zlib final.zlib; }; |
| 680 | + }); |
656 | 681 |
|
| 682 | + R = (previous.R.override { |
| 683 | + # R supports EITHER static or shared libs. |
| 684 | + static = true; |
| 685 | + # The Haskell package `H` depends on R, which pulls in OpenJDK, |
| 686 | + # which is not patched for musl support yet in nixpkgs. |
| 687 | + # Disable Java support for now. |
| 688 | + javaSupport = false; |
| 689 | + }).overrideAttrs (old: { |
| 690 | + # Testsuite newly seems to have at least one segfaulting test case. |
| 691 | + # Disable test suite for now; Alpine also does it: |
| 692 | + # https://git.alpinelinux.org/aports/tree/community/R/APKBUILD?id=e2bce14c748aacb867713cb81a91fad6e8e7f7f6#n56 |
| 693 | + doCheck = false; |
| 694 | + }); |
657 | 695 | };
|
658 | 696 |
|
659 | 697 |
|
|
945 | 983 | ];
|
946 | 984 | }))).override { openblasCompat = final.openblasCompat; };
|
947 | 985 |
|
| 986 | + # Test suite segfaults (perhaps because R's test suite also does?). |
| 987 | + inline-r = dontCheck super.inline-r; |
| 988 | + |
948 | 989 | # TODO For the below packages, it would be better if we could somehow make all users
|
949 | 990 | # of postgresql-libpq link in openssl via pkgconfig.
|
| 991 | + pg-harness-server = |
| 992 | + addStaticLinkerFlagsWithPkgconfig |
| 993 | + super.pg-harness-server |
| 994 | + [ final.openssl final.postgresql ] |
| 995 | + "--libs libpq"; |
| 996 | + postgresql-orm = |
| 997 | + addStaticLinkerFlagsWithPkgconfig |
| 998 | + super.postgresql-orm |
| 999 | + [ final.openssl final.postgresql ] |
| 1000 | + "--libs libpq"; |
950 | 1001 | postgresql-schema =
|
951 | 1002 | addStaticLinkerFlagsWithPkgconfig
|
952 | 1003 | super.postgresql-schema
|
@@ -1052,13 +1103,20 @@ let
|
1052 | 1103 | then disableCabalFlag super.cryptonite "integer-gmp"
|
1053 | 1104 | else super.cryptonite;
|
1054 | 1105 |
|
1055 |
| - # The test-suite `test-scientific`'s loops forver on 100% CPU with integer-simple |
| 1106 | + # The test-suite of this package loops forever on 100% CPU (at least on `-O0`). |
| 1107 | + bench-show = dontCheck super.bench-show; |
| 1108 | + # The test-suite of this package loops forever on 100% CPU (at least on `-O0`). |
| 1109 | + # TODO Investigate that because `loop` is nh2's own package. |
| 1110 | + loop = dontCheck super.loop; |
| 1111 | + # The test-suite of this package loops forever on 100% CPU (at least on `-O0`). |
| 1112 | + matrix = dontCheck super.matrix; |
| 1113 | + # The test-suite of this package loops forever on 100% CPU (at least on `-O0`). |
1056 | 1114 | # TODO Ask Bas about it
|
1057 | 1115 | scientific =
|
1058 | 1116 | if integer-simple
|
1059 | 1117 | then dontCheck super.scientific
|
1060 | 1118 | else super.scientific;
|
1061 |
| - # The test-suite `test-x509-validation`'s loops forver on 100% CPU with integer-simple |
| 1119 | + # The test-suite of this package loops forever on 100% CPU (at least on `-O0`). |
1062 | 1120 | x509-validation =
|
1063 | 1121 | if integer-simple
|
1064 | 1122 | then dontCheck super.x509-validation
|
|
1137 | 1195 | # There's probably a lack of dead-code elimination with `pkgsStatic`,
|
1138 | 1196 | # but even if that worked, this is odd because this should work even
|
1139 | 1197 | # when you *use* the `binDir` thing in your executable.
|
1140 |
| - cachix |
| 1198 | + # cachix # fails on latest nixpkgs master due to cachix -> nix -> pkgsStatic.busybox dependency, see https://github.com/nh2/static-haskell-nix/pull/61#issuecomment-544331652 |
1141 | 1199 | # darcs fails on `pkgsStatic` because
|
1142 | 1200 | darcs # Has native dependencies (`libcurl` and its dependencies)
|
1143 | 1201 | # pandoc fails on `pkgsStatic` because Lua doesn't currently build there.
|
|
1176 | 1234 | "ersatz"
|
1177 | 1235 | "gloss-examples" # needs opengl
|
1178 | 1236 | "gtk3" # problem compiling `glib` dependency with `Distribution.Simple.UserHooks.UserHooks` type mismatch across Cabal versions; should go away once we no longer have to patch Cabal
|
| 1237 | + "H" # `zgemm_: symbol not found` when compiling Main; not clear how that can be provided |
1179 | 1238 | "hamilton" # openmp linker error via openblas
|
1180 | 1239 | "hquantlib"
|
1181 | 1240 | "ihaskell"
|
|
1187 | 1246 | "odbc" # undeclared `<odbcss.h>` dependency
|
1188 | 1247 | "OpenAL" # transitively depends on `systemd`, which doesn't build with musl
|
1189 | 1248 | "qchas" # openmp linker error via openblas
|
| 1249 | + "rhine-gloss" # needs opengl |
1190 | 1250 | "sdl2" # transitively depends on `systemd`, which doesn't build with musl
|
1191 | 1251 | "sdl2-gfx" # see `sdl2`
|
1192 | 1252 | "sdl2-image" # see `sdl2`
|
|
0 commit comments