Describe the bug
On aarch64-linux, if you try to build a haskell project in a nix-shell with ghcWithPackages, it will often fail because ghcWithPackages' withLLVM parameter defaults to false, but GHC on aarch64 requires the llvm executables opt and llc to compile things. There is no documentation mentioning the withLLVM parameter, and it's not clear whether it is possible for the user to override it.
To Reproduce
Steps to reproduce the behavior:
- Get the source code for a haskell project (As an example
git clone https://github.com/nick8325/quickcheck && cd quickcheck)
- Spawn a shell with the necessary dependencies and try to build the project:
nix-shell --pure -p cabal-install "haskellPackages.ghcWithPackages (pkgs: with pkgs; [ splitmix random ])" --run "cabal build"
It will fail with something like
<no location info>: error:
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM 9
ghc: could not execute: opt
If I change withLLVM to true in nixpkgs, it builds successfully.
Expected behavior
It should successfully build the project (or it should be documented / easy for the user to specify withLLVM = true themselves)
Notify maintainers
@maralorn @peti @Ericson2314 @abbradar @matthewbauer
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
- system:
"aarch64-linux"
- host os:
Linux 5.10.0-rc5, NixOS, 21.05.git.9e76aa2cca8M (Okapi)
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.3.10
- channels(root):
"nixos-20.03.git.0c1c18c"
- nixpkgs:
/home/thrall/nixpkgs
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
ghcWithPackages
# a list of nixos modules affected by the problem
module:
Describe the bug
On aarch64-linux, if you try to build a haskell project in a nix-shell with ghcWithPackages, it will often fail because ghcWithPackages'
withLLVMparameter defaults tofalse, but GHC on aarch64 requires the llvm executables opt and llc to compile things. There is no documentation mentioning thewithLLVMparameter, and it's not clear whether it is possible for the user to override it.To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/nick8325/quickcheck && cd quickcheck)It will fail with something like
If I change
withLLVMtotruein nixpkgs, it builds successfully.Expected behavior
It should successfully build the project (or it should be documented / easy for the user to specify
withLLVM = truethemselves)Notify maintainers
@maralorn @peti @Ericson2314 @abbradar @matthewbauer
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"and paste the result."aarch64-linux"Linux 5.10.0-rc5, NixOS, 21.05.git.9e76aa2cca8M (Okapi)yesyesnix-env (Nix) 2.3.10"nixos-20.03.git.0c1c18c"/home/thrall/nixpkgsMaintainer information: