[Haskell-cafe] GHC bug? Cabal bug? Haddock bug?

David Waern david.waern at gmail.com
Fri Jan 22 17:39:43 EST 2010

2010/1/17 Mark Lentczner <markl at glyphic.com>:
> AHA!
>> Note that after running "cabal haddock" we re-build all of our .hi and
>> .o files EXCEPT ./dist/build/HSsyb-with-class-0.6.1.o
>> And now, since TH generates random symbols, we have symbols in the new
>> .hi files that aren't in the old (and only) HSsyb-with-class-0.6.1.o.
> So, this leaves us with two questions:
> 1) Why does "cabal haddock" rebuild the .hi and .o files? On the face of it, this seems odd: Build documentation and your library gets rebuilt?

Maybe this has already been answered elsewhere: when TH is involved
Haddock may rebuild your library. In this case Cabal is directing
Haddock's output to the same place that is used for normal builds.
This bug has been fixed in Cabal.

> 2) Why doesn't Instances.o get rebuilt? Surely this has something to do with the fact that Instances.hs contains only orphan instances. But any answer here just leads to a raft of other questions:
>        Surely this problem would plague other modules have have similar source files?
>        What is Haddock doing?
>        If Haddock needs the .hi files, why not just use them?
>        If it just "builds them to be sure", why in the dist tree and not some place temporary?
>        If is going to build .o files, why not all?

Not sure why Instances.o isn't rebuilt.


More information about the Haskell-Cafe mailing list