haskell / haskell/cabal

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

Open
#10,368 4 comments 1 reaction 0 assignees View on GitHub
needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

(Originally reported as a haddock bug [here](https://gitlab.haskell.org/ghc/ghc/-/issues/25270).)

## 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

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the provided happy checkout and `cabal haddock --haddock-for-hackage` command, then inspect how documentation for reexported modules is packaged under `docs-dist`. Done means the generated `happy-lib-2.0-docs.tar.gz` includes documentation for modules from both the LALR and GLR private components.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.