diff --git a/Cabal/Distribution/Types/InstalledPackageInfo/FieldGrammar.hs b/Cabal/Distribution/Types/InstalledPackageInfo/FieldGrammar.hs index b3d9bb97b74..db4ead3d969 100644 --- a/Cabal/Distribution/Types/InstalledPackageInfo/FieldGrammar.hs +++ b/Cabal/Distribution/Types/InstalledPackageInfo/FieldGrammar.hs @@ -288,6 +288,10 @@ basicFieldGrammar = mkBasic -- This can be removed once we stop supporting GHC<8.8, at the -- condition that we keep marking main libraries as public when -- registering them. - lv' = if ln' == LMainLibName + MungedPackageName _ mln = n + lv' = if + -- We need to check both because on ghc<8.2 ln' will always + -- be LMainLibName + ln' == LMainLibName && mln == LMainLibName then LibraryVisibilityPublic else lv