Skip to content

ghcWithPackages: set withLLVM if hostPlatform is not x86_64#121494

Merged
maralorn merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann:ghcWithPackages-withLLVM
May 3, 2021
Merged

ghcWithPackages: set withLLVM if hostPlatform is not x86_64#121494
maralorn merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann:ghcWithPackages-withLLVM

Conversation

@sternenseemann
Copy link
Copy Markdown
Member

@sternenseemann sternenseemann commented May 2, 2021

Resolves #116235.

This change fixes tests.haskell.shellFor on aarch64 which convinces me that this is a good change to make.
For GHC 9.2 we'll may have to adjust this again though.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

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

@ofborg build tests.haskell.shellFor

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

@ofborg build nixosTests.agda

@sternenseemann
Copy link
Copy Markdown
Member Author

Resolves #111738 as well.

@cdepillabout
Copy link
Copy Markdown
Member

This looks good to me (although I don't have much experience with aarch64)

@maralorn
Copy link
Copy Markdown
Member

maralorn commented May 2, 2021

Is there anything that could break from this?

What about darwin do we need LLVM there?

@sternenseemann
Copy link
Copy Markdown
Member Author

Is there anything that could break from this?

I don't think so, this only puts LLVM programs in PATH.

What about darwin do we need LLVM there?

#116235 (comment)

I must admit I haven't touched or used the stock ghc in nixpkgs for a long time, since we ship our own ones in haskell.nix to be independent of what ever nixpkgs does. For anything that's not x86, or explicitly set to not use LLVM we do enable useLLVM. (https://github.com/input-output-hk/haskell.nix/blob/bab2eaea62be97649e0d38ef9e3bd313b92cf21d/compiler/ghc/default.nix#L22-L52)

In general GHC up to 9.2 has Native Code Gens for: PowerPC, SPARC, X86 only. From 9.2 this will also include AArch64, but no AArch32.

We also don't add LLVM on PowerPC as GHC should have the ability to
generate native code for that platform itself.

Resolves NixOS#116235.
@sternenseemann sternenseemann force-pushed the ghcWithPackages-withLLVM branch from 1c87144 to 9a2e728 Compare May 3, 2021 08:43
@sternenseemann sternenseemann requested a review from maralorn as a code owner May 3, 2021 08:43
@maralorn maralorn merged commit 3590478 into NixOS:haskell-updates May 3, 2021
@sternenseemann sternenseemann deleted the ghcWithPackages-withLLVM branch May 3, 2021 09:48
@sternenseemann sternenseemann restored the ghcWithPackages-withLLVM branch July 24, 2021 13:36
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 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants