cabal design

Simon Marlow simonmar at microsoft.com
Fri Sep 16 08:16:26 EDT 2005


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>

to Cabal?  It would be another option in the --user/--global family.
The idea isn't new - I'm sure we've discussed this before.  It seems to
suffer from none of the problems of the other suggestions, but perhaps
I'm missing something.  For Hugs, the <file> would actually specify a
directory.  Additionally, --package-db=<file> is a step on the way to
other things that we want to do (--in-place).

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.

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.

Cheers,
	Simon



More information about the Libraries mailing list