haskell/cabal — pull request #1604 by 23Skidoo (2013-12-05 23:14:51+00:00)
Title: Implement the '--allow-newer' option for 'configure'/'install'

Fixes #949. Example usage:

```
$ grep array tst.cabal
build-depends: base >=4.5 && <4.6, array >= 0.3 && < 0.4

$ ghc-pkg list array --simple-output
array-0.4.0.0

$ cabal configure
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: tst-0.1.0.0 (user goal)
next goal: array (dependency of tst-0.1.0.0)
rejecting: array-0.4.0.0/installed-4f6... (conflict: tst => array>=0.3 &&
<0.4)
Dependency tree exhaustively searched.

$ cabal configure --allow-newer
Resolving dependencies...
Configuring tst-0.1.0.0...

$ cabal build
Building tst-0.1.0.0...
Preprocessing executable 'tst' for tst-0.1.0.0...
[1 of 1] Compiling Main ( Main.hs, dist/build/tst/tst-tmp/Main.o )
Linking dist/build/tst/tst ...

```

Known issues:

* Dependencies on internal libraries are not relaxed.

* `build-depends: a < 3 && >= 2; if (someFlag): build-depends: a >= 5 && < 6` gets relaxed to `build-depends: >= 2; if (someFlag): build-depends: a >= 5` (4 is now allowed where it previously wasn't).

* When `configure --exact-configuration` fails, the error message should probably mention `--exact-configuration`.