Ticket #497 (new enhancement)

Opened 4 years ago

Last modified 15 months ago

on package not found error: mention "cabal update"

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

Description

Together with the "There is no package named .." error, a message could be provided that updating the package list might solve the problem.

Attachments

add-update-hint.dpatch Download (26.5 KB) - added by byorgey 4 years ago.
Patch fixing #497
distribution_client_messages-module-for-centralised-error-messages_.dpatch Download (44.7 KB) - added by kowey 2 years ago.

Change History

Changed 4 years ago by duncan

  • difficulty changed from unknown to very easy (<1 hour)

Changed 4 years ago by byorgey

  • owner set to byorgey

Changed 4 years ago by byorgey

Patch fixing #497

Changed 4 years ago by byorgey

I forget the proper procedure for getting a patch reviewed. Is it enough to attach it here? Or should I just send it directly to the list?

Changed 4 years ago by duncan

Applied.

Thu Jun 11 18:12:33 BST 2009  Brent Yorgey <byorgey@cis.upenn.edu>
  * add message to 'package not found' error advising to run 'cabal update'. (#497)

There are two other cases we should think about:

$ cabal install foo-2.0
Resolving dependencies...
cabal: There is no available version of foo that satisfies ==2.0

The point is, there is an older version of foo, just not the version they're asking for. This might also be done in the disambiguateDependencies function, or perhaps a separate check deps function that checks that there is at least some package that satisfies the dependency.

Also:

cabal install foo
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.

This is the case when you're asking for the latest version, but you've already got the latest installed, at least the latest one that we know about. If the index is old at this point then we might not know about some later version.

This is a bit harder to check up-front since it's not simply a matter of checking if the package is already installed (eg it might be registered but have broken or inconsistent deps). This error is currently reported in Distribution/Client/Install.hs once we discover that the proposed InstallPlan has no packages to be installed. This is probably the best place to report since we have access to the installed packages at that point.

Changed 2 years ago by kowey

I've attached a patch which I think takes care of the "no available version" case, albeit not in a particularly principled way...

Changed 15 months ago by kosmikus

  • milestone set to cabal-install-0.16
Note: See TracTickets for help on using tickets.