Skip to content

on package not found error: mention "cabal update" #490

Closed
bos opened this Issue May 24, 2012 · 5 comments

4 participants

@bos
Haskell member
bos commented May 24, 2012

(Imported from Trac #497, reported by Martijn on 2009-02-12)

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

@bos
Haskell member
bos commented May 24, 2012

(Imported comment by @byorgey on 2009-02-12)

Patch fixing #497

@byorgey byorgey was assigned May 24, 2012
@bos
Haskell member
bos commented May 24, 2012

(Imported comment by @byorgey on 2009-06-11)

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?

@bos
Haskell member
bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-06-11)

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.

@bos
Haskell member
bos commented May 24, 2012

(Imported comment by @kowey on 2009-06-14)

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

@jsl
jsl commented Feb 24, 2015

The current resolver doesn't mention cabal update specifically, but I haven't really had an issue with this since it mentions it can't find the dependency.

Anyway, since there is no activity since 2009 I propose closing. Please re-open or create a new issue if this problem still exists.

/cc @tibbe

@tibbe tibbe closed this Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.