-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Support for macOS Big Sur (11.x) and aarch64/M1/Silicon arch #2008
Comments
FYI, HLS installs and works properly with macOS Big Sur 11.4 on my Intel Mac as long as I don't use |
So it can be not only os version dependent but also on arch, how quaint! 😝 But afaik there is only one ghc version for Mac and I guess it is not built on a M1 machine (??) |
Thanks for looking into this. Just to give a bit of context, this is what I did: I installed I also tried to do it via visual studio code with the Haskell extension. This downloads its own HLS binary, but it also fails. This is the error I get:
Since it's complaining about some sort of assembly language, I assume it has to do with the M1 chip. If there is something I can do to debug this issue, please let me know. |
For cross-reference cf. Homebrew/brew#10152 and the pull request Homebrew/homebrew-core#65997 referenced therein. Homebrew now provides both @jneira: As for the issue you mention in your second bullet point, you might want to look into the HLS "formula" and specifically its Ruby code. As for the GitHub Actions environment, I believe it may yet be reasonable to also build in https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md for the most recent macOS version, provided the resource constraints would still be met. Besides, M1 Macs can't run macOS prior to 11 (Big Sur), and the next release (Monterey) is already available in a public beta preview release and expected this fall. In addition, there are Homebrew "formulas" for Cabal and Stack. There is however unfortunately no Stackage LTS snapshot as of today that would support GHC 8.10.5 -- I've just opened an issue commercialhaskell/stackage#6115 concerning this caveat Everything else mentioned above just works on my M1 Macs running the most recent macOS Big Sur version 11.4. |
@Jaxan: Did you try the Homebrew HLS version? If it doesn't work either, the root cause might be different. Which Clang version do you have on that machine? In particular, your log states
|
My system is relatively new and I did very little custom configuration. I installed Xcode and the command line tools (via the gui of Xcode). So it should be the "normal" clang people will have when they start developing on M1 Macs:
No I haven't tried it before. Let me try ... (some time later) ... Hurray it works 🥳. Visual studio code automatically finds the brew version and it reports some warnings in the IDE. So it seems to be a problem of installing the right version, not a problem with the tools themselves. Thanks for pointing out this way of installing HLS. |
This one and #1896 are essentially duplicates afaiu |
From a @pepeiborra comment in #1896: GHC 8.10.5 is out including native binaries for the Apple M1 hardware: https://www.haskell.org/ghc/blog/20210605-ghc-8.10.5-released.html What do we need in order to create and distribute Apple M1 binaries?
I've set the checklist in the issue description. So afaiu we are blocked upstream on actions/runner-images#2187 |
Use gitlab.haskell.org CI infrastructure, which supports everything GHC supports (including M1, FreeBSD, ...). |
Wow that would be a big change in our ci setup and we considered it to get more performance: #2039 (comment) |
Opened an issue in the vscode extension to add the automatic download of artifacts for apple aarch64: haskell/vscode-haskell#458 |
I've added to main description the actual ways to get a working executable in aarch64:
|
We are building hls on macos + aarch in gitlab and the binaries used in ghcup are also included in our release artifacts. |
Issue tracking the automatic download of macos aarch binaries in vsocde here: haskell/vscode-haskell#458 |
I think we can close this as the missing piece in the extension is tracked in the issue linked above |
Apologies if this is the wrong place to comment, but the release artifacts for haskell-language-server-macOS-aarch64-1.6.1.0.tar.xz only contains a binary compiled against 8.10.7 (and not 9.2.1 or any other version). Is there some fundamental limitation preventing HLS from working with GHC 9.2.1 on M1 architecture? |
Yes, 9.2.1 is busted on M1 https://gitlab.haskell.org/ghc/ghc/-/issues/20592 |
Actual ways to get a working hls executable:
brew
ghcup
Issue to track the support of hls for this new macOS version
We use github environments to build the binaries and we depend on its supported arch/os versions. Actually we are building macos binaries with this env: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md (macos-latest aka macos 10.15)
Not an expert in mac envs but it seems M1 need Big Sur, which is macos 11.00. Github envs has an env for 11.0 but i guess it will be incompatible with older version of macos, so we would have to maintain two macos version in the test and build ci workflows (which has already a big load). In any case it worths to have an issue in the project to track progress in the support of the new version.
Anyways does the official ghc version works for big sur? the download page talks about macOS X: https://www.haskell.org/ghc/distribution_packages.html#macosx
It seems it works with some caveats: https://www.reddit.com/r/haskell/comments/k9r2cy/workaround_for_haskell_woes_on_macos_11_big_sur/
so maybe the hls version buils for maOS 10.15 would work for 11.x?
UPDATE from #1896
What do we need in order to create and distribute Apple M1 binaries?
//cc @Jaxan
The text was updated successfully, but these errors were encountered: