Skip to content

Conversation

nikita-volkov
Copy link

@nikita-volkov nikita-volkov commented Oct 10, 2025

Addresses the bug described in #1346.

Should be noted that the patch is generated with AI.

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
Copy link
Contributor

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) $
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants