haskell / haskell/cabal

Hard or almost impossible to figure out what's wrong when resolving dependencies

Open
#6,863 2 comments 0 reactions 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

**Describe the bug**

When there is another ".cabal" file in the tree, its very difficult to figure out from the error message what's wrong. I did a `cabal build` in a package directory and I was not aware that another version of the package is unpacked in one of the directories and I get errors like this:

```
$ cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: xls (user goal)
[__0] rejecting: xls-0.1.3, xls-0.1.2, xls-0.1.1 (constraint from user target
requires ==0.1.0)
[__0] rejecting: xls-0.1.0 (constraint from user target requires ==0.1.3)
[__0] fail (backjumping, conflict set: xls)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: xls
```

I cannot figure out what's wrong. I tried `cabal build -v` and there was no clue from the output. It becomes very frustrating because there is nothing wrong with the cabal file I am looking at. I started looking at the directory tree for a clue and found that there was another cabal file lying around.

cabal should really look at such user experience issues at priority, I faced two such issues in just one go where it was difficult to figure out what's going on. I have a lot of experience with the tool and I get frustrated, one can imagine what happens to new users.

**To Reproduce**
See above.

**Expected behavior**
cabal should tell where a constraint is coming from. It should at least display which cabal files it is reading to create a plan.

**System information**
Mac OS X
cabal 3.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.