[Hackage] #230: setup haddock ignores LANGUAGE CPP pragma

#230: setup haddock ignores LANGUAGE CPP pragma ----------------------------------+----------------------------------------- Reporter: ross@soi.city.ac.uk | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------------+----------------------------------------- `setup haddock` preprocesses sources with cpp if `CPP` is included in the `extensions` field, but not if a source file starts with {{{ {-# LANGUAGE CPP #-} }}} This is confusing, because that works with `setup build`. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/230 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#230: setup haddock ignores LANGUAGE CPP pragma ----------------------------------+----------------------------------------- Reporter: ross@soi.city.ac.uk | Owner: Type: defect | Status: new Priority: normal | Milestone: Cabal-2.0 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------------+----------------------------------------- Changes (by duncan): * milestone: => Cabal-2.0 Comment: 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. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/230#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#230: setup haddock ignores LANGUAGE CPP pragma ----------------------------------+----------------------------------------- Reporter: ross@soi.city.ac.uk | Owner: Type: defect | Status: new Priority: normal | Milestone: Cabal-2.0 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------------+----------------------------------------- Comment (by ross@soi.city.ac.uk): `Distribution.Simple.Hugs.getOptionsFromSource` may be useful. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/230#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#230: setup haddock ignores LANGUAGE CPP pragma ----------------------------------+----------------------------------------- Reporter: ross@soi.city.ac.uk | Owner: Type: defect | Status: new Priority: normal | Milestone: Cabal-2.0 Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------------+----------------------------------------- Comment (by duncan): 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. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/230#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage