Commit Graph

987 Commits

Author SHA1 Message Date
sternenseemann
2ec6f63534 haskell.compiler.ghcHEAD: 9.7.20230527 -> 9.9.20231014 2023-11-06 15:26:58 +01:00
Vladimír Čunát
176ccbcda8
ghc*: patch build of docs after sphinx update
The 8.x versions don't seem to need this (and the patch wouldn't apply).
2023-10-28 12:50:03 +02:00
maralorn
fe8322686d
Merge pull request #260410 from ncfavier/ghc-fix-glob
haskell.compiler.ghc*Binary: fix globbing
2023-10-22 02:57:51 +02:00
Naïm Favier
082a03e152
haskell.compiler.ghc*Binary: fix globbing 2023-10-15 15:00:54 +02:00
Vaibhav Sagar
a63c085661 haskell.compiler.ghc98: init at 9.8.1
https://www.haskell.org/ghc/blog/20231009-ghc-9.8.1-released.html

- Use source-built GHC 9.4.7, pending packaging of bindist.
- The aarch64-linux space saving strategy via disabling hyperlinked
  source is disabled for now, pending either an updated patch or
  an user defined flavour using
  https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10850.

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2023-10-15 00:43:20 +02:00
maralorn
aa816d4958
Merge pull request #252362 from sternenseemann/ghc-9.4.7
haskellPackages.ghc: 9.4.6 -> 9.4.7
2023-10-04 22:24:01 +02:00
sternenseemann
59ee081663 haskell.compiler.*: don't unnecessarily include LLVM for GHC >= 9.2
When 9.2.1 was [released], I apparently was confused by the wording. The
NCG (-fasm) codegen backend for aarch64 not only works on
aarch64-darwin, but also aarch64-linux. `useLLVM` being enabled on
aarch64-linux had no adverse effect, as GHC used -fasm anyways, but it
did inflate closure size unnecessarily which we can rectify now.

[released]: https://www.haskell.org/ghc/blog/20211029-ghc-9.2.1-released.html
2023-10-04 20:17:17 +02:00
sternenseemann
32c1a8c383 haskellPackages.ghc: 9.4.6 -> 9.4.7
https://www.haskell.org/ghc/blog/20230825-ghc-9.4.7-released.html

Notice that useLLVM is disabled for all aarch64 platforms to match
2023-10-04 17:13:56 +02:00
Ryan Hendrickson
1d78ad9ea4 haskell.compiler.ghc96: 9.6.2 -> 9.6.3
https://www.haskell.org/ghc/blog/20230925-ghc-9.6.3-released.html
2023-09-28 15:28:23 +02:00
Samir Talwar
32db1fb6e0 ghc942 + ghc943: Apply the Cabal patch for --enable-relocatable
This patch was already applied to GHC 9.4.4 and up.

It should also fix the build, as the aarch64/darwin separate output fix depends upon it.
2023-08-10 01:17:27 +02:00
sternenseemann
0a96f3ee25 haskell.compiler.ghc946: init at 9.4.6
https://www.haskell.org/ghc/blog/20230807-ghc-9.4.6-released.html
2023-08-08 16:25:45 +02:00
Samir Talwar
f6f780f129 haskell.compiler.ghc94*: apply Cabal cycle patch on aarch64-darwin
This was already applied to GHC 9.2.x, but was not copied to GHC 9.4.x.
I have had issues with this locally.

The same patch works for both Cabal 3.6 and 3.8, so we can just reuse it.
2023-08-07 13:53:26 +02:00
github-actions[bot]
e365e1db48
Merge master into haskell-updates 2023-08-06 00:13:20 +00:00
sternenseemann
bf388d5514 haskell.compiler.ghc*Binary: make sure meta can always be evaluated
The `meta` set of the binary GHCs is mostly independent of the used
bindist (except for `pname` which includes `variantSuffix`). Thus we
should make sure it can be evaluated even if no bindist is available for
the platform, i.e. evaluating `outPath` may cause an evaluation failure,
but `meta.platforms` not. Use case at present is to make
`lib.meta.availableOn` work everywhere for any GHC (the normal GHCs
inherit their platforms list from their respective boot compiler, at
least for now).

To fix this we need to make sure that shallowly evaluating `passthru`
doesn't force `binDistUsed`, since `mkDerivation` needs to merge
`passthru` into the resulting derivation attribute set, thus forcing the
attribute names of `passthru`. We can easily do this by accessing what
we want to learn from `ghcBinDists` manually and using `or` to fall back
to a sensible default.
2023-08-02 12:30:10 +02:00
github-actions[bot]
8ad2926229
Merge master into haskell-updates 2023-07-16 00:16:59 +00:00
Randy Eckenrode
6454fb1bc0
haskell.compiler.ghc962: fix build on Darwin after stdenv rework merge
The switch to cctools-llvm made several LLVM tools the default on
Darwin, which includes llvm-ar. GHC will try to use `-L` with `ar` when
it is `llvm-ar`, but that doesn’t work currently on Darwin.

See https://gitlab.haskell.org/ghc/ghc/-/issues/23188.
2023-07-14 10:51:29 -06:00
sternenseemann
1eddb04ac9 haskell.compiler.{ghc962,ghcHEAD}: no rendered src on aarch64-linux
This saves just enough space on aarch64-linux so that the hadrian built
GHCs are under the 3GB Hydra output limit:

| compiler | before     | after      | Δ          |
|----------|------------|------------|------------|
| ghc962   | 3241234736 | 2810740560 | -430494176 |
| ghcHEAD  | 3341288328 | 2902760872 | -438527456 |

The total output size can be calculated using (don't forget to use
aarch64-linux):

```
nix-build -A <compiler> | xargs nix path-info -s | awk '{ s += $2 }; END { print s }'
```
2023-07-10 23:14:54 +02:00
sternenseemann
20b0406a00 haskell.*.ghc*BinaryMinimal: remove
haskell.compiler.ghc8102BinaryMinimal: remove at 8.10.2
haskell.compiler.ghc8107BinaryMinimal: remove at 8.10.7
haskell.compiler.ghc924BinaryMinimal: remove at 9.2.4

On aarch64-linux the binary GHCs take up about 2.6GB (which compresses
pretty well on zfs as it turns out), so they are below the output limit
of Hydra. This allows us to drop the special casing of aarch platforms
in haskell-packages.nix. While we're at it, drop the minimal variants so
we don't unnecessarily build variants of the binary GHCs.
2023-07-04 15:29:40 +02:00
sternenseemann
8aeb0de93d haskell: re-enable profiling on aarch64
The main problem was GHC exceeding the Hydra output limit with profiling
libs on aarch64-linux which made us disable the feature. Nowadays the
limit is 3GB, the GHC output is a bit over 2GB, so easily under the
limit.

aarch64-darwin uses a different codegen backend and was never really
affected by the problem: Its output with profiling enabled is around
1.6GB.

Consequently we can enable profiling for all platforms again, as we have
no output size issues for those we build on Hydra.

Thanks to flokli for helping me track down these up to date numbers.
2023-07-04 15:29:40 +02:00
sternenseemann
cb7ccdccd7 Merge remote-tracking branch 'origin/master' into haskell-updates 2023-06-08 20:16:04 +02:00
Rebecca Turner
17d63282b2 haskell.compiler: allow overriding source with hadrian
Hadrian (the GHC build tool) is built separately from GHC. This means
that if `haskell.compiler.ghc961` is overridden to add patches, those
patches will _only_ be applied to the GHC portion of the build, and not
the Hadrian build. For example, backporting this patch to GHC 9.6.1
failed because the changes to `hadrian/` files were not reflected in the
Nix build:

5ed77deb1b

By lifting `src` and `hadrian` from variables defined in the function
body to parameters with default values, the `hadrian/` files can be
overridden using the `haskell.compiler.ghc961.override` function. For
example:

   self.haskell.compiler.ghc961.override {
     # The GHC 9.6 builder in nixpkgs first builds hadrian with the
     # source tree provided here and then uses the built hadrian to
     # build the rest of GHC. We need to make sure our patches get
     # included in this `src`, then, rather than modifying the tree in
     # the `patchPhase` or `postPatch` of the outer builder.
     src = self.applyPatches {
       src = let
         version = "9.6.1";
       in
         self.fetchurl {
           url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
           sha256 = "fe5ac909cb8bb087e235de97fa63aff47a8ae650efaa37a2140f4780e21f34cb";
         };

       patches = [
         # Enable response files for linker if supported
         (self.fetchpatch {
           url = "5ed77deb1b.patch";
           hash = "sha256-dvenK+EPTZJYXnyfKPdkvLp+zeUmsY9YrWpcGCzYStM=";
         })
       ];
     };
   }

Note that we do have to re-declare the `src` we want, but I'm not sure
of a good way to avoid this while also sharing one set of patches
between the GHC and Hadrian builds.
2023-06-08 20:11:52 +02:00
sternenseemann
f1ad505272 haskell.compiler.ghc961: remove at 9.6.1 2023-06-08 18:18:11 +02:00
sternenseemann
271e7a9d82 haskell.compiler.ghcHEAD: 9.7.20230505 -> 9.7.20230527 2023-06-08 18:17:07 +02:00
ners
a83735c6a2 haskell.compiler.ghc962: init at 9.6.2
https://www.haskell.org/ghc/blog/20230523-ghc-9.6.2-released.html
2023-05-30 13:35:14 +02:00
Dennis Gosnell
d7d6b1c445
haskell.compiler.ghc928: init at 9.2.8 2023-05-27 17:24:01 +09:00
Naïm Favier
9d30031014 haskell.compiler.ghcHEAD: 9.7.20230406 -> 9.7.20230505
04b80850...983ce558

Adds support for callbacks to the JS backend.
2023-05-09 18:16:07 +02:00
fetsorn
560123c482 ghc: fix typos
"depedendency" -> "dependency"
2023-05-08 20:12:24 +04:00
sternenseemann
2fe11e6fee haskell.compiler.ghc94: 9.4.4 -> 9.4.5
https://www.haskell.org/ghc/blog/20230418-ghc-9.4.5-released.html
2023-04-22 17:47:11 +02:00
sternenseemann
70aea98451 haskell.compiler.ghcHEAD: 9.7.20230217 -> 9.7.20230406 2023-04-06 19:00:21 +02:00
Martin Weinelt
bb14c4255b Merge remote-tracking branch 'origin/master' into staging-next 2023-03-13 17:14:19 +00:00
sternenseemann
b2c570ec43 haskell.compiler: always include python when building with hadrian
We previously thought that we only need python if we were going to run
./boot or using emscripten which implements all its wrappers in
python (and likes to reinvoke them). As it turns out, though, hadrian
likes to invoke python itself for generating certain headers of rts
using a script shipped with the GHC source. This fact was obscured
before, since (presumably) sphinx would propagate python into PATH.
2023-03-13 01:58:09 +01:00
sternenseemann
f07d4d077e haskell.compiler.ghc961: init at 9.6.1
xhtml seems to be built unconditionally now which is at least one thing
improved by hadrian.
2023-03-12 13:16:26 +01:00
github-actions[bot]
140a35879a
Merge master into staging-next 2023-03-11 12:01:11 +00:00
sternenseemann
f2ae2be316 Merge remote-tracking branch 'origin/master' into haskell-updates 2023-03-11 12:24:46 +01:00
sternenseemann
45aae5c2fe haskell.compiler.ghc9*: work around output cycles on aarch64-darwin
Due to link time dead code elimination not working on aarch64-darwin,
some unused store path references in Paths_* modules are retained. This
causes reference cycles when a separate `bin` output is used.

To prevent this, add a patch to Cabal as shipped by GHC which infers
based on the installation layout (which is influenced by
enableSeparateBinOutput, enableSeparateDataOutput etc. in a Nix build)
which references can be retained without causing a reference cycle. This
ensures that packages that were fine with a bin output will also work on
aarch64-darwin. Packages that cause a reference cycle anyways (by
actually using references that do cause one) fail due to a missing
symbol – here we are trading the overall benefit for a more confusing
error message.

For details, refer to the explanation comment in the patch.
2023-03-11 12:22:48 +01:00
sternenseemann
c61157bbe3 haskell.compiler.ghc{8107,902}: give cabal-paths.patch a better name 2023-03-11 12:22:48 +01:00
sternenseemann
97d55ec923 haskell.compiler.ghcHEAD: drop malformed/redundant hadrian setting
`*.*.rts.*.opts` is actually copied from the migration GHC blog post,
but does not, actually, parse: The format is
`<stage>.<package>.<program>.<filetype>.<setting>`, so it would need to
be `*.rts.ghc.opts`. This is already achieved by the broader rule on the
next line.
2023-03-08 17:12:18 +01:00
sternenseemann
23dc76fd22 haskell.compiler.ghcHEAD: fix hadrianFlagsArray handling 2023-03-08 17:12:18 +01:00
sternenseemann
471b9cab41 haskell.compiler.ghcHEAD: 9.7.20221224 -> 9.7.20230217
- Christmas is over!

- Upstream has changed the name of the target triplet used for the JS
  backend from js-unknown-ghcjs to javascript-unknown-ghcjs, since Cabal
  calls the architecture "javascript":
  6636b67023

  Since the triplet is made up anyways, i.e. autoconf does not support
  it and Rust uses different triplets for its emscripten backends, we'll
  just change it as well.

- Upstream fixed the problem with ar(1) being invoked incorrectly by stage0:
  e987e345c8
2023-03-08 17:12:18 +01:00
sternenseemann
faa92cd30b pkgsCross.ghcjs.haskellPackages.ghc: formally disable shared libs
Hadrian does this automatically unfortunately, but unless we correctly
set enableShared as well, mkDerivation will try building shared libs
which will inevitably fail due to missing shared core packages.

Let's stay away from fully_static which does a lot of funky stuff and
was not working before anyways for pkgsStatic.
2023-03-08 17:12:18 +01:00
sternenseemann
2278f9ebe2 haskell.compiler: fix GHCs' user guide build with sphinx >= 6.0
This requires backporting upstream's fix to all GHCs we are currently
shipping, since only GHC 9.4.5 and 9.6.1 will receive a backport.

GHC HEAD will be taken care of in #217168.

https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9625
https://gitlab.haskell.org/ghc/ghc/-/issues/22690
2023-03-03 23:56:30 +01:00
sternenseemann
81d5cb1550 haskell.compiler.ghc927: init at 9.2.7
https://www.haskell.org/ghc/blog/20230227-ghc-9.2.7-released.html
2023-03-01 00:39:01 +01:00
Kyle Butt
9ace1d895c haskell.compiler.ghc94*: backport Cabal bugfix for Paths_ modules
There is a code generation bug in Cabal-3.6.3.0. For packages configured with
--enable-relocatable, Cabal would generate code that doesn't compile.

There isn't an upstream issue, but the issue is described in the commit that
fixed it:
6c796218c9

It was fixed in Cabal-3.8.*
Backport the fix to the Cabal library that ships with ghc-9.4.4

Cabal 3.8 ships with ghc-9.6, so when 9.6 is released this fix shouldn't be
necessary.
2023-02-24 12:48:37 +01:00
sternenseemann
75cdc109f0 haskellPackages.ghc: 9.2.4 -> 9.2.6
https://www.haskell.org/ghc/blog/20230210-ghc-9.2.6-released.html
2023-02-13 15:32:09 +01:00
sternenseemann
328d6f8499 haskell.compiler.ghc8107Binary: tag bindists built using hadrian
Surprisingly, the aarch64-darwin bindist for 8.10.7 was still built
using make.
2023-02-05 14:01:25 +01:00
sternenseemann
36005f52b8 haskell.compiler.ghc8102Binary: tag bindists built using hadrian 2023-02-05 14:01:25 +01:00
sternenseemann
902701c0cf haskell.compiler.ghc924Binary: tag bindists built using hadrian
`ghc ? hadrian` can be used to check if a GHC was built using hadrian.
This is often relevant since hadrian changed the ghc libdir location, so
we need to install libs to a different location as well.
2023-02-05 14:01:25 +01:00
sternenseemann
869467a696 haskell.compiler.ghc924Binary: remove unnecessary hadrian workaround
The fix for the issue we are working around has been released in 9.2.3
already, so we no longer need to apply it manually:

302eb4c218
2023-01-23 14:54:42 +01:00
sternenseemann
0aa01bef76 pkgsCross.ghcjs.haskellPackages.ghc: don't revert edited config.sub
GHC ships a [modified] config.sub so that js-unknown-ghcjs is accepted
by autotools. For some platforms, we automatically update config.sub
from upstream's source in order to prevent that builds fail when we use
an outdated config.sub. In this case of course the perfectly up to date
config.sub would reject the target platform we are trying to use, so we
must disable this mechanism for now.

I have asked in the GHC IRC channel if there are any plans on
upstreaming the platform. It would be nice if were able to drop this
change in the future.
2023-01-07 18:33:36 +01:00
sternenseemann
6392c21c1f haskell.compiler.ghcHEAD: allow building the JavaScript backend
This is now possible by building a cross compiler for js-unknown-ghjs
using `pkgsCross.ghcjs.buildPackages.haskell.compiler.ghcHEAD`.

To allow this, the following things needed to be done:

* Disable dependencies that wouldn't work:

  - Don't pull in ncurses for terminfo
  - Don't pull in libffi
  - Don't pull in libiconv
  - Don't enable the LLVM backend
  - Enable gmp-less native-bignum backend

* Use emscripten instead of a C compiler. The way this works is inspired
  by emscriptenPackages, but avoids the following flaws:

  - Instead of using a custom configurePhase, just set
    `configureScript = "emconfigure ./configure";` which is much simpler.

  - Create writable EM_CACHE before configuring, as configure scripts
    want to compile test programs.

  Additionally, we need to disable the targetCC check, as it is not
  applicable with emscripten which never appears as part of stdenv.

* Use generic $configureScript in installPhase to be able to work with
  our emconfigure trick.

Note that the corresponding Haskell package set does not work yet. Cabal
doesn't seem to like GHC 9.7 yet and the generic-builder is clueless
about the JS backend.
2023-01-04 00:02:29 +01:00
sternenseemann
de8e0bfaa7 haskell.compiler: also check targetPlatform for gmp compat
gmp is part of buildInputs _and_ depsTargetTarget, so we need to check
the host and target platform to be correct. In practice this doesn't
change much though, as gmp.meta.platforms is _quite_ liberal.
2023-01-04 00:01:25 +01:00
sternenseemann
3665c429d3 haskell.compiler.ghcHEAD: 9.5.20220921 -> 9.7.20221224
Finally building a cross compiler using hadrian is possible, but there
are some outstanding issues regarding external libraries in the package
db which causes issues with ghc-bignum.
2023-01-03 15:23:53 +01:00
sternenseemann
9e8a483770 haskell.compiler.ghc94: 9.4.2 -> 9.4.4
https://www.haskell.org/ghc/blog/20221103-ghc-9.4.3-released.html
https://www.haskell.org/ghc/blog/20221224-ghc-9.4.4-released.html
2022-12-29 13:49:47 +01:00
Kyle Butt
3d851b64b8 haskell.compiler.ghc92*: backport Cabal bugfix for Paths_ modules
There is a code generation bug in Cabal-3.6.3.0. For packages configured with
--enable-relocatable, Cabal would generate code that doesn't compile.

There isn't an upstream issue, but the issue is described in the commit that
fixed it:
6c796218c9

It was fixed in Cabal-3.8.*
Backport the fix to the Cabal library that ships with ghc-9.2.4

Co-authored-by: sternenseemann <sternenseemann@systemli.org>

Closes #200063.
2022-11-26 15:03:55 +01:00
sternenseemann
3d361be06a haskell.packages.ghc94: revert to 9.4.2
Due to https://gitlab.haskell.org/ghc/ghc/-/issues/22425, we'll
tentatively stay with 9.4.2 for now. 9.4.3 is available explicitly
via haskell.packagse.ghc943 if you need it (e.g. on aarch64).
2022-11-09 23:44:01 +01:00
sternenseemann
c7a0d75bd1 haskell.compiler.ghc92: 9.2.4 -> 9.2.5 2022-11-07 17:29:47 +01:00
sternenseemann
677ff51cfa haskell.compiler: ghc942 -> ghc943
https://www.haskell.org/ghc/download_ghc_9_4_3.html

Dropping GHC 9.4.2, since there is no Stackage snapshot which uses GHC 9.4.*,
so the stack Nix integration should not get any ideas.
2022-11-04 17:56:41 +01:00
sternenseemann
b4429529f5 haskell.compiler: upgrade to 9.2.4 for 9.2.* binary compiler 2022-09-26 18:02:02 +02:00
sternenseemann
da60f2dc9c haskell.compiler.ghcHEAD: 9.3.20220406 -> 9.5.20220921
Initial port of our GHC Nix expressions to the new hadrian build system,
as it has become required after 9.4. Unfortunately there are some
regressions affecting us, namely the inability to install a GHC
cross-compiler at the moment (see issue linked in relevant error
message). This means that a lot of specific configuration snippets for
cross-platforms and static compilation have been ported from make
speculatively, as we are unable to test them for the moment.
2022-09-22 16:18:17 +02:00
sternenseemann
f06a4d73c0 haskell.compiler: clean up unused patches 2022-08-22 22:31:11 +02:00
sternenseemann
970a97f973 haskell.compiler: ghc941 -> ghc942 2022-08-22 22:27:22 +02:00
sternenseemann
d0706da55e haskell.compiler.ghc941: bootstrap using (binary) GHC 8.10.7
This shortens the bootstrap chain for 9.4.1 and should be kinder on
rebuilds. It requires some messing around in the configure file, since
it is not officially supported by upstream (but known to work). For now
it saves us the hassle of adding another bindist to nixpkgs. When we
support hadrian, we'll be able to use the already packaged 9.2.2
bindist.
2022-08-13 20:55:30 +02:00
Malte Brandy
44c848bc02 haskell.compilers.ghc941: 9.4.0.20220721 -> 9.4.1
Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2022-08-13 20:55:30 +02:00
sternenseemann
4e7c3b9828 haskell.compiler.ghc941: apply fix for racy build system
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8751
https://gitlab.haskell.org/ghc/ghc/-/issues/21934

Hopefully this patch fixes the problem we experienced on Hydra once (out
of three builds).
2022-08-04 15:15:55 +02:00
sternenseemann
7f909b041b haskell.compiler: ghc923 -> ghc924
https://www.haskell.org/ghc/download_ghc_9_2_4.html
2022-07-28 18:09:33 +02:00
sternenseemann
078346d55e haskell.compiler.ghc941: init at 9.4.0.20220721 2022-07-26 21:09:03 +02:00
Vladimír Čunát
c869aa9ac9
Merge branch 'master' into staging-next
The purpose is to integrate the usual Haskell rebuild.
2022-07-07 18:50:02 +02:00
Adam Joseph
86c7c0917f
haskell.compiler.ghc865Binary: add powerpc64le bootstrap 2022-07-01 13:05:30 +02:00
Dennis Gosnell
c9e0650b51
Merge pull request #177948 from lf-/apply-haddock-hyperlinking-patch
ghc8107-ghc923: patch haddock to generate correct source links
2022-06-28 15:30:49 +09:00
sternenseemann
1216772f5d haskell.compiler.ghc922Binary: init at 9.2.2
Since the musl / alpine bindist now uses the GMP backend, we need to
learn to tell Hadrian bindists about GMP. Hadrian bindists no longer
have the buildinfo files, instead we need to patch the package db before
installing and recache it afterwards which is not too hard, luckily.
Same goes for libiconv and base as well as libffi and rts on
darwin (those bindists are all produced using hadrian).

See also: https://gitlab.haskell.org/ghc/ghc/-/issues/21554#note_431000

Note that pkgsMusl.haskell.compiler.ghc922Binary still has severe
issues: It can't produce shared libraries because the bindist ships
none (and using the GMP backend has a hard requirement for shared
objects, apparently) and ghci segfaults for unknown reasons at the
moment. However, I've successfully compiled hadrian with it so far, so
perhaps it's good enough.
2022-06-26 13:50:16 +02:00
Jade Lovelace
2cf08210fd ghc8107-ghc923: patch haddock to generate correct source links
Previously links to external modules were jacked because haddock was
doing them wrong. I fixed this upstream in early May 2022 but it's not
out yet.
2022-06-16 16:39:42 -07:00
Jade Lovelace
fc1548e597 ghc8.10.7-ghc9.2.3: hyperlink sources in base lib haddocks
This was disabled basically by accident before.

The links are jacked, but that was is true for every package; it is not
unique to this PR. I fixed it upstream here:
https://github.com/haskell/haddock/pull/1482
but it's not in any release distributions yet I don't think.

Fixes #171841
2022-06-16 15:04:26 -07:00
Sergei Trofimovich
849d47a928 ghc: use CXX=c++, not CXX=cxx
Otherwise attempt to build ghcHEAD from local checkout fails as:

    $ nix build -L --impure --expr 'with import ~/nm {}; haskell.compiler.ghcHEAD.overrideAttrs (oa: { src = ./.; patches = []; nativeBuildInputs = oa.nativeBuildInputs ++ [ git ]; })' --keep-failed
    ...
    ghc> checking C++ standard library flavour... ./configure: line 11487: /nix/store/r7r10qvsqlnvbzjkjinvscjlahqbxifl-gcc-wrapper-11.3.0/bin/cxx: No such file or directory

I think 'cxx' is not provided by stdenv.
2022-05-29 20:02:53 +02:00
sternenseemann
90099ac5fa haskell.compiler: ghc922 -> ghc923
https://www.haskell.org/ghc/download_ghc_9_2_3.html

Since the tarball is generated by Hadrian, neither autoreconf nor ./boot
is executed so ./configure and ghc.mk is missing.
2022-05-28 21:11:07 +02:00
Adam Joseph
c0085404bd lib/systems/inspect.nix: remove isPowerPC
Very confusingly, the `isPowerPC` predicate in
`lib/systems/inspect.nix` does *not* match `powerpc64le`!

This is because `isPowerPC` is defined as

  isPowerPC      = { cpu = cpuTypes.powerpc; };

Where `cpuTypes.powerpc` is:

  { bits = 32; significantByte = bigEndian; family = "power"; };

This means that the `isPowerPC` predicate actually only matches the
subset of machines marketed under this name which happen to be 32-bit
and running in big-endian mode which is equivalent to:

  with stdenv.hostPlatform; isPower && isBigEndian && is32bit

This seems like a sharp edge that people could easily cut themselves
on.  In fact, that has already happened: in
`linux/kernel/common-config.nix` there is a test which will always
fail:

  (stdenv.hostPlatform.isPowerPC && stdenv.hostPlatform.is64bit)

A more subtle case of the strict isPowerPC being used instead of the
moreg general isPower accidentally are the GHC expressions:

  Update pkgs/development/compilers/ghc/8.10.7.nix
  Update pkgs/development/compilers/ghc/8.8.4.nix
  Update pkgs/development/compilers/ghc/9.2.2.nix
  Update pkgs/development/compilers/ghc/9.0.2.nix
  Update pkgs/development/compilers/ghc/head.nix

Since the remaining legitimate use sites of isPowerPC are so few, remove
the isPowerPC predicate completely. The alternative expression above is
noted in the release notes as an alternative.

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2022-05-25 09:45:42 +02:00
github-actions[bot]
2541ef4282
Merge master into haskell-updates 2022-04-24 00:12:40 +00:00
sternenseemann
9cba3bc856
Merge pull request #167934 from sternenseemann/aarch64-darwin-cabal-patches-target
haskell.compiler: check targetPlatform for Cabal Paths module patch
2022-04-23 18:54:56 +02:00
sternenseemann
d331463a2c haskell.compiler: fix binary GHCs with store paths containing "xxx"
At some point in hadrian's installation Makefile used for e.g. alpine
bindists 'xxx' is used as a placeholder for three spaces and later
substituted back. This breaks if the store path itself contains 'xxx'.
We adapt an upstream patch which will be part of 9.4 (and presumably
9.0.3 and 9.2.3) as a workaround for this issue for 8.10.2 and 8.10.7
which are the binary GHCs in nixpkgs affected.
2022-04-22 14:25:53 +02:00
sternenseemann
f2f10367b9 haskell.compiler.ghc8107Binary: build on aarch64 on Hydra
According to local testing, the bindist is below 1GB on
aarch64-linux which is below the Hydra output limit.
2022-04-09 13:42:14 +02:00
github-actions[bot]
d685083974
Merge master into haskell-updates 2022-04-09 00:12:38 +00:00
sternenseemann
4eeab0f0ab haskell.compiler.ghcHEAD: 9.3.20211111 -> 9.3.20220406 2022-04-09 00:34:46 +02:00
sternenseemann
eb286631b4 haskell.compiler: check targetPlatform for Cabal Paths module patch
The issue we are working around is concerned with the lack of dead
code elimination in the aarch64-darwin LLVM codegen backend. Thus
the relevant condition is the target platform, not the host
platform as checked previously.
2022-04-09 00:26:05 +02:00
Matthew Leach
8cb7f599f9 haskell.compiler.ghc902: fix seperate bin outputs on aarch64-darwin 2022-04-08 16:26:54 +01:00
Robert Hensing
76be6eaf29 haskell.compiler.ghc902: Backport -fcompact-unwind 2022-03-31 13:48:17 +02:00
rnhmjoj
654940f36b haskellPackages.mkDerivation: check haddock availability
This change makes the haskell builder run the haddockPhase only if the
haddock program is availble (for example, it's not when cross-compiling).
2022-03-17 19:43:04 +01:00
rnhmjoj
4884fcc0d2 ghc: enable static RTS
This change allows loading statically compiled libreries into a running
GHC, thus fixing the build of haskell packages that use TemplateHaskell.
See [1] for the details.

Fixes issue #61575, #124284.

[1]: https://www.tweag.io/blog/2020-09-30-bazel-static-haskell/
2022-03-17 19:43:04 +01:00
sternenseemann
47f837f5e8 haskell.compiler: ghc921 -> ghc922
https://www.haskell.org/ghc/download_ghc_9_2_2.html
2022-03-09 16:42:07 +01:00
Moritz Kiefer
f82aeba582 haskell.compiler.ghc{902,921}: Switch GHC 9.0/9.2 to bignum-native
Neither of them support integer-simple anymore.

fixes #153742
2022-01-31 19:12:51 +01:00
Ben Siraphob
e68cbf0c04
Merge pull request #154046 from hexagonal-sun/ghc-fix-bin-outputs-on-aarch64-darwin
ghc8107: fix seperate bin outputs on aarch64-darwin
2022-01-30 20:21:51 +00:00
Matthew Leach
b0dcd7fa34 haskell.compiler.ghc8107: fix seperate bin outputs on aarch64-darwin 2022-01-21 15:34:05 +00:00
sternenseemann
e3c61654ca haskell.compiler.*: disable large address space only on iOS
The condition used in the past to detect iOS was "is this
aarch64-darwin"? Since we have aarch64-darwin devices running macOS
nowadays which do allow large address space, let's use the more accurate
flag.
2022-01-04 12:10:00 +01:00
sternenseemann
b2cecf1509 Merge #152136: haskell.compiler: ghc901 -> ghc902 2021-12-27 16:17:51 +01:00
sternenseemann
41eef0059d haskell.compiler: ghc901 -> ghc902
https://www.haskell.org/ghc/download_ghc_9_0_2.html
2021-12-26 10:00:37 +01:00
Ryan Burns
fd421a9fd5 haskell.packages.ghcHEAD: refine enableDwarf platform condition for darwin
enableDwarf requires elfutils on the host, which doesn't support darwin.

Instead of hardcoded isDarwin/isWindows, switch to self-documenting
availableOn conditional for elfutils.

Fixes ghcHEAD cross-compilation when build = host = darwin,
target = linux.

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2021-12-25 21:49:44 +01:00
sternenseemann
c610be58c0 haskell.compiler.*: use build->target LLVM in build
This is no substantial change, as we already assert that the
build->target and host->target LLVM are the same, but this brings the
terminology in the file in a more consistent order, since we use
build->target for CC/CXX and bintools already.

In fact we should be passing build->target to configure always,
host->target would come into play when updating GHC's settings file
after installing.
2021-12-01 18:37:24 +01:00
sterni
c85d141221
Merge pull request #148079 from sternenseemann/ghc-set-clang-only-if-use-llvm
haskell.compiler.*: only set CLANG to match llc/opt
2021-12-01 17:34:38 +01:00
sternenseemann
0f5a723dd1 Merge remote-tracking branch 'origin/master' into haskell-updates 2021-12-01 17:31:16 +01:00
sternenseemann
6daa4a5c04 haskell.compiler.*: use wrapped darwin bintools on aarch64
On aarch64-darwin we have additional wrappers for install_name_tool and
strip to deal with codesigning requirements (e. g. updating the
signature / checksum after changing a binary). These wrappers don't
exist on x86_64-darwin which is why the unwrapped versions were used
before, causing the kernel to kill (some) executables produced by GHC.
2021-12-01 17:29:12 +01:00
sternenseemann
c23e14e33f haskell.compiler.*: assert that host->target == build->target tools
CC, CXX, LD, AR, …, LLC, OPT and CLANG will be invoked by GHC's build
system at build time in the build->target role. However, since we are
passing absolute paths, they will get saved in GHC's settings file and
later invoked at runtime, when they should be host->target. This means
that the build->target and host->target tools need to be the same for
our built GHC to work properly which is what we guard using these new
asserts.

Being able to drop these asserts would be a step towards cross-compiling
GHC (as opposed to building a GHC cross-compiler which still works).
2021-11-30 23:06:44 +01:00
sternenseemann
19fc229294 haskell.compiler.*: use targetCC for hasGold check
This is a bit shorter and more consistent with the rest of the file.
2021-11-30 23:00:11 +01:00