Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Fix ignore-exports again on ghc-9.4 #1533

Merged
merged 4 commits into from
Dec 9, 2022
Merged

Conversation

nicuveo
Copy link

@nicuveo nicuveo commented Oct 25, 2022

Description

As part of the ghc-9.0 branch, a fix was introduced to keep the ignore-exports option working, but this fix was mistakenly dropped in later branches. Furthermore, the test introduced in #1082 to prevent regressions was also broken at a later point. This PR reintroduces the fix, fixes the old HTML test, and introduces a new hoogle test.

This PR targets 9.4; #1532 is a similar PR for 9.2. I don't know, however, how to ensure that this fixes also lands on main (or ghc-head?), and how to prevent the tests from just being ignored or "fixed" in the future.

Implementation

The fullModuleContents function iterates on all declarations of the module, but only keeps declarations for which it finds an AvailInfo, obtained from GHC's type-checker's output (see tcg_exports). However, that list only contains the AvailInfo information for declarations that are exported out of the module. To prevent non-exported declarations from being ignored when we actually request them, this PR takes the same approach as b93c635 and crafts a simple AvailInfo for each declaration to be used in lieu of the raw tcg_exports list.

Steps to verify

See #1531 for a repro case.

Caveats

This PR bumps the dependency version of haddock-api to 2.27.1, as that is the version in that branch; without that, this branch doesn't compile.

Copy link
Member

@alexbiehl alexbiehl left a comment

Choose a reason for hiding this comment

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

Thanks!

@alexbiehl alexbiehl merged commit 31e1830 into haskell:ghc-9.4 Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants