[Hackage] #266: cabal haddock plus cpp preprocessing with relative #include files

Hackage trac at galois.com
Thu Jan 22 11:19:55 EST 2009

#266: cabal haddock plus cpp preprocessing with relative #include files
  Reporter:  guest          |        Owner:           
      Type:  defect         |       Status:  new      
  Priority:  normal         |    Milestone:  Cabal-1.8
 Component:  Cabal library  |      Version:  HEAD     
  Severity:  normal         |   Resolution:           
  Keywords:                 |   Difficulty:  normal   
Ghcversion:  6.8.2          |     Platform:           
Changes (by duncan):

 * cc: ndmitchell at gmail.com (added)
  * milestone:  Cabal-1.6 => Cabal-1.8


 So the problem is that when using haddock-0.x we copy all .hs files into a
 temporary directory before running cpp on them. That's the source of the
 issue, because cpp includes are relative to the location of the file (as
 well as -I search path). So when we copy the .hs file but not the file
 that it `#includes` then it cannot be found.

 The solution I think is to not copy them, but to cpp the file from it's
 original location directly to the destination directory. For .lhs files,
 we should cpp first and then unlit, not the other way around.

 I'm a bit nervous about making this change in a stable release. I'm
 tempted to punt it to Cabal-1.8. Generally the whole haddock module needs
 rewriting. It's a big jumbled inconsistent mess, especially the way it
 handles pre-processing and the differences between haddock 0.x and 2.x.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/266#comment:2>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list