-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgsMusl.haskell.compiler.ghc8107Binary: Remove now-incorrect gmp dependency #138523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ let | |
}; | ||
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2"; | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
# The i686-linux bindist provided by GHC HQ is currently built on Debian 9, | ||
# which link it against `libtinfo.so.5` (ncurses 5). | ||
# Other bindists are linked `libtinfo.so.6` (ncurses 6). | ||
|
@@ -60,6 +61,7 @@ let | |
}; | ||
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2"; | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
{ nixPackage = ncurses6; fileToCheckFor = "libtinfo.so.6"; } | ||
]; | ||
}; | ||
|
@@ -70,6 +72,7 @@ let | |
}; | ||
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2"; | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
{ nixPackage = ncurses6; fileToCheckFor = "libtinfo.so.6"; } | ||
]; | ||
}; | ||
|
@@ -80,6 +83,7 @@ let | |
}; | ||
exePathForLibraryCheck = "ghc/stage2/build/tmp/ghc-stage2"; | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
{ nixPackage = ncurses6; fileToCheckFor = "libtinfo.so.6"; } | ||
{ nixPackage = numactl; fileToCheckFor = null; } | ||
]; | ||
|
@@ -91,6 +95,7 @@ let | |
}; | ||
exePathForLibraryCheck = null; # we don't have a library check for darwin yet | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
{ nixPackage = ncurses6; fileToCheckFor = null; } | ||
{ nixPackage = libiconv; fileToCheckFor = null; } | ||
]; | ||
|
@@ -102,6 +107,7 @@ let | |
}; | ||
exePathForLibraryCheck = null; # we don't have a library check for darwin yet | ||
archSpecificLibraries = [ | ||
{ nixPackage = gmp; fileToCheckFor = null; } | ||
{ nixPackage = ncurses6; fileToCheckFor = null; } | ||
{ nixPackage = libiconv; fileToCheckFor = null; } | ||
]; | ||
|
@@ -116,6 +122,8 @@ let | |
}; | ||
exePathForLibraryCheck = "bin/ghc"; | ||
archSpecificLibraries = [ | ||
# No `gmp` here, since this is an `integer-simple` bindist. | ||
|
||
# In contrast to glibc builds, the musl-bindist uses `libncursesw.so.*` | ||
# instead of `libtinfo.so.*.` | ||
{ nixPackage = ncurses6; fileToCheckFor = "libncursesw.so.6"; } | ||
|
@@ -133,11 +141,8 @@ let | |
|
||
libPath = | ||
lib.makeLibraryPath ( | ||
[ | ||
gmp | ||
] | ||
# Add arch-specific libraries. | ||
++ map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries | ||
map ({ nixPackage, ... }: nixPackage) binDistUsed.archSpecificLibraries | ||
); | ||
|
||
libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" | ||
|
@@ -152,21 +157,21 @@ stdenv.mkDerivation rec { | |
|
||
src = fetchurl binDistUsed.src; | ||
|
||
# Note that for GHC 8.10 versions >= 8.10.6, the GHC HQ musl bindist | ||
# uses `integer-simple` and has no `gmp` dependency: | ||
# https://gitlab.haskell.org/ghc/ghc/-/commit/8306501020cd66f683ad9c215fa8e16c2d62357d | ||
# Related nixpkgs issues: | ||
# * https://github.com/NixOS/nixpkgs/pull/130441#issuecomment-922452843 | ||
# TODO: When this file is copied to `ghc-9.*-binary.nix`, determine whether | ||
# the GHC 9 branch also switched from `gmp` to `integer-simple` via the | ||
# currently-open issue: | ||
# https://gitlab.haskell.org/ghc/ghc/-/issues/20059 | ||
# and update this comment accordingly. | ||
|
||
nativeBuildInputs = [ perl ]; | ||
propagatedBuildInputs = | ||
lib.optionals useLLVM [ llvmPackages.llvm ] | ||
# Because musl bindists currently provide no way to tell where | ||
# libgmp is (see not [musl bindists have no .buildinfo]), we need | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the comment on musl bindists have no .buildinfo further down removed here as well (or clarified wrt musl)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I have fixed the dangling reference. |
||
# to propagate `gmp`, otherwise programs built by this ghc will | ||
# fail linking with `cannot find -lgmp` errors. | ||
# Also, as of writing, the release pages of musl bindists claim | ||
# that they use `integer-simple` and do not require `gmp`; however | ||
# that is incorrect, so `gmp` is required until a release has been | ||
# made that includes https://gitlab.haskell.org/ghc/ghc/-/issues/20059. | ||
# (Note that for packaging the `-binary` compiler, nixpkgs does not care | ||
# about whether or not `gmp` is used; this comment is just here to explain | ||
# why the `gmp` dependency exists despite what the release page says.) | ||
++ lib.optionals stdenv.hostPlatform.isMusl [ gmp ]; # musl bindist needs this | ||
; | ||
|
||
# Set LD_LIBRARY_PATH or equivalent so that the programs running as part | ||
# of the bindist installer can find the libraries they expect. | ||
|
@@ -227,9 +232,9 @@ stdenv.mkDerivation rec { | |
patchShebangs ghc-${version}/configure | ||
'' + | ||
# We have to patch the GMP paths for the integer-gmp package. | ||
# Note [musl bindists have no .buildinfo] | ||
# Note that musl bindists do not contain them; unclear if that's intended; | ||
# Note that musl bindists do not contain them, | ||
# see: https://gitlab.haskell.org/ghc/ghc/-/issues/20073#note_363231 | ||
# However, musl bindists >= 8.10.6 use `integer-simple`, not `gmp`. | ||
'' | ||
find . -name integer-gmp.buildinfo \ | ||
-exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sentence is missing a word.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.