Commit Graph

17 Commits

Author SHA1 Message Date
sternenseemann
131400c2e2 haskell.compiler: port all make/native-bignum GHCs to common expr
The common expression is a little messy to avoid rebuilds. It can be
cleaned up in a second step.

`9.4.8.fixme.nix` is used temporarily so that git's rename detection
gets where common-make-native-bignum.nix is coming from.

8.10.7 keeps its expression since it uses integer-simple which changes
the expression's interface. This is unfortunately very annoying to
reflect in a common expression.
2024-05-16 15:47:56 +02:00
Wolfgang Walther
f4f56c7af2
haskell.compiler: no dynamic way without enableShared/enableProfiledLibs
This disables building dynamic libraries for GHC 9.4.x and before, when enableShared and
enableProfiledLibs are set to false. Currently this only disables dynamic linking of GHC
itself, but still creates dynamic libraries.

The hadrian-based GHC 9.6+ already disable building dynamic libraries via the no_dynamic_libs
transformer in this case.

The reason for this happening before was, that the default was assumed to be "v p dyn", of
which "p" was taken away when profiled libs were disabled. But this would unconditionally
enable the dyn way. Using the BUILD_PROF_LIBS flag in this case will let GHC's config.mk.in
script make the proper decisions about which GhcLibWays to build.
2024-02-26 13:23:26 +01:00
maralorn
0bd0847ecd
Merge pull request #275616 from sternenseemann/ghc-cross-docs
haskell.compiler: also build manual for cross-compilers
2024-01-01 14:22:20 +01:00
sternenseemann
7998143a43 haskell.compiler: also build manual for cross-compilers
The reasoning given for disabling it is flawed: In most cases, sphinx
and its dependencies are already in the binary cache, since we only need
them as build tools—sphinx for the build platform is just the normal
pkgs.sphinx, since it doesn't care about targetPlatform.

We just need to disable it when the buildPlatform is also musl, so we
avoid pulling in sphinx in pkgsMusl.
2023-12-20 14:12:32 +01:00
Marc Scholten
54fc9f6356 haskell.packages.ghc9{6,8}: work around aarch64-darwin output cycles
This ports our infamous patch for `Cabal` which cheesily prevents an
output cycle for derivations that use separate bin outputs where
references caused by the `Paths_*` module can't be eliminated by the GHC
aarch64-darwin codegen backend.

See also

- the original issue #140774,
- the original patch for GHC 9.2 #216857
- the ported patch for GHC 9.4
  f6f780f129

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2023-12-13 00:16:18 +01:00
sternenseemann
2fd7fa6fbe haskell.compiler: link upstream issue for sphinx 7 patch 2023-11-17 12:52:04 +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
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
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
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
fetsorn
560123c482 ghc: fix typos
"depedendency" -> "dependency"
2023-05-08 20:12:24 +04:00
github-actions[bot]
140a35879a
Merge master into staging-next 2023-03-11 12:01:11 +00: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
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
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
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
c7a0d75bd1 haskell.compiler.ghc92: 9.2.4 -> 9.2.5 2022-11-07 17:29:47 +01:00