haskell/cabal — pull request #1519 by benarmston (2013-09-24 21:25:40+00:00)
Title: Top-level command for Freezing dependencies

This series of patches implements a new top-level command, `freeze`, which will resolve the dependencies to exact versions and write a constraints section to `cabal.config`.

The new command takes a number of options related to resolving dependencies, namely, `--solver`, `--max-backjumps`, `--reorder-goals` and `--shadow-installed-packages`. Previously, I had asked [whether other option are required](https://github.com/haskell/cabal/issues/1502#issuecomment-24871974). As no-one said that they are, I've taken that to mean that they are not.

Issues that may still need addressing include:

- What should happen if this command is run outside of a sandbox.
- Whether or not `cabal.config` can be entirely overwritten.

Regarding the last point, @tibbe has stated that it should not, whilst @gregwebs is of the opinion that it is fine to do so. Before I invest any time in replacing only the `constraints` section, I'd like to have some agreement on whether or not it is required.

This branch contains a number of dead-end efforts. If you'd like them to be rebased away, let me know. I've hesitated doing that as I didn't want to force push.

See issues #1502 and #1499 for discussion of this feature.