package mounting

Simon Marlow simonmar at microsoft.com
Mon Jun 27 07:53:48 EDT 2005


[ moved to the libraries list; replies here please ]

On 24 June 2005 16:22, Frederik Eaton wrote:

> (By the way, sorry about cross-posting again. People have already
> replied to just 'haskell@' and just 'libraries@' but I'll try to stick
> to 'libraries@' after this since it seems that some users' mail
> clients show them two copies otherwise)
> 
>> This idea has been raised before, but it was a while back, and we
>> called it "grafting".  Here's the start of the thread, which went on
>> for quite some time: 
>> 
>>   http://www.haskell.org/pipermail/libraries/2003-August/001310.html
> 
> Actually it looks like that is slightly different from my idea,
> perhaps I should have expounded a bit more in my original post.
> Correct me if I'm wrong, but in my proposal:
> 
> - grafting/mounting would be done per compilation unit. In yours it
> seems it would be done per (user, system).
> 
> - configuration of graft/mount points would be done at compile time,
> zero or one times per package import option. In yours it would be at
> package install time.

Technologically it makes no difference; the key point from an
implementation point of view is that the grafting point is not specified
when a package is compiled, it is specified at some later time, and
without modifying the contents of the package itself.  The rest is
"just" the user interface.

> I think my proposal is better. In it there would be no cross-system
> compatibility issues: since each program would specify where its
> imported packages get mounted itself, you could write a Haskell
> program on one system and be assured that someone else could use it on
> another system without problems. I think this is a rather important
> property and we shouldn't allow it to be broken 

Plain Haskell source code is already not portable, because it doesn't
contain packaage dependencies.  Also, "exposed" and "hidden" packages
break portability, which is why Cabal now explicitly hides all packages.

Our story for portability is that the extra information needed to ensure
portability of your source code is contained in the Cabal package: you
can't necessarily move plain Haskell source from one system to another
and expect it to compile, but you *can* move a Cabal pacakge.

If we had grafting/mounting, I think it would be most naturally exposed
as a straightforward extension of Cabal's build-depends field, where a
grafting location would be listed with each package dependency.  Of
course, there would be equivalent command-line options for raw use of
the compiler.

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).

Cheers,
	Simon


More information about the Libraries mailing list