Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving dependencies when constraint can't be found, maybe update? #8922

Open
philderbeast opened this issue Apr 26, 2023 · 3 comments
Open

Comments

@philderbeast
Copy link
Collaborator

$ cabal build squeal-postgresql --enable-tests --enable-benchmarks --minimize-conflict-set
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: my-package (user goal)
[__1] next goal: generics-sop (dependency of my-package)
[__1] rejecting: generics-sop-0.5.1.2, generics-sop-0.5.1.1,
generics-sop-0.5.1.0, generics-sop-0.5.0.0, generics-sop-0.4.0.1,
generics-sop-0.3.2.0, generics-sop-0.3.1.0, generics-sop-0.3.0.0,
generics-sop-0.2.5.0, generics-sop-0.2.4.0, generics-sop-0.2.3.0,
generics-sop-0.2.2.0, generics-sop-0.2.1.0, generics-sop-0.2.0.0,
generics-sop-0.1.1.2, generics-sop-0.1.1.1, generics-sop-0.1.1,
generics-sop-0.1.0.4, generics-sop-0.1.0.3, generics-sop-0.1.0.2,
generics-sop-0.1.0.1, generics-sop-0.1.0.0, generics-sop-0.4.0.0 (constraint
from project config https://www.stackage.org/nightly-2023-04-25/cabal.config requires
==0.5.1.3)
[__1] fail (backjumping, conflict set: my-package, generics-sop)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: generics-sop, my-package

There's nothing in this message that hints at the real problem (that I expect is known to cabal), where to find generics-sop-0.5.1.3? Turns out this is fixed with cabal update but that is not suggested by the message. Could we improve this message?

@Mikolaj
Copy link
Member

Mikolaj commented Apr 26, 2023

That's a very sane idea. I'd be surprised if it's not proposed already, but I haven't searched.

@philderbeast
Copy link
Collaborator Author

"One improvement to this proposal would be to mark the latest known version of a package to the solver" from #8939 would also help here. Concretely, if cabal said it knew of generics-sop-0.5.1.2 (the latest version known to cabal) but had never heard of generics-sop-0.5.1.3 then (even without cabal suggesting a cabal update) we could guess something is not quite right. As it stands there's nothing that distinguishes generics-sop-0.5.1.3 from the rest (other than not being included in the reject list).

A more helpful message could read something like:

Error: cabal: Could not resolve dependencies:
[__0] trying: my-package (user goal)
[__1] next goal: generics-sop (dependency of my-package)
[__1] unknown: generics-sop-0.5.1.3 (have you tried cabal update?)
[__1] rejecting: generics-sop-0.5.1.2 (the latest known version) and all earlier versions
(constraint from project config https://www.stackage.org/nightly-2023-04-25/cabal.config requires ==0.5.1.3)
[__1] fail (backjumping, conflict set: my-package, generics-sop)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: generics-sop, my-package

@grayjay
Copy link
Collaborator

grayjay commented May 7, 2023

The idea for simplifying the error message is very similar to issue #4251.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants