Ticket #490 (closed defect: fixed)

Opened 4 years ago

Last modified 18 months ago

cabal unpack gives bad error message for unsatisfiable constraints

Reported by: duncan Owned by:
Priority: normal Milestone: cabal-install-0.6
Component: cabal-install tool Version: 1.6.0.1
Severity: normal Keywords:
Cc: Difficulty: very easy (<1 hour)
GHC Version: Platform:

Description

The simple use case works fine:

$ cabal unpack HaXml
Downloading HaXml-1.13.3...
Unpacking HaXml-1.13.3...

But we also allow constraints and that does not necessarily work:

$ cabal unpack HaXml-1.19.6
cabal: List.maximumBy: empty list

The problem is that the index does not contain HaXml-1.19.6. After a cabal update it is fine. In general this would happen for any user-supplied version constraint that turns out to be unsatisfiable.

The function resolvePackages in Distribution.Client.Unpack does not consider the possibility that a dependency may be unsatisfiable.

Attachments

fix-_490_-unpack-now-gives-a-proper-error-message_.dpatch Download (23.8 KB) - added by Saizan 4 years ago.
initial patch

Change History

Changed 4 years ago by Saizan

initial patch

Changed 4 years ago by Saizan

With the attached patch we have:

$ cabal unpack haxml-1.20
cabal: There is no available version of HaXml that satisfies ==1.20
$ cabal unpack containers haxml-1.20 array
'containers-0.2.0.0' is cached.
Unpacking containers-0.2.0.0...
cabal: There is no available version of HaXml that satisfies ==1.20
$ cabal unpack containers nonexistant
cabal: There is no package named nonexistant

So, non-existant package names make unpack die early, while non-resolvable deps for existing packages make it die on the first one encountered while fetching, like other fetching-related problems (e.g. downloading or extracting).

Changed 4 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed

Applied, thanks.

Sun Feb  8 16:52:40 GMT 2009  Andrea Vezzosi <sanzhiyan@gmail.com>        
  * Fix #490, unpack now gives a proper error message.

Changed 18 months ago by elga

Note: See TracTickets for help on using tickets.