haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
199 stars 50 forks source link

cabal install fails with ghc-options=-haddock #229

Closed jwaldmann closed 4 years ago

jwaldmann commented 5 years ago
cabal install c2hs --ghc-options=-haddock
...
Building executable 'c2hs' for c2hs-0.28.6..

src/C2HS/C/Names.hs:1:1: error:
    File name does not match module name:
    Saw: ‘Main’
    Expected: ‘C2HS.C.Names’
  |
1 | --  C->Haskell Compiler: C name analysis
  | ^

I think this is caused by https://ghc.haskell.org/trac/ghc/ticket/8944.

I am recording it here as it was highly non-obvious to me (I needed some time to recall that I have -haddock in my .cabal/config)

In the cabal tracker: https://github.com/haskell/cabal/issues/5827

georgefst commented 4 years ago

I've just hit this when trying to use haskell-language-server with a project that relies on c2hs. See #253.

But this will be a non-issue when !2377 lands, turning these from errors to warnings. I'm told that will probably be in GHC 8.12.