diff options
author | Dennis Gosnell <cdep.illabout@gmail.com> | 2021-07-24 21:15:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 21:15:44 +0900 |
commit | 0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5 (patch) | |
tree | ff986c64ea593420d0cf49fcb37be9e6f9ca4350 | |
parent | 05b69d83daafb043d8fd193b61af3f9290174146 (diff) | |
parent | 95cd2f7a1f7cedaf4fe9b64a9fca8c10afae75b2 (diff) | |
download | nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar.gz nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar.bz2 nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar.lz nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar.xz nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.tar.zst nixpkgs-0783d5d3b7a9a8cae8404d92b9dd8828e49aefd5.zip |
Merge pull request #130441 from cdepillabout/figure-out-ghc-integer-simple
ghc: mark broken for musl + integer-simple builds
-rw-r--r-- | pkgs/development/compilers/ghc/8.10.4.nix | 4 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.8.4.nix | 4 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/9.0.1.nix | 4 | ||||
-rw-r--r-- | pkgs/top-level/release-haskell.nix | 161 |
4 files changed, 128 insertions, 45 deletions
diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.4.nix index 10ca2f6662c..07784c42647 100644 --- a/pkgs/development/compilers/ghc/8.10.4.nix +++ b/pkgs/development/compilers/ghc/8.10.4.nix @@ -309,6 +309,10 @@ stdenv.mkDerivation (rec { maintainers = with lib.maintainers; [ marcweber andres peti ]; timeout = 24 * 3600; inherit (ghc.meta) license platforms; + + # integer-simple builds are broken when GHC links against musl. + # See https://github.com/NixOS/nixpkgs/pull/129606#issuecomment-881323743. + broken = enableIntegerSimple && hostPlatform.isMusl; }; } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt { diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 23826614716..bb2267c930d 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -319,6 +319,10 @@ stdenv.mkDerivation (rec { maintainers = with lib.maintainers; [ marcweber andres peti ]; timeout = 24 * 3600; inherit (ghc.meta) license platforms; + + # integer-simple builds are broken when GHC links against musl. + # See https://github.com/NixOS/nixpkgs/pull/129606#issuecomment-881323743. + broken = enableIntegerSimple && hostPlatform.isMusl; }; dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); diff --git a/pkgs/development/compilers/ghc/9.0.1.nix b/pkgs/development/compilers/ghc/9.0.1.nix index d2ae51c66de..30a7f7a4f40 100644 --- a/pkgs/development/compilers/ghc/9.0.1.nix +++ b/pkgs/development/compilers/ghc/9.0.1.nix @@ -296,6 +296,10 @@ stdenv.mkDerivation (rec { maintainers = with lib.maintainers; [ marcweber andres peti ]; timeout = 24 * 3600; inherit (ghc.meta) license platforms; + + # integer-simple builds are broken when GHC links against musl. + # See https://github.com/NixOS/nixpkgs/pull/129606#issuecomment-881323743. + broken = enableIntegerSimple && hostPlatform.isMusl; }; } // lib.optionalAttrs targetPlatform.useAndroidPrebuilt { diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 1dc728b2da2..5173ec6cb36 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -18,18 +18,22 @@ let }; inherit (releaseLib) - pkgs - packagePlatforms + lib mapTestOn - aggregate + packagePlatforms + pkgs ; - inherit (pkgs) lib; - - # helper function which traverses a (nested) set + # Helper function which traverses a (nested) set # of derivations produced by mapTestOn and flattens # it to a list of derivations suitable to be passed # to `releaseTools.aggregate` as constituents. + # Removes all non derivations from the input jobList. + # + # accumulateDerivations :: [ Either Derivation AttrSet ] -> [ Derivation ] + # + # > accumulateDerivations [ drv1 "string" { foo = drv2; bar = { baz = drv3; }; } ] + # [ drv1 drv2 drv3 ] accumulateDerivations = jobList: lib.concatMap ( attrs: @@ -81,8 +85,45 @@ let recursiveUpdateMany = builtins.foldl' lib.recursiveUpdate {}; - staticHaskellPackagesPlatforms = - packagePlatforms pkgs.pkgsStatic.haskell.packages.integer-simple.ghc8104; + # Remove multiple elements from a list at once. + # + # removeMany + # :: [a] -- list of elements to remove + # -> [a] -- list of elements from which to remove + # -> [a] + # + # > removeMany ["aarch64-linux" "x86_64-darwin"] ["aarch64-linux" "x86_64-darwin" "x86_64-linux"] + # ["x86_64-linux"] + removeMany = itemsToRemove: list: lib.foldr lib.remove list itemsToRemove; + + # Recursively remove platforms from the values in an attribute set. + # + # removePlatforms + # :: [String] + # -> AttrSet + # -> AttrSet + # + # > attrSet = { + # foo = ["aarch64-linux" "x86_64-darwin" "x86_64-linux"]; + # bar.baz = ["aarch64-linux" "x86_64-linux"]; + # bar.quux = ["aarch64-linux" "x86_64-darwin"]; + # } + # > removePlatforms ["aarch64-linux" "x86_64-darwin"] attrSet + # { + # foo = ["x86_64-linux"]; + # bar = { + # baz = ["x86_64-linux"]; + # quux = []; + # }; + # } + removePlatforms = platformsToRemove: packageSet: + lib.mapAttrsRecursive + (_: val: + if lib.isList val + then removeMany platformsToRemove val + else val + ) + packageSet; jobs = recursiveUpdateMany [ (mapTestOn { @@ -94,24 +135,6 @@ let nixosTests.agda = (packagePlatforms pkgs.nixosTests).agda; agdaPackages = packagePlatforms pkgs.agdaPackages; - pkgsMusl.haskell.compiler = packagePlatforms pkgs.pkgsMusl.haskell.compiler // { - # remove musl ghc865Binary since it is known to be broken and - # causes an evaluation error on darwin. - # TODO: remove ghc865Binary altogether and use ghc8102Binary - ghc865Binary = {}; - }; - - # test some statically linked packages to catch regressions - # and get some cache going for static compilation with GHC - # Use integer-simple to avoid GMP linking problems (LGPL) - pkgsStatic.haskell.packages.integer-simple.ghc8104 = { - inherit (staticHaskellPackagesPlatforms) - hello - random - lens - ; - }; - # top-level packages that depend on haskellPackages inherit (pkgsPlatforms) agda @@ -218,6 +241,56 @@ let ; elmPackages.elm = pkgsPlatforms.elmPackages.elm; + + # GHCs linked to musl. + pkgsMusl.haskell.compiler = packagePlatforms pkgs.pkgsMusl.haskell.compiler // { + # remove musl ghc865Binary since it is known to be broken and + # causes an evaluation error on darwin. + # TODO: remove ghc865Binary altogether and use ghc8102Binary + ghc865Binary = {}; + + # remove integer-simple because it appears to be broken with + # musl and non-static-linking. + integer-simple = {}; + }; + + # Get some cache going for MUSL-enabled GHC. + pkgsMusl.haskellPackages = + removePlatforms + [ + # pkgsMusl is compiled natively with musl. It is not + # cross-compiled (unlike pkgsStatic). We can only + # natively bootstrap GHC with musl on x86_64-linux because + # upstream doesn't provide a musl bindist for aarch64. + "aarch64-linux" + + # musl only supports linux, not darwin. + "x86_64-darwin" + ] + { + inherit (packagePlatforms pkgs.pkgsMusl.haskellPackages) + hello + lens + random + ; + }; + + # Test some statically linked packages to catch regressions + # and get some cache going for static compilation with GHC. + # Use integer-simple to avoid GMP linking problems (LGPL) + pkgsStatic.haskell.packages.integer-simple.ghc8104 = + removePlatforms + [ + "aarch64-linux" # times out on Hydra + "x86_64-darwin" # TODO: reenable when static libiconv works on darwin + ] + { + inherit (packagePlatforms pkgs.pkgsStatic.haskell.packages.integer-simple.ghc8104) + hello + lens + random + ; + }; }) (versionedCompilerJobs { # Packages which should be checked on more than the @@ -294,25 +367,7 @@ let (name: jobs.haskellPackages."${name}") (maintainedPkgNames pkgs.haskellPackages)); }; - staticHaskellPackages = pkgs.releaseTools.aggregate { - name = "static-haskell-packages"; - meta = { - description = "Static haskell builds using the pkgsStatic infrastructure"; - maintainers = [ - lib.maintainers.sternenseemann - lib.maintainers.rnhmjoj - ]; - }; - constituents = [ - # TODO: reenable darwin builds if static libiconv works - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.hello.x86_64-linux - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.hello.aarch64-linux - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.lens.x86_64-linux - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.lens.aarch64-linux - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.random.x86_64-linux - jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.random.aarch64-linux - ]; - }; + muslGHCs = pkgs.releaseTools.aggregate { name = "haskell-pkgsMusl-ghcs"; meta = { @@ -328,6 +383,22 @@ let jobs.pkgsMusl.haskell.compiler.ghc901 ]; }; + + staticHaskellPackages = pkgs.releaseTools.aggregate { + name = "static-haskell-packages"; + meta = { + description = "Static haskell builds using the pkgsStatic infrastructure"; + maintainers = [ + lib.maintainers.sternenseemann + lib.maintainers.rnhmjoj + ]; + }; + constituents = accumulateDerivations [ + jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.hello + jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.lens + jobs.pkgsStatic.haskell.packages.integer-simple.ghc8104.random + ]; + }; } ]; |