Open Futarimiti opened 5 months ago
If you, like me, are looking for workarounds for older compilers:
package *
ghc-options: -pgmc /opt/homebrew/opt/llvm@12/bin/clang
I have exactly the same error. However, I'm working with stack rather than cabal. This is the error message I get:
/private/var/folders/qw/7h1cg8qx44g1v_p4s7m_ptqr0000gq/T/stack-9f9a28f5b2a93a36/hexpat-0.20.13//var/folders/qw/7h1cg8qx44g1v_p4s7m_ptqr0000gq/T/ghc80085_0/ghc_4.c:19:17: error:
error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion]
|
19 | *(ffi_arg*)resp = cret;
| ^
*(ffi_arg*)resp = cret;
^ ~~~~
1 error generated.
<no location info>: error:
`gcc' failed in phase `C Compiler'. (Exit code: 1)
For the full log, click here.
We couldn't get ghc to use a different c compiler, as suggested above by @AbsoluteNikola, because we couldn't figure out how to change the package.yaml
file. We checked that /opt/homebrew/opt/llvm@12/bin/clang
exists and that it executes from the command line. We added the following line to the package.yaml
file, but that produced the same error.
ghc-options:
- -pgmc /opt/homebrew/opt/llvm@12/bin/clang
The mistake prevails and effectively blocks us from using hexpat in our project.
Can you help us out? Any suggestions? workarounds?
macos 12 does not have this problem yet. However, macos 14 does. I expect more and more projects will suffer from this issue, because a lot of them depend on hexpat.
I have been doing some more investigation. The root-cause seems to be the mentioned incompatible pointer to integer conversion
. However, previously this was reported as a warning, but now it is throwing an error.
For the time being, a sufficient workaround is to build on macos 12, not macos 14. However, this does not take away the root cause, fixing this error in hexpat itself. I do wonder if @the-real-blackh is still actively maintaining this repo?
I do wonder if @the-real-blackh is still actively maintaining this repo?
I haven't been.
This is a GHC bug:
And the fix has been backported to GHC 9.6.5 & 9.8.2
I am on macOS 14.4.1 (23E224) using ghc-9.4.8 to build hexpat-0.20.13, gcc Apple clang version 15.0.0 (clang-1500.3.9.4). The following error was thrown: