Improving Cabal Solver Output for Better Readability and Usability
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Hello everyone,
At IOG, we have repeatedly faced issues with the Cabal solver output, as recently mentioned by @angerman. We lose valuable time trying to locate crucial information that should be more prominently displayed.
## Problem
Consider the following trace:
```
ouroboros-network> [__0] trying: ouroboros-network-0.6.0.0 (user goal)
ouroboros-network> [__1] trying: ouroboros-network-framework-0.5.0.0 (dependency of
ouroboros-network> ouroboros-network)
ouroboros-network> [__2] trying: ouroboros-network-testing-0.2.0.1 (dependency of
ouroboros-network> ouroboros-network-framework)
ouroboros-network> [__3] next goal: io-classes (dependency of ouroboros-network)
ouroboros-network> [__3] rejecting: io-classes-1.1.0.0 (conflict: ouroboros-network-testing =>
ouroboros-network> io-classes^>=0.3)
ouroboros-network> [__3] skipping: io-classes-1.0.0.1, io-classes-1.0.0.0, io-classes-0.6.0.0,
ouroboros-network> io-classes-0.5.0.0, io-classes-0.4.0.0 (has the same characteristics that
ouroboros-network> caused the previous version to fail: excluded by constraint '^>=0.3' from
ouroboros-network> 'ouroboros-network-testing')
ouroboros-network> [__3] rejecting: io-classes-0.3.0.0 (conflict: ouroboros-network =>
ouroboros-network> io-classes^>=1.1)
ouroboros-network> [__3] skipping: io-classes-0.2.0.0 (has the same characteristics that caused
ouroboros-network> the previous version to fail: excluded by constraint '^>=1.1' from
ouroboros-network> 'ouroboros-network')
ouroboros-network> [__3] fail (backjumping, conflict set: io-classes, ouroboros-network,
ouroboros-network> ouroboros-network-testing)
ouroboros-network> After searching the rest of the dependency tree exhaustively, these were the
ouroboros-network> goals I've had most trouble fulfilling: base, ouroboros-network, io-classes,
ouroboros-network> ouroboros-network-testing, ouroboros-network-framework
ouroboros-network> Try running with --minimize-conflict-set to improve the error message.
ouroboros-network> )
```
We need to look closely to identify the real issue:
```
ouroboros-network-0.6.0.0
+-> ouroboros-network-framework
| +-> ouroboros-network-framework-0.5.0.0 [selected]
| +-> ouroboros-network-testing-0.2.0.1 [selected]
+-> io-classes
+-> io-classes-1.1.0.0 [fail; ouroboros-network-testing => io-classes^>=0.3]
+-> io-classes-0.3.0.0 [fail; ouroboros-network => io-classes^>=1.1]
```
> N.B.: `ouroboros-network-testing-0.3.0.0` has not been released with `ouroboros-network-0.6.0.0`, causing the resolution to fail. The issue was addressed in [this commit](https://github.com/input-output-hk/cardano-haskell-packages/pull/234/commits/b1152b1398f46c8c50e8e957fb26e9cdeb418767) on `coot/ouroboros-network-0.6.0.0`.
## Proposed Solution
I suggest enhancing the solver output to be more readable and easier to parse, this has been already proposed:
- https://github.com/haskell/cabal/issues/8475.
One improvement to this proposal would be to mark the latest known version of a package to the solver, as described here:
- https://github.com/haskell/cabal/issues/1751.
This would overall contribute to a better user experience. WDYT?
## Related Issues
Implementing this proposal would also be an opportunity to address:
- https://github.com/haskell/cabal/issues/5488
- https://github.com/haskell/cabal/issues/7597
- https://github.com/haskell/cabal/issues/7993
- https://github.com/haskell/cabal/issues/8525
Further enhancements could be made by addressing:
- https://github.com/haskell/cabal/issues/2728
- https://github.com/haskell/cabal/issues/4285
- https://github.com/haskell/cabal/issues/4332
- https://github.com/haskell/cabal/issues/5647
- https://github.com/haskell/cabal/issues/6886
In summary, we believe that enhancing the Cabal solver output will significantly improve the user experience and save developers time. I plan to implement most of these features in a fork next weeks and hope to got inputs from the community 🙂
Contributor guide
Assessment
This issue has not been assessed yet.