Skip to content

haskell.compiler: refactor LLVM handling, upgrade to latest LLVM version for each GHC version#146938

Merged
sternenseemann merged 5 commits intoNixOS:haskell-updatesfrom
sternenseemann:ghc901-llvm-9
Nov 24, 2021
Merged

haskell.compiler: refactor LLVM handling, upgrade to latest LLVM version for each GHC version#146938
sternenseemann merged 5 commits intoNixOS:haskell-updatesfrom
sternenseemann:ghc901-llvm-9

Conversation

@sternenseemann
Copy link
Member

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

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 21, 2021
@sternenseemann
Copy link
Member Author

@ofborg build haskell.packages.ghc901.hello

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 21, 2021
Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

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

This seems reasonable.

@sternenseemann sternenseemann added the 9.needs: port to stable A PR needs a backport to the stable release. label Nov 22, 2021
@sternenseemann
Copy link
Member Author

sternenseemann commented Nov 23, 2021

Okay, since I've discovered some issues with how we handle LLVM atm and it seems to require a set rebuild (currently still waiting on the current build finishing to start a new rotation), I'm gonna make this into a bigger PR that changes and refactors LLVM-related stuff for our GHCs, in particular:

  • Inherit llvmPackages from the ghc derivation in the package sets
  • Use LLVM 9 for GHC 9.0.1
  • Upgrade all other GHC LLVM versions to the latest supported (for e. g. aarch64-darwin support)
  • Unify the use LLVM condition in the compiler expressions an ghcWithPackages (maybe in a follow up)

@sternenseemann sternenseemann changed the title haskell.compiler.ghc901: drop LLVM version to 9 haskell.compiler: refactor LLVM handling, upgrade to latest LLVM version for each GHC version Nov 23, 2021
@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. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 23, 2021
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).
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
GHC 8.6.5 will always segfault on aarch64-linux and at this point
it's not realistic we'll ever fix this.
@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Nov 24, 2021
@sternenseemann sternenseemann merged commit 48b60ee into NixOS:haskell-updates Nov 24, 2021
@sternenseemann sternenseemann deleted the ghc901-llvm-9 branch November 24, 2021 13:50
@sternenseemann sternenseemann removed the 9.needs: port to stable A PR needs a backport to the stable release. label Nov 25, 2021
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: 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. 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.

2 participants