Skip to content

[21.11] Haskell related backports#147404

Merged
jonringer merged 17 commits intoNixOS:staging-21.11from
sternenseemann:haskell-backports
Dec 3, 2021
Merged

[21.11] Haskell related backports#147404
jonringer merged 17 commits intoNixOS:staging-21.11from
sternenseemann:haskell-backports

Conversation

@sternenseemann
Copy link
Member

Motivation for this change
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: haskell General-purpose, statically typed, purely functional programming language label Nov 25, 2021
@sternenseemann
Copy link
Member Author

I don't think ofborg will show this, but this causes about 6000 aarch64-linux rebuilds, so might be a good idea to redirect to staging?

@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 8.has: clean-up This PR removes packages or removes other cruft labels Nov 25, 2021
@ofborg ofborg bot requested review from domenkozar and prusnak November 25, 2021 19:58
@prusnak prusnak removed their request for review November 25, 2021 20:25
alexfmpe and others added 16 commits November 27, 2021 15:58
(cherry picked from commit 8c17cc9)
The availability of native codegen (which allows us to disable the LLVM
backend by default) hinges on the target platform of the compiler (that
is GHC), not on the platform it runs on (the host platform).

(cherry picked from commit cfdc073)
Based on https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms, although
it sadly doesn't list when the backends were introduced.

* PowerPC, x86 (and x86_64) and Sparc have been supported for longer.

* aarch64-darwin is new in 9.2.1 and backported to 8.10.5, 8.10.6 and
  8.10.7 (check is dumb here since we'll grep for 8.10.7 anyways when
  upgrading)

Fixes ghcWithPackages failing to evaluate on aarch64-darwin because of
missing support for the platform in LLVM 9's compiler-rt.

(cherry picked from commit 571f3e5)
This check was wrong and caused by a bit of confusion on my part.
GHC >= 8.10.5 && < 9 supports aarch64-darwin via LLVM and GHC >= 9.2.1
introduces the NCG backend for aarch64-darwin.

(cherry picked from commit 2f98c18)
useLLVM is what we are using in the GHC derivations already -- for
better or for worse -- so we should rename the argument here for
consistency which we are free to do as this is purely internal at the
moment (with overriding being impossible).

(cherry picked from commit c32095b)
This means we only have to update the llvmPackages attribute in one
place now and should prevent situations like with 8.6.5 where different
versions would be used in the package set compared to the compiler
build.

Drop comments in the configuration-ghc-X.Y.x.nix files as well, since
LLVM version isn't tied to the compiler minor version at
all (e. g. 8.10.2 and 8.10.7 have different support ranges).

(cherry picked from commit d7ff806)
GHC 9.0.1 only supports LLVM 9 and spews a lot of warnings about LLVM 10
when using the LLVM backend atm.

See also: https://www.haskell.org/ghc/download_ghc_9_0_1.html

(cherry picked from commit 5a568ea)
GHC 8.6.5 will always segfault on aarch64-linux and at this point
it's not realistic we'll ever fix this.

(cherry picked from commit b9f1582)
Since LLVM itself doesn't depend on target at all, this doesn't change
anything *in effect* (i. e. rebuild count should be zero), but it is
more clear about the intention and what LLVM is used for here (i. e. in
depsBuildTarget).

(cherry picked from commit 156d8d6)
Since we inherit the platform list from the bootstrap GHC, we get
differing lists depending on which platform we evaluate the platform
list on (depending on whether 8.10.2 or 8.6.5 is used). This leads to
Hydra thinking aarch64-linux is not supported as it evaluates on
x86_64-linux usually.

(cherry picked from commit 55b8d8c)
This will prevent freak accidents where the wrong tools are used because
they are in PATH by chance.

(cherry picked from commit 035f20b)
aarch64-darwin NCG was added in 9.2.1 which makes it unnecessary to
include LLVM in the wrapper.

(cherry picked from commit ef081bf)
@sternenseemann sternenseemann changed the base branch from release-21.11 to staging-21.11 November 27, 2021 14:59
@sternenseemann sternenseemann marked this pull request as ready for review November 27, 2021 14:59
@ofborg ofborg bot requested review from domenkozar, guibou and prusnak November 27, 2021 15:11
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 27, 2021
These targets also have NCG support, but they are tested less (in fact
SPARC seems to be untested atm) and may have issues. In such cases being
able to fallback to -fllvm without rebuilding the compiler could be
useful. OTOH GHC will default to -fasm and the backends probably work
well enough in most cases.

(cherry picked from commit 8f1a52a)
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Result of nixpkgs-review pr 147404 run on x86_64-linux 1

1 package built:
  • pandoc

@sternenseemann sternenseemann deleted the haskell-backports branch December 5, 2021 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants