haskell/cabal — pull request #1011 by 23Skidoo (2012-08-22 23:40:00+00:00)
Title: Implement the preliminary sandbox UI

Adds five new hidden commands:

* `cabal sandbox-configure`
* `cabal sandbox-add-source`
* `cabal sandbox-build`
* `cabal sandbox-install`
* `cabal dump-pkgenv`

Example usage:

```
$ git clone git://github.com/haskell/cabal.git
$ cd cabal/cabal-install
$ cabal sandbox-configure -w /path/to/ghc-7.4.1
$ cabal sandbox-add-source ../Cabal
$ cabal sandbox-install --only-dependencies
# Since the previous configure only initialised the sandbox
$ cabal sandbox-configure -w /path/to/ghc-7.4.1
$ cabal sandbox-build
```

I kept the UI close to the current one, so dependency installation & configuration is still done manually. If a dependency added with `sandbox-add-source` is updated, it must be manually reinstalled with `cabal sandbox-install LibName`.

Ideally, one would want to just run `cabal sandbox-build --package-root ..` and have all dependencies installed and/or updated automatically. In the meantime, we can make a repeated `cabal sandbox-install --only-dependencies`/`cabal sandbox-install` unconditionally reinstall all dependencies added with `add-source`.

Changing the default compiler with `-w` works as intended (tested with ghc-7.4.2 and ghc-7.4.1).