Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new-haddock can't produce documentation suitable for Hackage? #5341

Closed
RyanGlScott opened this issue May 23, 2018 · 5 comments
Closed

new-haddock can't produce documentation suitable for Hackage? #5341

RyanGlScott opened this issue May 23, 2018 · 5 comments

Comments

@RyanGlScott
Copy link
Member

I'm not sure if this is expected behavior or not, but it's certainly throwing me for a loop. I occasionally need to upload Haddocks to Hackage manually. With old-style cabal, my usual workflow would be:

  1. Create a sandbox.
  2. Install all dependencies with --enable-documentation on.
  3. Run cabal haddock --for-hackage.
  4. Run cabal upload -d <doc-tarball> --publish

I'm trying to figure out how to emulate this workflow with new-haddock, but it doesn't seem to be quite up to the task. My first inclination was to try this:

$ cabal new-build --enable-documentation

However, this did not build my dependencies with documentation enabled. It simply built the package itself (using previously built versions of the dependencies, without documentation) and ran Haddock on the package, and unsurprisingly, that resulted in unbound link destinations:

Warning: Data.Eliminator.TH: could not find link destinations for:
    ~> Sing @@
Warning: Data.Eliminator: could not find link destinations for:
    ~> Sing @@ Nat Z S
Warning: Data.Eliminator.TypeNats: could not find link destinations for:
    ~> Sing @@

Passing --haddock-for-hackage didn't seem to help either.

I also tried directly invoking cabal new-haddock --haddock-for-hackage, but that too did not build the dependencies with documentation enabled.

@23Skidoo
Copy link
Member

23Skidoo commented Jun 8, 2018

I think new-haddock should support this. Most likely just an unfinished feature.

@hvr
Copy link
Member

hvr commented Jun 8, 2018

@alexbiehl ...do you remember what's missing here? did we ever create a ticket about lazy haddocking?

@merijn
Copy link
Collaborator

merijn commented Jun 11, 2018

I think this works in HEAD or one of Alex's branches, since I've successfully build and uploaded Hackage docs using new-haddock 1 or 2 months ago when he was working on that. To the best of my knowledge it's still broken in the last released cabal-install?

@RyanGlScott are you using cabal-install HEAD or older?

@RyanGlScott
Copy link
Member Author

@merijn, I used cabal-install-2.2 in my original attempt. I just tried to use the latest cabal-install HEAD from @hvr's Ubuntu PPA, but I experience the same issues.

@RyanGlScott
Copy link
Member Author

I'd say that this is fixed after #5395, since I can now run:

$ cabal new-build --enable-documentation --haddock-for-hackage

And it will build suitable-for-Hackage Haddocks, building dependencies with documentation enabled if need be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants