HsOpenSSL icon indicating copy to clipboard operation
HsOpenSSL copied to clipboard

Hack to include `cabal_macros.h` causes build failure with stack / GHC 9.10

Open andreasabel opened this issue 7 months ago • 4 comments

https://github.com/haskell-cryptography/HsOpenSSL/blob/b7a4999f34214b13c8d52a745e837f9e3db83583/cbits/HsOpenSSL.h#L23-L33

HsOpenSSL                        > Building library for HsOpenSSL-0.11.7.7...
HsOpenSSL                        > [ 1 of 33] Compiling OpenSSL
HsOpenSSL                        > /private/var/folders/lg/qcd3v89j59l3m6520kr42bdm0000gn/T/stack-88a7366d6a42ff03/HsOpenSSL-0.11.7.7/In file included from /var/folders/lg/qcd3v89j59l3m6520kr42bdm0000gn/T/ghc51255_0/ghc_22.c:7:0: error:
HsOpenSSL                        > [ 2 of 33] Compiling OpenSSL.DH.Internal
HsOpenSSL                        >                 
HsOpenSSL                        >                 
HsOpenSSL                        > /private/var/folders/lg/qcd3v89j59l3m6520kr42bdm0000gn/T/stack-88a7366d6a42ff03/HsOpenSSL-0.11.7.7/cbits/HsOpenSSL.h:32:12: error:
HsOpenSSL                        >      fatal error: '../dist/build/autogen/cabal_macros.h' file not found
HsOpenSSL                        >    |            
HsOpenSSL                        > 32 | #  include "../dist/build/autogen/cabal_macros.h"
HsOpenSSL                        >    |            ^
HsOpenSSL                        >                 
HsOpenSSL                        > #  include "../dist/build/autogen/cabal_macros.h"
HsOpenSSL                        >            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HsOpenSSL                        > 1 error generated.
HsOpenSSL                        > <no location info>: error:
HsOpenSSL                        >     `gcc' failed in phase `C Compiler'. (Exit code: 1)
HsOpenSSL                        >               

This happens when I build a project with stack that uses HsOpenSSL (does not happen when I do stack build in the HsOpenSSL project). I am on macOS (Monterey). The problem is not limited to macOS, though https://github.com/hackage-trustees/hackage-cli/actions/runs/9759798062/job/26937247345:

  • Ubuntu: https://github.com/hackage-trustees/hackage-cli/actions/runs/9758418998/job/26932915407?pr=72#step:8:4040
  • Windows: https://github.com/hackage-trustees/hackage-cli/actions/runs/9758418998/job/26932917641?pr=72#step:8:3846

Not sure what the reason is that the hack no longer works with GHC 9.10. Maybe a change in the Cabal library?

andreasabel avatar Jul 02 '24 08:07 andreasabel