Skip to content
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

Unable to compile on Mac M1 architecture #261

Closed
MatthewDaggitt opened this issue Nov 17, 2022 · 2 comments
Closed

Unable to compile on Mac M1 architecture #261

MatthewDaggitt opened this issue Nov 17, 2022 · 2 comments

Comments

@MatthewDaggitt
Copy link

We're struggling to compile hashable on a Mac M1 laptop:

macOS Monterey
Version 12.1(21C52)

MacBook Pro (13-inch, M1, 2020)
Chip Apple M1
Memory 16 GB

The error message we get is:

Failed to build hashable-1.4.1.0.
Build log (
/Users/marcocasadio/.cabal/logs/ghc-9.0.2/hshbl-1.4.1.0-865f38d3.log ):
Configuring library for hashable-1.4.1.0..
Preprocessing library for hashable-1.4.1.0..
Building library for hashable-1.4.1.0..
[1 of 7] Compiling Data.Hashable.Imports ( src/Data/Hashable/Imports.hs, dist/build/Data/Hashable/Imports.o, dist/build/Data/Hashable/Imports.dyn_o )
[2 of 7] Compiling Data.Hashable.LowLevel ( src/Data/Hashable/LowLevel.hs, dist/build/Data/Hashable/LowLevel.o, dist/build/Data/Hashable/LowLevel.dyn_o )

In file included from /var/folders/9_/9l6qz02n6yz4qlgqvdfr1f500000gn/T/ghc9908_0/ghc_20.c:4:0: error:
    

In file included from /Users/marcocasadio/.ghcup/ghc/9.0.2/lib/ghc-9.0.2/lib/../lib/aarch64-osx-ghc-9.0.2/rts-1.0.2/include/ffi.h:66:0: error:
    

/Users/marcocasadio/.ghcup/ghc/9.0.2/lib/ghc-9.0.2/lib/../lib/aarch64-osx-ghc-9.0.2/rts-1.0.2/include/ffitarget.h:6:10: error:
     fatal error: 'ffitarget_arm64.h' file not found
  |
6 | #include "ffitarget_arm64.h"
  |          ^
#include "ffitarget_arm64.h"
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build hashable-1.4.1.0 (which is required by
exe:vehicle-new-golden-test from vehicle-0.1.0 and exe:vehicle from
vehicle-0.1.0). See the build log above for details.

Do you have any advice?

@phadej
Copy link
Contributor

phadej commented Nov 17, 2022

This looks like a GHC issue (that #include is generated by GHC). Open an issue on https://gitlab.haskell.org/ghc/ghc/

EDIT: but given you are using GHC-9.0, you will most likely asked to try with GHC-9.2 or 9.4.

@MatthewDaggitt
Copy link
Author

Thanks @phadej!

For those with the same problem, the relevant GHC issue is here and the problem was apparently fixed in GHC 9.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants