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

Failure in building #15

Open
Futarimiti opened this issue Apr 17, 2024 · 7 comments
Open

Failure in building #15

Futarimiti opened this issue Apr 17, 2024 · 7 comments

Comments

@Futarimiti
Copy link

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:

/var/folders/h1/vvswnzxd54lfr9n3t32k29wc0000gn/T/ghc43096_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.
@AbsoluteNikola
Copy link

If you, like me, are looking for workarounds for older compilers:

  1. install older llvm. llvm@12 works good for me
  2. add these lines in cabal.project.local (or similar for stack)
package *
  ghc-options: -pgmc /opt/homebrew/opt/llvm@12/bin/clang

@stefjoosten
Copy link

stefjoosten commented Aug 7, 2024

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.

Please...

Can you help us out? Any suggestions? workarounds?

@hanjoosten
Copy link

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.

@hanjoosten
Copy link

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.

@hanjoosten
Copy link

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?

@the-real-blackh
Copy link
Owner

I do wonder if @the-real-blackh is still actively maintaining this repo?

I haven't been.

@prikhi
Copy link
Collaborator

prikhi commented Sep 8, 2024

This is a GHC bug:

And the fix has been backported to GHC 9.6.5 & 9.8.2

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

6 participants