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

#266: cabal haddock plus cpp preprocessing with relative #include files ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | ----------------------------+----------------------------------------------- All these bugs are against the homeomorphic library I have written. To play along, you can do darcs get --partial http://www.cs.york.ac.uk/fp/darcs/homeomorphic Bug 2: cabal haddock fails $ cabal haddock Preprocessing library homeomorphic-0.1... Running Haddock for homeomorphic-0.1... Warning: The documentation for the following packages are not installed. No links will be generated to these packages: base-3.0.1.0, QuickCheck-1.1.0.0, mtl-1.1.0.0, containers-0.1.0.1 dist/build/tmp/Data/Homeomorphic/Hash1.hs:4:0: Include/Hash.hs: No such file or directory This one may well be my fault, if some extra magic is required for the haddock with CPP, but not the building - but that seems weird, if there is enough info to build the file, surely there is enough info to haddock it Duncan says: Right, there is no such guarantee at the moment. That's because ghc --make can find things by import chasing where Cabal needs more stuff specified explicitly. One day when Cabal does the import chasing they'll be consistent. In this case though it doesn't look like on of those problems. It seems to be because for haddock we're copying files to dist/ and then running cpp on them. That means of course that relative #includes do not work. It's not entirely clear to me why we are copying them before running cpp and not just running cpp on the files from their original locations. Please file a ticket for this one. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/266 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#266: cabal haddock plus cpp preprocessing with relative #include files ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Cabal-1.6 Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * milestone: => Cabal-1.6 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/266#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#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@gmail.com (added) * milestone: Cabal-1.6 => Cabal-1.8 Comment: 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

#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:
----------------------------+-----------------------------------------------
Comment (by Saizan):
This should be fixed in Cabal HEAD by
{{{
Thu Feb 19 16:37:38 CET 2009 Andrea Vezzosi
participants (1)
-
Hackage