cabal-install `haddock-project` includes sub-libraries with `visibility: hidden`
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
The `cabal haddock-project` produces, as part of it's indexed output, sub-libraries which ought to be omitted due to being annotated as `visibility: hidden` in the package description `$pkg.cabal` file.
**To Reproduce**
Steps to reproduce the behavior:
```bash
$ git clone https://github.com/recursion-ninja/includes-hidden-sublibraries
$ cd includes-hidden-sublibraries
$ cabal haddock-project
$ grep Lib2 haddocks/index.html
```
**Expected behavior**
The contents of `haddocks/index.html` should not include `Lib2` because `includes-hidden-sublibraries.cabal` specifies that `lib2` is not a public facing library via the `visibility: private` build field.
The `grep` command in the example above should produce no output because `Lib2` was not included in the generated Haddock documentation.
**System information**
- MacOS
- Cabal
```bash
$ cabal --version
cabal-install version 3.10.3.0
```
- GHC
```bash
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.10.1
```
- Haddock
```bash
$ haddock --version
Haddock version 2.28.0, (c) Simon Marlow 2006
Ported to use the GHC API by David Waern 2006-2008
```
Contributor guide
Assessment
This issue has not been assessed yet.