cabal design

Frederik Eaton frederik at a5.repetae.net
Fri Sep 16 21:22:24 EDT 2005


On Fri, Sep 16, 2005 at 01:16:26PM +0100, Simon Marlow wrote:
> Ok, I've read through this discussion.  Could somebody explain to me why
> this whole "virtualization" thing can't be solved by simply adding the
> flag
> 
>   --package-db=<file>

Nope, can't explain it! Seems like a good solution to me too.

Although I think it would be nice if Cabal were able to automatically
pick a "standard" package database which is a function of the 'prefix'
(hence the --default-package-db option I mention on the wiki); that is
not crucial, if we think that it would add too much complexity. The
--user and --global options would let users specify the standard
databases in the most common cases.

> ...
> It seems to me that the requirement is basically this:
> 
>   - To be able to install packages in a group, such that
>     all packages in the group are registered in a single,
>     separate, package database.
> 
> the fact that in the proposed use cases the packages are also installed
> under a pseudo-root is a red herring as far as Cabal is concerned.  We
> don't care where you install your packages or what files they contain.

That seems correct. I might say that, although it is not in itself a
requirement, it certainly satisfies all the other requirements, and
there is no reason not to be simple and general.

> So the question becomes how to specify which "package group" a package
> should be registered in.  I propose the simplest thing: tell Cabal the
> location of a package database.  The other proposals (--prefix and
> --root) require Cabal to magically derive the location of the package
> database from the "root" directory, but that's magic that we don't
> need/want IMO.
> 
> I'm happy to add support for GHC_PACKAGE_PATH, as requested in this
> discussion.

Excellent. (Jacques Frechet, the author of Toast, has spent some time
modifying Toast so that versions of GHC it installs have their
binaries wrapped to support this environment variable, but I thought
his solution was always a bit hacky. It would be good to have actual
support in GHC.)

Frederik

-- 
http://ofb.net/~frederik/


More information about the Libraries mailing list