-
Notifications
You must be signed in to change notification settings - Fork 711
setup haddock ignores LANGUAGE CPP pragma #223
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
Comments
(Imported comment by @dcoutts on 2008-02-04) Of course that's because it is GHC that interprets the {-# LANGUAGE CPP #-} pragma and not Cabal. Long term I think Cabal should notice LANGUAGE pragmas. It'd allow it to check that all extensions are declared in the .cabal file and it'd allow Cabal to do the cpping itself rather than using ghc's cpp. I'm assigning it to milestone 2.0 because it should be easy enough if we're already reading .hs files to do module chasing. |
(Imported comment by ross on 2008-02-04) Distribution.Simple.Hugs.getOptionsFromSource may be useful. |
(Imported comment by @dcoutts on 2008-02-05) And of course we have the same problem with {-# OPTIONS -fglasgow-exts -cpp #-} which is generated by alex. So even if you didn't realise you use CPP, if you use alex then you do and then haddock fails because we don't run cpp on that file. So if we go looking for LANGUAGE pragmas then we'd also have to do the same for OPTIONS (and OPTIONS_*) pragmas. Seems that getOptionsFromSource gets those too which is nice. Perhaps we should just do that for every file in builds and when haddocking. |
This works for me now so I guess it got fixed at some point. |
Why is this issue closed? I could reproduce the issue with Cabal-1.18.0 and cabal-install-1.18.0. |
I said 7 months ago:
Perhaps it broken again. Do you have simple complete repro example? |
Yes. See https://github.com/asr/cabal-issue223 If I remove $ cabal haddock --executables
Running Haddock for issue223-0.1...
Preprocessing executable 'issue223' for issue223-0.1...
dist/build/tmp-14523/Main.hs:5:0:
fatal error: Empty.h: No such file or directory
compilation terminated. |
I could reproduce the issue with $ cabal --v
cabal-install version 1.20.0.1
using version 1.20.0.0 of the Cabal library Could someone reopen the issue please. |
I just ran into this too with jgm/zip-archive. |
This fixes haddock build. See haskell/cabal#223
/me wonders if this has been fixed by #1854. |
I requested reopen the issue some days ago. The issue is fixed by #1854. Thanks! |
@asr Great. Closing. |
(Imported from Trac #230, reported by ross on 2008-02-04)
setup haddock preprocesses sources with cpp if CPP is included in the extensions field, but not if a source file starts with
This is confusing, because that works with setup build.The text was updated successfully, but these errors were encountered: