package mounting

Simon Marlow simonmar at
Tue Jun 28 05:30:20 EDT 2005

On 28 June 2005 07:34, Frederik Eaton wrote:

>> And for the same reason we have "exposed" packages, it makes sense to
>> have a default set of grafting locations per user/system (this is
>> debatable; indeed sometimes I think we should remove "exposed"
>> completely and force non-Cabal users to write -package flags).
> I'm not sure what this "same reason" is - exposed packages are a
> reason to require a faithful module namespace, and default grafting
> locations would help provide that, is this it?

The only reason to have "exposed" packages is so that you don't have to
specify a bunch of -package options when invoking GHC or GHCi.  It's
convenient to be able to just import a hierarchical module without
having to say which package it comes from.

However, exposed packages are evil because there's no guarantee that
different systems will have the same set of exposed packages, so code
that compiled on one system may not compile on another.  But this is no
worse than the non-portability caused by different systems having
different packages installed, or different versions of packages, or
indeed different compilers.  

So our story for portability is that code which is intended to compile
on more than one system must travel with its dependencies, where those
dependencies include which packages (and versions) the code requires and
which compiler options are required to compile it.  All this information
is stored in the .cabal file, so code is portable if it is a Cabal
package.  Grafting locations fit into this scheme nicely.


More information about the Libraries mailing list