-
Notifications
You must be signed in to change notification settings - Fork 206
Fix: Filter out private internal libraries from package pages #1437
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: nikita-volkov <[email protected]>
Co-authored-by: nikita-volkov <[email protected]>
…-visibility Fix: Filter out private internal libraries from package pages
in (libName lib, ModSigIndex { modIndex = mod_ix, sigIndex = sig_ix }) | ||
where | ||
-- Only show main library or internal libraries with public visibility | ||
isPublicLibrary lib = libName lib == LMainLibName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it insufficient to check only libVisibility
?
|
||
allCondLibs :: GenericPackageDescription -> [(LibraryName, CondTree ConfVar [Dependency] Library)] | ||
allCondLibs desc = maybeToList ((LMainLibName,) <$> condLibrary desc) | ||
allCondLibs desc = filter (isPublicCondLib . snd) $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the function responsible for contents on pages like https://hackage.haskell.org/package/tar-0.7.0.0/dependencies? If yes then I think it should continue showing all sublibraries, even internal ones.
++ (first LSubLibName <$> condSubLibraries desc) | ||
where | ||
-- Check if a conditional library tree contains a public library | ||
-- We check the root node since visibility is a property of the library itself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true: visibility
can be a part of CondTree
, e. g.,
library foo-internal
if flag(foo)
visibility: public
else
visibility: private
Addresses the bug described in #1346.
Should be noted that the patch is generated with AI.