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

Cabal (the library) haddock command does not support sublibraries #9586

Open
mpilgrem opened this issue Jan 3, 2024 · 0 comments
Open

Cabal (the library) haddock command does not support sublibraries #9586

mpilgrem opened this issue Jan 3, 2024 · 0 comments

Comments

@mpilgrem
Copy link
Collaborator

mpilgrem commented Jan 3, 2024

I think that this specific issue has not been reported previously: Cabal (the tool) can build Haddock documentation for a package with a sublibrary, but Cabal (the library) cannot.

I have a simple 'toy' package my-project with a library and a sublibrary internal. Its Setup.hs is the usual:

import Distribution.Simple
main = defaultMain

internal can be private or public, and the following behaviour is the same:

Command cabal haddock (cabal-install version 3.10.2.1) in the package's root directory generates Haddock documentation for both libraries, each with their own index.html, in directories: my-package\dist-newstyle\build\x86_64-windows\ghc-9.6.3\my-package-0.1.0.0\doc\html\my-package (the main library) and my-package\dist-newstyle\build\x86_64-windows\ghc-9.6.3\my-package-0.1.0.0\l\internal\doc\html\my-package (the sublibrary).

However commands runghc Setup.hs configure, runghc Setup.hs haddock (Cabal library version 3.10.1.0) in the package's root directory generates Haddock documentation for both libraries in turn in directory dist\doc\html\my-package\, and the index.html for one library overwrites the same file for the other library.

My motivation is that Stack relies on the version of Cabal (the library) that is provided with the specified version of GHC: commercialhaskell/stack#5254.

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

2 participants