[Haskell-cafe] Hackage/Cabal/Haddock question

Thomas Hartman tphyahoo at gmail.com
Mon Nov 24 22:00:42 EST 2008


I've noticed that many of the packages I upload to haddock don't build
documentation properly, although the documentation builds fine locally
when I run "cabal haddock".

For example:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HAppSHelpers

is fine in my local environment.

I am not using quasiquotation. This also seems to be affecting many of
the other happs bundles.

thomas.

2008/11/21 Robert Greayer <robgreayer at yahoo.com>:
> How does Hackage run 'haddock' on uploaded packages?  I had assumed it directly runs the cabal 'haddock' target, e.g.
>
> runhaskell Setup.hs haddock
>
> but it appears to perhaps be more complex than that.
>
> Some backrgound --
>
> haddock doesn't seem to like quasiquotation - running haddock on a source tree that includes quasiquotations eventually results in:
>
> haddock: internal Haddock or GHC error: Maybe.fromJust: Nothing
>
> (eliminating the code that contains [$xxx|....] constructs gets rid of the error.)
>
> so "runhaskell Setup.hs haddock" ends up not generating any documentation.  I worked around this problem by using a 'UserHook' and adding in an extra path element to the source path prior to running haddock via Cabal:
>
>> main = defaultMainWithHooks (simpleUserHooks {
>>     preHaddock = \_ _ -> return (Just $ emptyBuildInfo { hsSourceDirs = ["noqqsrc"]},[]) })
>
> The additional directory contains an alternate version of modules that don't contain quasiquotation (just types and stubs), which seems to hide the versions that do.  This works fine locally, but not on hackage (still get the same behavior in the build failure log).  Of course, I'd prefer not to have to do this at all, so if anyone knows a way around the problem (or if its purely my problem -- I'm doing something wrong), I'd appreciate hearing about it.
>
> I'm using GHC 6.10.1, and have tried setup haddock with both the shipped-with-ghc version of haddock and the latest version.
>
> Thanks,
> rcg
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list