3

After I upload my package into hackages, it didn't generate haddock as others packages.

Anything I missed?

What I did is:

  1. cabal dist and a package generated under dist directory.
  2. open hackage web upload interface and upload the package.
  3. open the URL and turns out package uploaded successfully but no haddock. (the package do have a few docs)

Thank you.

Simon
  • 2,990
  • 3
  • 20
  • 17

3 Answers3

6

Docs take a little bit of time to generate. I believe they are ran at midnight GMT.

Thomas M. DuBuisson
  • 64,245
  • 7
  • 109
  • 166
1

In addition to Thomas's answer, run cabal haddock in your package directory and look for any errors.

Haddock is incredibly finicky in my experience, especially wrt. code blocks. If you get a parse error, just start deleting comments until docs can be generated. I usually use some extensively-documented package as a reference.

jberryman
  • 16,334
  • 5
  • 42
  • 83
0

It looks like the documentation is missing because your package didn't build correctly. I found this near the end of the build log:

src/Network/OAuth2/HTTP/HttpClient.hs:18:8:
    Could not find module `Control.Monad.Trans.Resource'
    It is a member of the hidden package `resourcet-0.3.2.1'.
    Perhaps you need to add `resourcet' to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.

To avoid these sorts of problems, make sure your package builds locally with Cabal before uploading. Building with GHC directly will often mask these sorts of problems, since it will happily use whatever packages you have installed, regardless of whether you've mentioned them in your .cabal file or not.

hammar
  • 138,522
  • 17
  • 304
  • 385
  • Actually I don't think the error make sense to me cause module `Control.Monad.Trans.Resource' is member of conduit. I'm able to build in my local with ghc-7.0.2 thus I'm wondering if a way to tell Hackages use specific version of GHC. – Simon Apr 30 '12 at 02:48
  • 2
    I think I found the reason. I did not specify upper limit of conduit therefore Hackages use latest one which removed the `Resource` API. – Simon Apr 30 '12 at 03:07