close
Skip to content

Fix haddock interface and HTML paths for sub-libraries#11476

Merged
mergify[bot] merged 3 commits into
haskell:masterfrom
Tritlo:master
Feb 13, 2026
Merged

Fix haddock interface and HTML paths for sub-libraries#11476
mergify[bot] merged 3 commits into
haskell:masterfrom
Tritlo:master

Conversation

@Tritlo
Copy link
Copy Markdown
Contributor

@Tritlo Tritlo commented Feb 5, 2026

Fixes #11475

Summary

  • Fix haddockInterfaces and haddockHTMLs paths in generalInstalledPackageInfo to include the sub-library name subdirectory for internal libraries
  • Without this fix, cabal haddock --haddock-all can't find the .haddock interface file for internal sub-libraries, causing "could not find link destinations" warnings and missing documentation

Checklist

QA Notes

  1. Create a package with an internal sub-library and a main library that re-exports from it
  2. Run cabal haddock --haddock-all
  3. Before this fix: haddock emits warnings like "Could not find documentation for exported module" and "Couldn't find .haddock for export"
  4. After this fix: documentation builds cleanly with full coverage and cross-library links resolved

@Tritlo Tritlo force-pushed the master branch 3 times, most recently from 60e17d6 to 4ae957b Compare February 5, 2026 16:47
Copy link
Copy Markdown
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks!

We have long had an issue with missing links to reexports on the Hackage page: https://hackage.haskell.org/package/Cabal (e.g. Distribution.Backpack, which is reexported from Cabal-syntax, isn't linked). I wonder if a similar patch would be required to fix that (a patch for hackage-server, presumably, as it generates the package pages on its own AFAIR).

Comment thread changelog.d/pr-11476.md Outdated
Sub-libraries now use a subdirectory named after the sub-library for
their haddock interface files and HTML documentation paths. Previously,
both main and sub-libraries shared the same paths, which caused haddock
to emit "could not find link destinations" warnings when using
`--haddock-all` with internal sub-libraries.

Adds a test case verifying `cabal haddock --haddock-all` works correctly
with an internal sub-library.
@Tritlo
Copy link
Copy Markdown
Contributor Author

Tritlo commented Feb 5, 2026

Yes! This seems to have been broken since 9.6, I'm not sure what changed.

Previously the test passed before the change was applied.
Copy link
Copy Markdown
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to look into this issue @Tritlo.

I've left two comments, fixes for the comments are on this branch - https://github.com/haskell/cabal/tree/wip/haddock-internal-library

Comment thread Cabal/src/Distribution/Simple/Register.hs Outdated
Comment thread cabal-testsuite/PackageTests/NewHaddock/HaddockAllInternalLib/cabal.test.hs Outdated
@Tritlo
Copy link
Copy Markdown
Contributor Author

Tritlo commented Feb 10, 2026

Merged!

Copy link
Copy Markdown
Collaborator

@mpickering mpickering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Tritlo

@mpickering mpickering added the squash+merge me Tell Mergify Bot to squash-merge label Feb 11, 2026
@mergify mergify Bot added the ready and waiting Mergify is waiting out the cooldown period label Feb 11, 2026
@Mikolaj
Copy link
Copy Markdown
Member

Mikolaj commented Feb 12, 2026

CI seems stuck. Let me try to restart it...

@Mikolaj
Copy link
Copy Markdown
Member

Mikolaj commented Feb 12, 2026

Success! Restarting has been enough to make it green. Thank you for the PR!

@mergify mergify Bot added merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels Feb 13, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Feb 13, 2026

Merge Queue Status

Rule: squash-merge


  • Entered queue2026-02-13 10:45 UTC
  • Checks passed · in-place
  • Merged2026-02-13 10:56 UTC · at 700bd115456b7dce1e7cb70f011d4e7ec212266a

This pull request spent 11 minutes 31 seconds in the queue, with no time running CI.

Required conditions to merge
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify mergify Bot merged commit 7129473 into haskell:master Feb 13, 2026
224 of 227 checks passed
@mergify mergify Bot removed the queued label Feb 13, 2026
geekosaur pushed a commit to geekosaur/cabal that referenced this pull request Mar 4, 2026
* Fix haddock interface and HTML paths for sub-libraries

Sub-libraries now use a subdirectory named after the sub-library for
their haddock interface files and HTML documentation paths. Previously,
both main and sub-libraries shared the same paths, which caused haddock
to emit "could not find link destinations" warnings when using
`--haddock-all` with internal sub-libraries.

Adds a test case verifying `cabal haddock --haddock-all` works correctly
with an internal sub-library.

* Assert that the test output doesn't contain an error

Previously the test passed before the change was applied.

* Use library function for computing the haddock directory

---------

Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
zlonast pushed a commit to zlonast/cabal that referenced this pull request Mar 17, 2026
* Fix haddock interface and HTML paths for sub-libraries

Sub-libraries now use a subdirectory named after the sub-library for
their haddock interface files and HTML documentation paths. Previously,
both main and sub-libraries shared the same paths, which caused haddock
to emit "could not find link destinations" warnings when using
`--haddock-all` with internal sub-libraries.

Adds a test case verifying `cabal haddock --haddock-all` works correctly
with an internal sub-library.

* Assert that the test output doesn't contain an error

Previously the test passed before the change was applied.

* Use library function for computing the haddock directory

---------

Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days ready and waiting Mergify is waiting out the cooldown period squash+merge me Tell Mergify Bot to squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal library .haddock path mismatch in cabal haddock --haddock-all

5 participants