This commit replaces the musl + glibc hackery in the GHC bindist
compiler by using the new musl based bindist that GHC HQ provides
(built on Alpine).
We could alternatively also use a nix-built musl boostrap compiler,
but it seems nicer to use the GHC HQ one for now.
This fixes the compiler built by
`pkgsMusl.haskell.compiler.ghc8102Binary` segfaulting (#118731)
since the commit
5e2311d2f - musl: 1.2.1 -> 1.2.2
concretely, musl commit
01c7920f - remove redundant pthread struct members repeated for layout purposes
which I suspect breaks some glibc/musl ABI compatibility that may have
existed accidentally until then.
The added
lib.optional stdenv.targetPlatform.isMusl "pie";
also fixes that the packaged bindist compiler cannot create a binary
in its `installCheck` phase (and overall); see detail explanation
in #129247.
With this check, we no longer don't notice when the upstream bindist
changes its dependencies (e.g. because a newer Debian version is used
that uses a new `ncurses` version).
The library override that was present in the code referred to a
name that isn't even used in current GHC bindists.
Tested with:
NIX_PATH=nixpkgs=. nix-build --no-link -A haskell.compiler.ghc8102Binary --argstr system i686-linux
The tarball download URLs seem to have changed, so we adjust them in
case anyone wants to reproduce the source of ghc8102Binary and
ghc865Binary.
Tested for x86_64-linux, i686-linux, aarch64-linux, x86_64-darwin.
Resolves#121804.
Fixes:
utils/ghc-cabal/dist-install/build/tmp/ghc-cabal:
error while loading shared libraries: libnuma.so.1:
cannot open shared object file: No such file or directory