bug report: Cabal hides library

Simon Marlow simonmarhaskell at gmail.com
Fri Sep 29 08:02:15 EDT 2006

Duncan Coutts wrote:
> On Wed, 2006-09-20 at 15:51 +0400, Bulat Ziganshin wrote:
>>Hello libr,
>>i think it's appropriate place to complain about Cabal?
> Sure. (Or the cabal bug tracker or the cabal-devel list)
>>situation: ghc 6.4.2 (2006.06.09) with built-in Cabal. i install
>>package with the following dependencies:
>>Build-Depends:      base, ArrayRef==0.1, fps>=0.7, template-haskell
>>there are ArrayRef 0.1 (hidden) and ArrayRef 0.1.1 (exposed) installed
>>Cabal correctly selects ArrayRef 0.1 when building the lib. but on
>>installation it makes the following trick:
>>Registering Streams-0.2.2...
>>Reading package info from ".installed-pkg-config" ... done.
>>Warning: hiding the following packages to avoid conflict:
>>  ArrayRef-0.1.1 Streams-0.1.6
>>hiding old version of Stream library is correct, but why the hell it hides
>>old ArrayRef library??? as the final result, both old and new ArrayRef
>>libraries are hidden:
> It is ghc-pkg that does this hiding upon registration, not Cabal. Try it
> manually, you'll get the same behaviour.
> The reason is as ghc-pkg explains: that there would be duplicate modules
> exposed otherwise if Streams-0.2.2 and ArrayRef-0.1.1 were exposed at
> once. This is because Streams-0.2.2 is exposed and depends on
> arrayRef-0.1.
> With the recent relaxation in GHC's package/module name space system
> ghc-pkg might be able to do something different in this case. Try asking
> about it on the ghc-users list.

In GHC 6.6 I ripped out that bit of code from ghc-pkg, so it no longer does any 
automatic hiding on registration.  This behaviour is I hope less obscure, as GHC 
now has the ability to use multiple packages containing the same module names. 
However, if you have multiple exposed packages that expose the same module, you 
still won't be able to import that module in Haskell code unless you explicitly 
-hide-package one of the clashing packages.

The exception is when there are multiple versions of a package exposed: GHC does 
what you probably want in this case, and hides all but the most recent exposed 
version automatically.


More information about the Libraries mailing list