cabal install / cabal update should give warning when preferred versions will result in something other than the latest version on hackage #401

bos opened this Issue May 24, 2012 · 2 comments


None yet

1 participant


(Imported from Trac #408, reported by tphyahoo on 2008-11-16)

The natural assumption, unless you know better, is that cabal install -- and especially cabal upgrade -- will install the latest verion of a package on hackage. But the preferred-version machinery invalidates this assumptijon.

The suggestions is to emit a warning like

  cabal install haxml
Downloading HaXml-1.13.3...
Note: the preferred version is HaXml-1.13.3 but latest version is
HaXml-1.19, so put
Build-Depends: HaXml == 1.19.4
in your cabal file if you want that version.
I would have this message pop up for both cabal install and cabal upgrade

See for discussion thread.


(Imported comment by lilac on 2008-11-16)

In the specific case of a 'cabal upgrade' where a named package is already the preferred version but there is a later version, it would be very helpful to include a message. Currently we see this:

$ cabal upgrade parsec
Resolving dependencies...
No packages to be installed. All the requested packages are already installed.
If you want to reinstall anyway then use the --reinstall flag.
... when the intention was probably to install parsec 3.


(Imported comment by lilac on 2008-12-10)

It's important that the wording of the message makes it clear that installing the non-preferred version is, well, not preferred. Possible wording:

Note: Not installing parsec 3.0.0 because the preferred version is
If you want to override this then run cabal install 'parsec == 3.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment