Skip to content
  • Michael Peyton Jones's avatar
    Visibility: handle multiple units with the same name · 856cdb9d
    Michael Peyton Jones authored and Ben Gamari's avatar Ben Gamari committed
    Fixes #16228. The included test case is adapted from the reproduction in
    the issue, and fails without this patch.
    
    ------
    
    We compute an initial visilibity mapping for units based on what is
    present in the package databases. To seed this, we compute a set of all
    the package configs to add visibilities for.
    
    However, this set was keyed off the unit's *package name*. This is
    correct, since we compare packages across databases by version. However,
    we would only ever consider a single, most-preferable unit from the
    database in which it was found.
    
    The effect of this was that only one of the libraries in a Cabal package
    would be added to this initial set. This would cause attempts to use
    modules from the omitted libraries to fail, claiming that the package
    was hidden (even though `ghc-pkg` would correctly show it as visible).
    
    A solution is to do the selection of the most preferable packages
    separately, and then be sure to consider exposing all units in the
    ...
    856cdb9d