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

Reexporting from private library components discards documentation of all but one component #10368

Open
sgraf812 opened this issue Sep 17, 2024 · 4 comments

Comments

@sgraf812
Copy link
Contributor

sgraf812 commented Sep 17, 2024

(Originally reported as a haddock bug here.)

Summary

cabal haddock does not appear to merge the reexported documentation from multiple private library components and instead arbitrarily picks exactly one component to reexport.

Steps to reproduce

Paste the following into your shell:

git clone https://github.com/haskell/happy
cd happy/lib
git checkout ddfb7bb933a0c2d61333fe5851e7dbf8136f0818
cabal haddock --builddir="$(pwd)/docs-dist" --haddock-for-hackage
cd docs-dist
tar xvf happy-lib-2.0-docs.tar.gz
cd happy-lib-2.0-docs
ls -l

Now realise that it only packaged up the documentation for one private library component (either the LALR or the GLR backend).

Expected behavior

It should have documentation for all reexported modules

System information

  • Cabal 3.10.2.1
@Ericson2314
Copy link
Collaborator

Ericson2314 commented Sep 17, 2024

It does look like a cabal bug. See the same build path occurring again and again in the following (truncated) log:

$ cabal haddock --builddir="$(pwd)/docs-dist" --haddock-for-hackage
Resolving dependencies...
Build profile: -w ghc-9.6.5 -O1
In order, the following will be built (use -v for more details):
 - happy-lib-2.0 (lib:grammar) (first run)
 - happy-lib-2.0 (lib:tabular) (first run)
 - happy-lib-2.0 (lib:frontend) (first run)
 - happy-lib-2.0 (lib:backend-lalr) (first run)
 - happy-lib-2.0 (lib:backend-glr) (first run)
 - happy-lib-2.0 (lib) (first run)
Configuring library 'grammar' for happy-lib-2.0..
Preprocessing library 'grammar' for happy-lib-2.0..
Building library 'grammar' for happy-lib-2.0..
...
Documentation created:
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/grammar/doc/html/happy-lib-2.0-docs/,
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/grammar/doc/html/happy-lib-2.0-docs/happy-lib.txt
Documentation tarball created:
/home/jcericson/src/happy/lib/docs-dist/happy-lib-2.0-docs.tar.gz
...
Documentation created:
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/tabular/doc/html/happy-lib-2.0-docs/,
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/tabular/doc/html/happy-lib-2.0-docs/happy-lib.txt
Documentation tarball created:
/home/jcericson/src/happy/lib/docs-dist/happy-lib-2.0-docs.tar.gz
...
Documentation created:
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/frontend/doc/html/happy-lib-2.0-docs/,
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/frontend/doc/html/happy-lib-2.0-docs/happy-lib.txt
...
Documentation tarball created:
...
Documentation created:
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/backend-glr/doc/html/happy-lib-2.0-docs/,
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/backend-glr/doc/html/happy-lib-2.0-docs/happy-lib.txt
Documentation tarball created:
/home/jcericson/src/happy/lib/docs-dist/happy-lib-2.0-docs.tar.gz
Documentation created:
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/backend-lalr/doc/html/happy-lib-2.0-docs/,
/home/jcericson/src/happy/lib/docs-dist/build/x86_64-linux/ghc-9.6.5/happy-lib-2.0/l/backend-lalr/doc/html/happy-lib-2.0-docs/happy-lib.txt
Documentation tarball created:
/home/jcericson/src/happy/lib/docs-dist/happy-lib-2.0-docs.tar.gz

This is Cabal 3.10, however.

@geekosaur
Copy link
Collaborator

Can you test with cabal-head (https://github.com/haskell/cabal/releases/tag/cabal-head)? We've made a number of changes to how cabal deals with sub-library haddocks in the past few months, and I don't think any of them has been released yet.

@geekosaur
Copy link
Collaborator

geekosaur commented Sep 17, 2024

And there are a few more changes coming (which sadly won't be in 3.14), if my understanding of our currently-open tickets is correct, specifically dealing with temporary files.

@sgraf812
Copy link
Contributor Author

It appears to reproduce with Cabal 3.15.0.0 as well (as installed through ghcup).

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

3 participants