Skip to content

Cabal haddock-related flags are inconsistent #6568

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

Open
AlexeyRaga opened this issue Mar 2, 2020 · 2 comments
Open

Cabal haddock-related flags are inconsistent #6568

AlexeyRaga opened this issue Mar 2, 2020 · 2 comments

Comments

@AlexeyRaga
Copy link

Describe the bug
The documentation says that providing --enable-documentation command line flag and having documentation: true in cabal.project should have the same effect (minus tests/bench targets):

image

However, when I add documentation: true to my cabal.project file I get this result:
image

and with --enable-documentation flag get this result:
image

Note that with documentation: true field no links are generated for externally defined types except if they are defined in base.

It is either a bug in propagating flags or the feature is not documented clearly/correctly.

To Reproduce

  1. Get a library that has dependencies from Hackage (not base)
  2. Add documentation: true to cabal.project
  3. Build the library: cabal v2-build all
  4. Open generated documentation
  5. Observe missing links
  6. Build again with cabal v2-build all --enable-documentation
  7. Observe that externally defined types are hyperlinked

Expected behavior
In both cases I would expect externally defined types to be hyperlinked.

Alternatively (if it is a documentation bug) I would expect the documentation to mention extra parameters to be added to cabal.project in order to have externally defined types hyperlinked.

System information

  • Linux, MacOS
  • cabal-3.0.0.0, ghc-8.6.5, haddock-2.22.0
@m-renaud
Copy link
Collaborator

Haven't had time to dig into the code too much but it appears that this may be due to a misconfigured (or missing) --read-interface param passed to Haddock (see docs) when invoked from the project context. Haddock is invoked in Cabal here, would need to trace through to figure out how the options get passed to regenerateHaddockIndex when the documentation flag comes from the project config.

@gbaz
Copy link
Collaborator

gbaz commented Aug 14, 2021

related? #7462

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