haskell / haskell/cabal

Simplify the message when the solver rejects all versions/instances of a package

Open
#10,926 1 comment 1 reaction 0 assignees View on GitHub
attention: pr-welcome cabal-install: solver type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

As a step towards #4251, we could simplify the case where the solver rejects all instances of a package, such as when the index is not up to date. Here is an error message similar to the one in #4251 that I made by adding a constraint on `aeson`:

```
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-testsuite-3 (user goal)
[__1] next goal: aeson (dependency of cabal-testsuite)
[__1] rejecting: aeson; 2.2.3.0, 2.2.2.0, 2.2.1.0, 2.2.0.0, 2.1.2.1, 2.1.2.0, 2.1.1.0, 2.1.0.0, 2.0.3.0, 2.0.2.0, 2.0.1.0, 2.0.0.0, 1.5.6.0, 1.5.5.1, 1.5.5.0, 1.5.4.1, 1.5.4.0, 1.5.3.0, 1.5.2.0, 1.5.1.0, 1.5.0.0, 1.4.7.1, 1.4.7.0, 1.4.6.0, 1.4.5.0, 1.4.4.0, 1.4.3.0, 1.4.2.0, 1.4.1.0, 1.4.0.0, 1.3.1.1, 1.3.1.0, 1.3.0.0, 1.2.4.0, 1.2.3.0, 1.2.2.0, 1.2.1.0, 1.2.0.0, 1.1.2.0, 1.1.1.0, 1.1.0.0, 1.0.2.1, 1.0.2.0, 1.0.1.0, 1.0.0.0, 0.11.3.0, 0.11.2.1, 0.11.2.0, 0.11.1.4, 0.11.1.3, 0.11.1.2, 0.11.1.1, 0.11.1.0, 0.11.0.0, 0.9.0.1, 0.9.0.0, 0.8.1.1, 0.8.1.0, 0.8.0.2, 0.7.0.6, 0.7.0.4, 0.6.2.1, 0.6.2.0, 0.6.1.0, 0.6.0.2, 0.6.0.1, 0.6.0.0, 0.5.0.0, 0.4.0.1, 0.4.0.0, 0.3.2.14, 0.3.2.13, 0.3.2.12, 0.3.2.11, 0.3.2.10, 0.3.2.9, 0.3.2.8, 0.3.2.7, 0.3.2.6, 0.3.2.5, 0.3.2.4, 0.3.2.3, 0.3.2.2, 0.3.2.1, 0.3.2.0, 0.3.1.1, 0.3.1.0, 0.3.0.0, 0.2.0.0, 0.1.0.0, 0.10.0.0, 0.8.0.1, 0.8.0.0, 0.7.0.5, 0.7.0.3, 0.7.0.2, 0.7.0.1, 0.7.0.0 (constraint from command line flag requires >=3.0 && <3.1)
[__1] fail (backjumping, conflict set: aeson, cabal-testsuite)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aeson, cabal-testsuite
```

Since cabal rejects all instances of `aeson`, we could simplify the "rejecting" message like this:

```
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-testsuite-3 (user goal)
[__1] next goal: aeson (dependency of cabal-testsuite)
[__1] rejecting: all instances of aeson, including 2.2.3.0 (constraint from command line flag requires >=3.0 && <3.1)
[__1] fail (backjumping, conflict set: aeson, cabal-testsuite)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aeson, cabal-testsuite
```

I think that it would be useful to still mention the latest or most preferred version, and maybe any relevant installed versions. -v3 should continue to list all of the instances, for debugging.

Contributor guide

Open the contributing guide

Research direction

The issue does not name a file or test. Start by locating the dependency-solver output that emits the “rejecting” line, then compare normal output with -v3 output and the example involving aeson. Done means collapsing the normal message when every instance is rejected while retaining the detailed instance list for -v3.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.