haskell / haskell/cabal

`cabal fetch` formats dependency solver errors incorrectly

Open
#10,962 1 comment 0 reactions 0 assignees View on GitHub
cabal-install: cmd/fetch type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

The fetch command prints dependency solver errors in quotes:

```
$ cabal fetch cabal-install-99
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Error: [Cabal-7065]
"Could not resolve dependencies:\n[__0] next goal: cabal-install (user goal)\n[__0] rejecting: cabal-install; 3.14.2.0, 3.14.1.1, 3.14.1.0, 3.12.1.0, 3.10.3.0, 3.10.2.1, 3.10.2.0, 3.10.1.0, 3.8.1.0, 3.6.2.0, 3.6.0.0, 3.4.1.0, 3.4.0.0, 3.2.0.0, 3.0.0.0, 2.4.1.0, 2.4.0.0, 2.2.0.0, 2.0.0.1, 2.0.0.0, 1.24.0.2, 1.24.0.1, 1.24.0.0, 1.22.9.0, 1.22.8.0, 1.22.7.0, 1.22.6.0, 1.22.5.0, 1.22.4.0, 1.22.3.0, 1.22.2.0, 1.22.0.1, 1.22.0.0, 1.20.2.0, 1.20.1.0, 1.20.0.6, 1.20.0.5, 1.20.0.4, 1.20.0.3, 1.20.0.2, 1.20.0.1, 1.20.0.0, 1.18.2.0, 1.18.1.0, 1.18.0.8, 1.18.0.7, 1.18.0.6, 1.18.0.5, 1.18.0.4, 1.18.0.3, 1.18.0.2, 1.18.0.1, 1.18.0, 1.16.1.0, 1.16.0.2, 1.16.0.1, 1.16.0, 0.14.1, 0.14.0, 0.10.2, 0.10.0, 0.8.2, 0.8.0, 0.6.4, 0.6.2, 0.6.0, 0.5.2, 0.5.1, 0.5.0, 0.4.0 (constraint from user target requires ==99)\n[__0] fail (backjumping, conflict set: cabal-install)\nAfter searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: cabal-install"
```

The error messages should have the same formatting as in the install command:

```
$ cabal install cabal-install-99
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] next goal: cabal-install (user goal)
[__0] rejecting: cabal-install; 3.14.2.0, 3.14.1.1, 3.14.1.0, 3.12.1.0, 3.10.3.0, 3.10.2.1, 3.10.2.0, 3.10.1.0, 3.8.1.0, 3.6.2.0, 3.6.0.0, 3.4.1.0, 3.4.0.0, 3.2.0.0, 3.0.0.0, 2.4.1.0, 2.4.0.0, 2.2.0.0, 2.0.0.1, 2.0.0.0, 1.24.0.2, 1.24.0.1, 1.24.0.0, 1.22.9.0, 1.22.8.0, 1.22.7.0, 1.22.6.0, 1.22.5.0, 1.22.4.0, 1.22.3.0, 1.22.2.0, 1.22.0.1, 1.22.0.0, 1.20.2.0, 1.20.1.0, 1.20.0.6, 1.20.0.5, 1.20.0.4, 1.20.0.3, 1.20.0.2, 1.20.0.1, 1.20.0.0, 1.18.2.0, 1.18.1.0, 1.18.0.8, 1.18.0.7, 1.18.0.6, 1.18.0.5, 1.18.0.4, 1.18.0.3, 1.18.0.2, 1.18.0.1, 1.18.0, 1.16.1.0, 1.16.0.2, 1.16.0.1, 1.16.0, 0.14.1, 0.14.0, 0.10.2, 0.10.0, 0.8.2, 0.8.0, 0.6.4, 0.6.2, 0.6.0, 0.5.2, 0.5.1, 0.5.0, 0.4.0 (constraint from user target requires ==99)
[__0] fail (backjumping, conflict set: cabal-install)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: cabal-install
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the dependency solver failure with `cabal fetch cabal-install-99` and compare its output with `cabal install cabal-install-99`. Trace the two command paths to find where fetch formats the solver error differently; done means fetch displays the multiline error without quotes, matching install.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.