From af482b46bc7d8f5efda6305a49c99aa60812d044 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Wed, 16 Jan 2019 17:00:12 +0100 Subject: [PATCH] Prevent dependency on private library --- Cabal/Distribution/Simple/Configure.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index 732753d8013..9e36eebf477 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -83,6 +83,7 @@ import Distribution.Types.LegacyExeDependency import Distribution.Types.PkgconfigDependency import Distribution.Types.LocalBuildInfo import Distribution.Types.LibraryName +import Distribution.Types.LibraryVisibility import Distribution.Types.ComponentRequestedSpec import Distribution.Types.ForeignLib import Distribution.Types.ForeignLibType @@ -899,9 +900,9 @@ dependencySatisfiable || all (\lib -> - (depName, CLibName lib) - `Map.member` - requiredDepsMap) + let maybeIPI = + (depName, CLibName lib) `Map.lookup` requiredDepsMap + in (Just LibraryVisibilityPublic) == (Installed.libVisibility <$> maybeIPI)) sublibs | isInternalDep @@ -965,7 +966,7 @@ configureFinalizedPackage verbosity cfg enabled pkg_descr0 of Right r -> return r Left missing -> - die' verbosity $ "Encountered missing dependencies:\n" + die' verbosity $ "Encountered missing or private dependencies:\n" ++ (render . nest 4 . sep . punctuate comma . map (pretty . simplifyDependency) $ missing)