[21.11] Haskell related backports#147404
Merged
jonringer merged 17 commits intoNixOS:staging-21.11from Dec 3, 2021
Merged
Conversation
Member
Author
|
I don't think ofborg will show this, but this causes about 6000 |
(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)
Source: * (8.6.5: https://www.haskell.org/ghc/download_ghc_8_6_5.html) * (8.8.4: https://www.haskell.org/ghc/download_ghc_8_8_4.html) * (8.10.2: https://www.haskell.org/ghc/download_ghc_8_10_2.html) * 8.10.7: https://www.haskell.org/ghc/download_ghc_8_10_7.html * (9.0.1: https://www.haskell.org/ghc/download_ghc_9_0_1.html) * 9.2.1: https://www.haskell.org/ghc/download_ghc_9_2_1.html * HEAD: https://gitlab.haskell.org/ghc/ghc/-/blob/3ab3631f41efe9a1ae32a5b1f709152228edb09a/configure.ac#L674 (cherry picked from commit 9e1f438)
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)
(cherry picked from commit b2c2215)
This will prevent freak accidents where the wrong tools are used because they are in PATH by chance. (cherry picked from commit 035f20b)
(cherry picked from commit a7c5645)
aarch64-darwin NCG was added in 9.2.1 which makes it unnecessary to include LLVM in the wrapper. (cherry picked from commit ef081bf)
3db6928 to
c17804b
Compare
6 tasks
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)
dd9d500 to
9a9af9d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes