haskell / network

Low-level networking interface
http://hackage.haskell.org/package/network
Other
325 stars 187 forks source link

Remove `includes` from `.cabal`-file #582

Closed sol closed 3 months ago

sol commented 3 months ago

This is useless at best, and a common source of confusion.

https://github.com/haskell/cabal/pull/10145 https://github.com/sol/hpack/issues/355

kazu-yamamoto commented 3 months ago

I need to understand why CI fails on Windows.

kazu-yamamoto commented 3 months ago

@sol With this patch, the following error occurs on Windows:

Error: cabal.exe: Bad header file: afunix_compat.h
sol commented 3 months ago

@kazu-yamamoto that's interesting, let me investigate.

sol commented 3 months ago

The full message is:

Bad header file: afunix_compat.h
The header file contains a compile error. You can re-run configure with the
verbosity flag -v3 to see the error messages from the C compiler.

Which is generated here: https://github.com/haskell/cabal/blob/bf6f26dc2c02cce24b0d0f429b1b0fdabaa14028/Cabal/src/Distribution/Simple/Errors.hs#L656-L658

Which I think originates from here: https://github.com/haskell/cabal/blob/bf6f26dc2c02cce24b0d0f429b1b0fdabaa14028/Cabal/src/Distribution/Simple/Configure.hs#L2546-L2569

@mpilgrem so it seems that while includes is effectively ignored and never passed to ghc nor gcc, Cabal still tries to "validate" those headers in some way, likely for historic reasons (some of the code is really old).

sol commented 3 months ago

@kazu-yamamoto https://github.com/haskell/network/pull/582/commits/6e0c76ae1aad3c2ccb8a5a8ff74a3e1b4aea20eb fixes the windows build, but I just noticed that you already discovered that yourself in #583.

kazu-yamamoto commented 3 months ago

@sol Sorry. I did not notice your latest messages. I reached the same conclusion and merged #582. Let's close this. Thank you for your contribution!