(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
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.
See http://groups.google.com/group/fa.haskell/browse_thread/thread/c39dca259a9489ef?q=cabal+preferred+version 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
No packages to be installed. All the requested packages are already installed.
If you want to reinstall anyway then use the --reinstall flag.
(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 188.8.131.52.
If you want to override this then run cabal install 'parsec == 3.0.0'