haddock2 is not passed cpp-options #231

bos opened this Issue May 24, 2012 · 2 comments


None yet

1 participant

Haskell member

(Imported from Trac #238, reported by ross on 2008-02-13)

With haddock-1, Cabal invokes cpp, passing it ARCH and OS defines, -DHADDOCK and the contents of cpp-options. However haddock-2 invokes cpp itself via the GHC API, which passes this cpp the ARCH and OS defines, but it doesn't get the others.

It might also be a good idea to give HADDOCK a numeric value, because GHC extensions need not be hidden from the new one.

Haskell member

(Imported comment by @dcoutts on 2008-02-13)

I thought we wanted to avoid using -DHADDOCK precisely because haddock-2.0 can parse everything that ghc can, and so people should not need cpp hacks. Even if we use -DHADDOCK=2 we'll end up seeing the old workaround code that people show to haddock-0.x.

We should be passing the cpp-options of course.

IMHO, we should still make Cabal do the pre-processing rather than have ghc do it, but that's part of a larger task.

Haskell member

(Imported comment by @dcoutts on 2008-02-13)

Fixed ages ago by:

Thu Aug 28 15:23:03 BST 2008  Ian Lynagh <igloo@earth.li>
  * We need to pass the CPP options to haddock 2
    hunk ./Distribution/Simple/Haddock.hs 355
    +  ++ ["-optP" ++ opt | opt <- cppOptions bi]
@bos bos closed this May 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment