timbod7 / haskell-chart

A 2D charting library for haskell
430 stars 85 forks source link

Chart-diagrams fail to work with GHC.8.10.7 #227

Closed shubhamkumar13 closed 2 years ago

shubhamkumar13 commented 3 years ago

I was going through the Haskell in Depth exercise in Part 1 - Chapter 3 and the exercise to build a small application which uses Chart and Chart-diagram.

But when I try to build Chart-diagram (in the .cabal file) I end up with the following error.

☁  stockquotes [main] ⚡  cabal run
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: stockquotes-0.1.0.0 (user goal)
[__1] trying: diagrams-lib-1.4.4 (dependency of stockquotes)
[__2] trying: diagrams-core-1.5.0 (dependency of diagrams-lib)
[__3] next goal: Chart-diagrams (dependency of stockquotes)
[__3] rejecting: Chart-diagrams-1.9.3 (conflict: diagrams-core==1.5.0,
Chart-diagrams => diagrams-core>=1.3 && <1.5)
[__3] skipping: Chart-diagrams-1.9.2, Chart-diagrams-1.9.1,
Chart-diagrams-1.9, Chart-diagrams-1.8.3, Chart-diagrams-1.8.2,
Chart-diagrams-1.8.1, Chart-diagrams-1.8, Chart-diagrams-1.7.1,
Chart-diagrams-1.7, Chart-diagrams-1.6, Chart-diagrams-1.5.4,
Chart-diagrams-1.5.1, Chart-diagrams-1.5, Chart-diagrams-1.4,
Chart-diagrams-1.3.3, Chart-diagrams-1.3.2, Chart-diagrams-1.3.1,
Chart-diagrams-1.3, Chart-diagrams-1.2.4, Chart-diagrams-1.2.3,
Chart-diagrams-1.2.2, Chart-diagrams-1.2, Chart-diagrams-1.1,
Chart-diagrams-1.0 (has the same characteristics that caused the previous
version to fail: excludes 'diagrams-core' version 1.5.0)
[__3] fail (backjumping, conflict set: Chart-diagrams, diagrams-core,
stockquotes)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, diagrams-core, Chart-diagrams,
stockquotes, diagrams-lib
Try running with --minimize-conflict-set to improve the error message.

I'm running this on a m1 mac and using ghc.8.10.7

timbod7 commented 3 years ago

Looks like the stockquotes library depends on diagrams-core 1.5, but currently chart-diagrams requires >= 1.3 && < 1.5.

I didn’t know that the chart library is used in the Haskell in Depth book. How does that book recommend you manage dependencies so the examples continue to work? As a stack user I’m not familiar with modern cabal.

geraldus commented 3 years ago

This looks like to be fixed by 93a1a842139daf249b61f90c7f3f679433cf329a, however there were neither minor version bump, no Hackage update. You have to create cabal.project in project root and specify source-repository-package with exact commit number to succeed with building project.

Can you please bump versions and upload a version with restricted upped bounds on diagrams-core to Hackage?

timbod7 commented 3 years ago

I'm happy to do a release if current master is what you need.

geraldus commented 3 years ago

I'm happy to do a release if current master is what you need.

Well, all I've tested is that relaxed upper constraint makes package buildable with GHC 8.10.7 indeed. I don't know about other differencies of master branch from current Hackage release. Althought I believe new release could be helpfull for other people.

Thanks

ulysses4ever commented 2 years ago

Builds okay now, can be closed.