-
Notifications
You must be signed in to change notification settings - Fork 81
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
Improve support for aarch64 #1825
Conversation
🎉 All dependencies have been resolved ! |
886b8e6
to
e5cc97a
Compare
We've tested this and it works fine, I've gotten to the point where I can see haskell packages being compiled using ghc 9.2. There are a few other issues though
(update): So it seems the errors I'm seeing when using the nightly snapshot is actually the same error previously reported as fixed here: Error being this:
|
The compiler backend is configurable. See https://downloads.haskell.org/ghc/latest/docs/users_guide/codegens.html#llvm-code-gen So you could pass
Yes, we need the modules to be relocatable. Unfortunately, this has been broken in Cabal since version 3.6.0 and was only recently fixed by haskell/cabal#8220. |
I don't believe this will work on versions prior to 9.2 as it didn't have a native backend for arm64 until then (assuming I read the release notes correctly: https://discourse.haskell.org/t/ghc-9-2-1-released/3527)
ah, that's great news -- don't think there is much to do except to wait for that commit to end up in a cabal release then. Let me know if you have any other ideas how to work around this. I think ghc really should have a way for the user to provide a path to the llvm installation at runtime instead of relying on PATH. That said, considering that's not available now, perhaps we could add an option to rules_haskell to extend PATH in the ghc rule for finding required tools (based on the backend selected)? |
Well, it does. You can use the various flags to set up a specific command for a tool. |
ah, that should unblock us. Thanks for that pointer -- I think we're good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I merged the support for GHC 9.2.5 just before reviewing this, creating conflicts. They seemed simple to solve, but you may check that I did not miss anything.
Otherwise, looks great!
These need bit of special handling, since the content of the tarball is different from the offical bindists and the executable file lack the executable bit.
The [`get_cpu_value` function](https://github.com/bazelbuild/bazel/blob/183c8a42950deb4865e009e83748d4e090fe46d4/tools/cpp/lib_cc_configure.bzl#L180-L209) returns "k8" as a last resort, if other OSes have been ruled out already and the "arch" is 64bit. Similarly, if the OS is *not* identified as Mac OS, Windows, FreeBSD or OpenBSD it simply returns "aarch64" when "arch" is "aarch64" and we assume this to be Linux.
... according to the os and architecture. This way it should just work for future GHC versions, if the packaging scheme is not changed upstream. It is still possible to override these settings if need be. Fixes #1809
Thank you, @GuillaumeGen ! I manually rebased against the default branch and removed the GHC prefixes, lib and so on for GHC 9.2.5 so it is also handled generically. |
Fixes #1823
Fixes #1809
Fixes #1821
Depends on #1808