-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cross compilers to haskell.nix flake devShell #868
Comments
Do the same a you would for a non cross compiling shell, but instead of using
|
Thanks @hamishmack! That quite fits the bill. |
I'm trying to build with TH and this shell is missing the iserv-proxy and remote-iserv that would be necessary. I'll share here if I can figure out how to get those. |
Here's my best attempt so far: let crossPkgs = pkgs.pkgsCross.aarch64-multiplatform;
haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/b406bb1d5bed581f651ae18a5d3ed07f47ace2b9.tar.gz) {};
pkgs = import haskellNix.sources.nixpkgs haskellNix.nixpkgsArgs;
in
pkgs.mkShell {
buildInputs =
[ pkgs.buildPackages.ghc-extra-packages.ghc8102.iserv-proxy.components.exes.iserv-proxy
crossPkgs.ghc-extra-packages.ghc8102.remote-iserv.components.exes.remote-iserv
crossPkgs.buildPackages.haskell-nix.compiler.ghc8102
pkgs.buildPackages.qemu
];
} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We recently added basic ghc devShells so we could use them in GitHub actions to test building projects without haskell.nix. Lines 147 to 154 in a306656
It would be really nice to add cross compilation including aarch64 to those. @facundominguez did the above code work in the end? Did you have to tell ghc where to look for iserv or did it find? If not then I suspect we might need some of the code from https://github.com/input-output-hk/haskell.nix/blob/master/overlays/linux-cross.nix |
It worked well enough. Instead of using |
I'm trying to get a shell with a cross-compiler and having some difficulties.
The documentation on cross-compilation says how to build a project with either stack or cabal. I'm aiming to build with bazel, though, and I'm only interested in getting the build tools.
I found my way to get a native compiler in a shell for a dummy cabal project. However, haskell.nix has resisted all my attempts to get the shell with a cross-compiler for aarch64. My nix code is not very succinct either, which prods me to ask for an example from a more knowledgeable person.
Thanks in advance.
The text was updated successfully, but these errors were encountered: