patch applied (cabal): Add configure --package-db= flag to use specific package db

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Jan 29 06:13:33 EST 2008


On Tue, 2008-01-29 at 02:48 -0800, Duncan Coutts wrote:
> Sun Jan 13 15:25:36 PST 2008  Duncan Coutts <duncan at haskell.org>
>   * Add configure --package-db= flag to use specific package db
>   Should allow satisfying deps from the given package db and should register
>   into that db. It is not thoroughly tested however.
> 
>     M ./Distribution/Simple/Setup.hs +8

As you can tell, this patch only exposes in the UI something that has
been available internally for some time, namely using specific package
databases, not just a global or per-user one (where the compiler
supports such a notion).

This feature will be needed internally at some point for building
multi-package systems. It'll also be needed for building test code
against a package that has been built but not yet installed (ie
registered inplace in a local package db). It's also needed now by
package managers like Nix which like to really isolate components and so
use a ghc package database per-nix-package.

Since the feature has not been exposed it has not been well tested. I'm
hoping the Nix and possibly Arch packing folk will give some feedback.

Currently one can specify either global, user or specific.

data PackageDB = GlobalPackageDB
               | UserPackageDB
               | SpecificPackageDB FilePath

User and specific are taken to include global. It might be better to
allow a list, where user and specific are just different kinds, and
global would always be present.

That is:
type PackageDBs = [PackageDB]

and the default would always include GlobalPackageDB last. So it'd be
possible to specify multiple specific package dbs and also the user one.

Duncan



More information about the cabal-devel mailing list