commercialhaskell / commercialhaskell/stack
Feature request: suggest newer LTS or extra-deps after build plan failure
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
I had a situation a short time ago, when in my cabal file I have:
build-depends: array >= 0.5.1.1 && < 0.6
When I ran `stack install` however, I got:
```
While constructing the build plan, the following exceptions were encountered:
In the dependencies for bones-tsp-0.1.0.0:
array-0.5.1.0 must match >=0.5.1.1 && <0.6 (latest applicable is 0.5.1.1)
```
This was initially confusing, because nowhere did I state 0.5.1.0 in a cabal or stack.yaml file. It eventually clicked that I was using the `lts-5.12` resolver, which has array-0.5.1.0 . But I had to go to stackage.org to find that this was the reason for the error. I fixed this by adding `array-0.5.1.1` to `extra-deps`in my stack.yaml file. I could have alternatively changed my resolver to `lts-7.0`.
I might have saved a few minutes if the error message had instead said:
```
In the dependencies for bones-tsp-0.1.0.0:
array-0.5.1.0 must match >=0.5.1.1 && <0.6 (latest applicable is 0.5.1.1)
This is because array-0.5.1.0 is the version in your chosen resolver lts-5.12.
Try adding array-0.5.1.1 to extra-deps or changing your resolver to a newer release.
```
Or even:
```
In the dependencies for bones-tsp-0.1.0.0:
array-0.5.1.0 must match >=0.5.1.1 && <0.6 (latest applicable is 0.5.1.1)
This is because array-0.5.1.0 is the version in your chosen resolver lts-5.12.
Change your resolver to lts-7.0 for array-0.5.1.1,
or add array-0.5.1.1 to extra-deps because it is available on hackage.
```
Not those words, but words to that effect?
Or is there a more elegant way to overcome my issue more quickly than I took?
Contributor guide
Assessment
This issue has not been assessed yet.