Commit Graph

780 Commits

Author SHA1 Message Date
sternenseemann
0908812372 haskell.compiler.*: check bintools.hasGold before enabling ld.gold 2021-08-18 01:21:44 +02:00
(cdep)illabout
be8d8a9efb
ghc: mark integer-simple builds as broken when hostplatform is musl 2021-07-24 21:13:02 +09:00
sternenseemann
54e1d5a3e6 haskell.compiler.ghc865Binary: mark as broken when built with musl
The musl support for binary GHC 8.6.5 relied on ABI compat between musl
and glibc which is no longer the case: https://github.com/NixOS/nixpkgs/issues/129247

Since there is no upstream musl (alpine) bindist for GHC 8.6.5, we can
only accept that binary 8.6.5 is not possible with musl.
2021-07-13 14:36:42 +02:00
Niklas Hambüchen
63b1e6e489 ghc*-binary: Remove no-op --with-gmp-libraries 2021-07-10 02:49:42 +02:00
Niklas Hambüchen
c6a77590e3 haskell.compiler.ghc8102Binary: Split ghcBinDists set into default and musl.
This allows to implement the "HACK" mentioned in the commit to
build `pkgsMusl` GHCs on Hydra without failing evaluation on Darwin.

Reference of the discussion:
https://github.com/NixOS/nixpkgs/pull/129289#discussion_r663956747

Patch contributed by @sterni.
2021-07-10 02:49:42 +02:00
Niklas Hambüchen
f4e62a996f pkgsMusl.haskell.compiler.ghc{8104,884,901,HEAD}: Disable sphinx for musl
Adds new package options:

* enableDocs
* enableHaddockProgram

to control whether to build Sphinx docs, and GHC haddocks and the
haddock program.

Unfortunately currently the building of the `haddock `program
and generating GHC docs are mixed into one option, see:
https://gitlab.haskell.org/ghc/ghc/-/issues/20077

Making Sphinx docs disableable, and disabling them by default
for Musl and cross builds, makes it much easier to provide these
builds without having to support Sphinx's enormous dependency
tree for those ways of building.
2021-07-10 02:49:42 +02:00
Niklas Hambüchen
8adcd39504 ghc: Add comments about hardeningDisable pie for musl 2021-07-10 02:49:42 +02:00
Niklas Hambüchen
8b15fccf8a pkgsMuslhaskell.compiler.{ghc884,ghc8104}: Use GHC 8.10 as bootstrap compiler.
This addresses the fact that `ghc865Binary` segfaults on musl
(see #118731) because of the glibc+musl mix used in there.

With the previous commits, `ghc8102Binary` was changed to use
the musl-based bindist from GHC HQ instead, which works.

With this change, all nix Haskell compilers builds on musl:

    NIX_PATH=nixpkgs=. nix-build --no-link --expr 'with import <nixpkgs> {}; { inherit (pkgsMusl.haskell.compiler) ghc884 ghc8104 ghc901 ghcHEAD; }'
2021-07-10 02:49:42 +02:00
Niklas Hambüchen
f154c3adde haskell.compiler.ghc865Binary: Disable "pie" hardening. See #129247
While this does not fix `ghc865Binary` with musl, it at least prevents
that the other, newer errors are shadowed (see #129247).
2021-07-10 02:49:42 +02:00
Niklas Hambüchen
c866b8a13b haskell.compiler.ghc8102Binary: find -executable -> -perm -0100 2021-07-10 02:49:42 +02:00
Niklas Hambüchen
da1cf8cb90 pkgsMusl.haskell.compiler.ghc8102Binary: Fix musl segfault. Fixes #118731 #129247.
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.
2021-07-10 02:49:41 +02:00
Niklas Hambüchen
5777bd3d56 haskell.compiler.ghc8102Binary: Remove sed of /usr/bin/* commands.
None of the current bindists appear to contain these paths in their
`ghc-stage2` binary.
2021-07-10 02:49:41 +02:00
Niklas Hambüchen
1326009806 haskell.compiler.ghc8102Binary: Add check for arch-specific libraries.
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).
2021-07-10 02:49:41 +02:00
Niklas Hambüchen
8a2de701f7 haskell.compiler.ghc8102Binary: Fix build on i686.
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
2021-07-05 16:38:24 +02:00
Niklas Hambüchen
67e8744ef8 ghc: Refactor: Extract ghcBinDists 2021-07-05 16:38:24 +02:00
Niklas Hambüchen
947f757bba haskell.packages.ghc8102Binary: Add comments 2021-07-05 16:38:24 +02:00
Niklas Hambüchen
8d11c1380a pkgsMusl.haskell.compiler.ghc901: Fix evaluation with musl
`glibcLocales` only exists when glibc is used.

Similar to commit:

    8727284a - haskell: only use glibcLocales when using glibc
2021-07-04 22:15:59 +00:00
sternenseemann
cd33c34578 haskell.compiler.ghc884: patch for sphinx >= 4.0
With sphinx 4, interpreting the conf.py fails due to a decode
error: https://gitlab.haskell.org/ghc/ghc/-/issues/19962
The fix is an one line change which we have to backport from GHC
master.

9.2 and 8.10.6 will have a fix for this, GHC 9.0.1 and ghcHEAD
already have and GHC 8.10.4 has been patched in nixpkgs already.
2021-06-22 13:42:55 +02:00
sternenseemann
a8c2421e5b haskell.compiler.ghc8104: patch for sphinx >= 4.0
With sphinx 4, interpreting the conf.py fails due to a decode
error: https://gitlab.haskell.org/ghc/ghc/-/issues/19962

The fix is an one line change which we have to backport from GHC master.
Thus ghcHEAD is not affected by this problem.

9.2 and 8.10.6 will most likely have a fix for this.

TODO: Patch 8.8.4 and 9.0.1
2021-06-22 13:42:55 +02:00
John Ericson
4f97d78936
Merge pull request #126205 from sternenseemann/ghc-linker-checks
ghc: check for targetPlatform.linker to determine if gold is available
2021-06-08 16:42:13 -04:00
sternenseemann
036eef1d1e haskell.compiler.*: use gold based on targetPlatform.linker
useLdGold previously just checked for useLLVM which (currently) implies
`linker == "lld"`. However more accurate is to check the `linker` of the
`targetPlatform` as it actually tells us which bintools package we can
expect.

`linker == "bfd"` implies that we are using the `binutils` package, so
gold is available, so we can use it unless musl is the libc. `linker ==
"gold"` implies that gold is the default linker already and we should
absolutely use it.
2021-06-08 22:17:24 +02:00
sternenseemann
118b28a127 haskell.compiler.*: pull in unwrapped bintools for darwin
GHC calls otool on darwin which is contained in the
stdenv.cc.bintools.bintools derivation and thus needs adding to the
runtime PATH of GHC. Since this is toolchain specific technically, we
check for cctools instead of darwin (although I don't know if GHC
or nixpkgs work on macOS without cctools).

This fixes usage of GHC in an environment where otool is not available
and more specifically in stdenvNoCC which is used by writers.writeHaskell.
Resolves #123228.
2021-06-08 14:20:09 +02:00
Guillaume Bouchard
81c8d158a8 ghc: add missing meta data
`haskellCompilerName` in cabal2nix and hence ghc 8.10.2 and 8.6.5
"-binary" were not working correctly in this context.
2021-06-01 12:46:55 +02:00
(cdep)illabout
721c8ab307
haskell.compiler.ghcHEAD: disable Hydra build on aarch64-linux 2021-05-19 10:30:23 +09:00
sternenseemann
f90244c970 haskell.compiler.ghcHEAD: disable DWARF on non x86
The broken build of ghcHEAD on aarch64-linux results from rts/Libdw.c
not supporting that platform. Seemingly this particular file is only
relevant for DWARF support in GHC, so we disable that on unsupported
platforms.
2021-05-17 17:22:47 +02:00
(cdep)illabout
d1de348fdc
haskell.compiler.ghcHEAD: mark broken on aarch64 2021-05-16 16:52:08 +09:00
sternenseemann
b4c069dc11 haskell.compiler.ghcHEAD: 8.11.20200824 -> 9.3.20210504 2021-05-08 13:03:55 +02:00
Silvan Mosberger
08d94fd2b0
Merge pull request #114374 from oxalica/lib/platform-support-check
lib.meta: introduce `availableOn` to check package availability on given platform
2021-05-08 03:54:36 +02:00
maralorn
8b7d34d89e
Merge pull request #122026 from sternenseemann/ghc-binary-no-aarch64-hydra
haskell.compiler: misc cleanups for hydra aarch64 builds
2021-05-07 20:15:44 +02:00
sternenseemann
355b55d00b ghc8102Binary, ghc865Binary: don't build aarch64 on hydra
Unfortunately these compiler's normal binary versions exceed the maximum
output size on hydra and thus can't be built on there.

See also https://gitlab.haskell.org/ghc/ghc/-/issues/17051
2021-05-07 15:09:08 +02:00
sternenseemann
952a2866a2 haskell.compiler.ghc*Binary: update source URLs
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.
2021-05-07 11:20:19 +02:00
oxalica
354d262db8
lib.meta: introduce availableOn 2021-04-02 19:20:23 +08:00
Peter Simons
021b8328ce ghc: drop obsolete compiler version 8.10.3 2021-03-12 21:23:15 +01:00
Peter Simons
822fc150a1 ghc: drop obsolete compiler version 8.10.2 2021-03-12 21:18:48 +01:00
Peter Simons
d0ac5c04e0 ghc: drop obsolete compiler version 8.10.1 2021-03-12 21:17:50 +01:00
Peter Simons
a7932e3f14 ghc: drop obsolete compiler version 8.8.3 2021-03-12 21:16:35 +01:00
Peter Simons
f189465dce ghc: drop obsolete compiler version 8.8.2 2021-03-12 21:16:09 +01:00
Peter Simons
0886f5bad8 ghc: drop unused binary compiler version 8.2.2 2021-03-12 21:10:19 +01:00
Peter Simons
cb4346597f ghc: drop obsolete version 8.6.5 2021-03-12 21:05:31 +01:00
(cdep)illabout
b0a16b29e2 haskell.compiler.ghc8104: add ghc-8.10.4 2021-02-12 20:35:21 +01:00
Peter Simons
0b626654ad ghc: update the 9.0.1 version to the official release tarball 2021-02-05 23:05:20 +01:00
Peter Simons
b1d2e3b10f ghc-8.10.3: don't use obsolete stdenv.lib
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-02-05 23:04:46 +01:00
Cheng Shao
643169bbb4 Fix ar command path in GHC.
Previously, the "ar command" in the global config of GHC in nixpkgs is
simply "ar" instead of a proper absolute path in the nix store. This
will result in an "ar: command not found" error when using GHC and cabal
in a pure nix shell. This commit adds the patch and applies to all
pre-9.0 versions.

See output of ghc --info for "ar command" value.
2021-02-05 22:54:09 +01:00
Ben Siraphob
acc5f7b18a pkgs/development/compilers: stdenv.lib -> lib 2021-01-23 08:57:37 +07:00
zowoq
31f5dd3f36 treewide: editorconfig fixes
- remove trailing whitespace
- use spaces for indentation
2021-01-20 09:11:11 +10:00
Peter Simons
8a21e02e31 ghc-9.0.1: set utf-8 locale during the build so that Haddock succeeds 2021-01-02 19:58:19 +01:00
Peter Simons
bf5e99fc7a ghc-9.0.1: avoid use of tabs in the expression 2021-01-02 19:58:19 +01:00
Peter Simons
61a785ccd9 ghc: update 9.0.1 compiler from alpha-1 to rc-1 2021-01-02 19:58:19 +01:00
Peter Simons
1998b95adc haskellPackages: update default compiler from ghc 8.10.2 to version 8.10.3 2020-12-25 20:41:54 +01:00
Joe Hermaszewski
15b3bc3306 ghc865-binary: Use binary distribution which links against ncurses6 for
x86_64-linux

Ben Gamari's patch from #85924.

Fixes #85924, allowing one to bootstrap GHC in `pkgsMusl`

`nix-build -A pkgsMusl.haskellPackages.hello` succeeds with this patch.
2020-11-28 20:19:05 +08:00