
On 16.09 10:02, Isaac Jones wrote:
The problem I have with --package-db= as a directory for Hugs (and nhc, and jhc) is that it conflicts with the meaning of the --prefix flag. That is, if you specify a package database, it changes the location of the installation, which is not what you might expect. Also, we'd have to make sure people don't try to use --prefix and --package-db together in the case of Hugs (unless they're equal).
This could be solved by --ghc-package-db, which would be also admitting that it is only a solution for GHC. For virtualization the solution with JHC will probably be: 1) The virtual root is e.g. /foo/bar 2) export JHCPATH=/foo/bar 3) runhaskell Setup.lhs --prefix=/foo/bar --package-db would not make much sense.
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.
So for the sake of those who haven't read the wiki page, here's my --root= proposal. This basically directly implements "virtualization" in Cabal:
* For GHC o --prefix now becomes $(ROOT)/$(PREFIX) o the ghc-pkg file is stored in $(ROOT)/.whatever o Cabal adds package-conf related flags to ghc and ghc-pkg to look at $(ROOT)/.whatever. * For Hugs o -P$(ROOT)/usr/lib/hugs will be added o Hugs still has issues if --prefix isn't something Hugs knows about (as now). See web page below for comments on how to solve that problem.
This is evil. If given --prefix then the user will want things to live there. This forces a fixed layout under the throats of users. This would be mean that my current ${HOME}/local would become ${HOME}/local/usr/lib/... which is unlike other applications.
http://www.haskell.org/hawiki/Cabal_2fVirtualizationRequirements
I'll try add comments there. - Einar Karttunen