Open Aritra8438 opened 1 year ago
pkg-config
has to be installed via your distribution package manager. There are too many different distributions and too many different names for the package for cabal to do this for you. On Debian-derived distributions apt install build-essential
will usually get you most of what you need to do C or Haskell builds; if it doesn't, the package name is usually pkg-config
like the executable.
Note that you will also need the development libraries for Glib and Gtk3. Again, and even more so, these vary too much for cabal to try to install them itself.
Hi @geekosaur, thanks!
Now it's showing
$ cabal install ghc-vis --allow-newer=svgcairo:Cabal --minimize-conflict-set
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: ghc-vis-0.9.3 (user goal)
[__1] next goal: svgcairo (dependency of ghc-vis)
[__1] rejecting: svgcairo-0.13.2.1, svgcairo-0.13.2.0, svgcairo-0.13.1.1,
svgcairo-0.13.1.0, svgcairo-0.13.0.4, svgcairo-0.13.0.3, svgcairo-0.13.0.2,
svgcairo-0.13.0.1, svgcairo-0.13.0.0, svgcairo-0.12.5.2, svgcairo-0.12.5.1,
svgcairo-0.12.5.0, svgcairo-0.12.1.1, svgcairo-0.12.1 (conflict: pkg-config
package librsvg-2.0==2.16.0 || >2.16.0, not found in the pkg-config database)
[__1] rejecting: svgcairo-0.12.0 (conflict: pkg-config package
cairo-svg==1.6.0 || >1.6.0, not found in the pkg-config database)
[__1] rejecting: svgcairo-0.11.1, svgcairo-0.11.0 (conflict: ghc-vis =>
svgcairo>=0.12)
[__1] fail (backjumping, conflict set: ghc-vis, svgcairo)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: gtk, ghc-vis, svgcairo
Yes, that's one of the OS packages you'll need to install; pkg-config reports on OS devel packages in a more portable way than OS packages themselves, but then you have to map them to OS package names somehow. On my Ubuntu system apt-cache search librsvg
tells me the development package is librsvg-dev
and apt-cache search cairo-svg
returns nothing but apt-cache search cairo | grep svg
tells me there is a cairosvg
package but not whether there's a devel package for it. Looking up the package in the Ubuntu repositories tells me there isn't. Digging a bit tells me that it actually comes from cairo-dev
. (This is why cabal can't install OS deps for you…)
Expect to run into more of these.
Expect to run into more of these.
Here is the list of all the packages with name containing cairo. I have installed many of them which I thought might be related. Still, no luck!
Also, for gtk, which package should I install?
It's pretty frustating 😔
Hi @Aritra8438 ,
Unfortunately I don't think you will find answers on the Cabal issue tracker, since Cabal itself is mostly focused on managing Haskell software—not the system dependencies. You might have more luck on ghc-vis' own issue tracker?
I wish it were easier, but installing system packages is harder than it seems because there are so many different ways of doing it.
I have the same problem to install ghc-vis.
~ % cabal install ghc-vis
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: ghc-vis-0.9.3 (user goal)
[__1] trying: svgcairo-0.13.2.1 (dependency of ghc-vis)
[__2] next goal: svgcairo:setup.Cabal (dependency of svgcairo)
[__2] rejecting: svgcairo:setup.Cabal-3.6.3.0/installed-3.6.3.0 (conflict:
svgcairo => svgcairo:setup.Cabal>=1.24 && <3.1)
[__2] skipping: svgcairo:setup.Cabal-3.10.1.0, svgcairo:setup.Cabal-3.8.1.0,
svgcairo:setup.Cabal-3.6.3.0, svgcairo:setup.Cabal-3.6.2.0,
svgcairo:setup.Cabal-3.6.1.0, svgcairo:setup.Cabal-3.6.0.0,
svgcairo:setup.Cabal-3.4.1.0, svgcairo:setup.Cabal-3.4.0.0,
svgcairo:setup.Cabal-3.2.1.0, svgcairo:setup.Cabal-3.2.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=1.24 && <3.1' from 'svgcairo')
[__2] rejecting: svgcairo:setup.Cabal-3.0.2.0, svgcairo:setup.Cabal-3.0.1.0,
svgcairo:setup.Cabal-3.0.0.0, svgcairo:setup.Cabal-2.4.1.0,
svgcairo:setup.Cabal-2.4.0.1, svgcairo:setup.Cabal-2.4.0.0,
svgcairo:setup.Cabal-2.2.0.1, svgcairo:setup.Cabal-2.2.0.0,
svgcairo:setup.Cabal-2.0.1.1, svgcairo:setup.Cabal-2.0.1.0,
svgcairo:setup.Cabal-2.0.0.2, svgcairo:setup.Cabal-1.24.2.0,
svgcairo:setup.Cabal-1.24.0.0, svgcairo:setup.Cabal-1.22.8.0,
svgcairo:setup.Cabal-1.22.7.0, svgcairo:setup.Cabal-1.22.6.0,
svgcairo:setup.Cabal-1.22.5.0, svgcairo:setup.Cabal-1.22.4.0,
svgcairo:setup.Cabal-1.22.3.0, svgcairo:setup.Cabal-1.22.2.0,
svgcairo:setup.Cabal-1.22.1.1, svgcairo:setup.Cabal-1.22.1.0,
svgcairo:setup.Cabal-1.22.0.0, svgcairo:setup.Cabal-1.20.0.4,
svgcairo:setup.Cabal-1.20.0.3, svgcairo:setup.Cabal-1.20.0.2,
svgcairo:setup.Cabal-1.20.0.1, svgcairo:setup.Cabal-1.20.0.0,
svgcairo:setup.Cabal-1.18.1.7, svgcairo:setup.Cabal-1.18.1.6,
svgcairo:setup.Cabal-1.18.1.5, svgcairo:setup.Cabal-1.18.1.4,
svgcairo:setup.Cabal-1.18.1.3, svgcairo:setup.Cabal-1.18.1.2,
svgcairo:setup.Cabal-1.18.1.1, svgcairo:setup.Cabal-1.18.1,
svgcairo:setup.Cabal-1.18.0, svgcairo:setup.Cabal-1.16.0.3,
svgcairo:setup.Cabal-1.16.0.2, svgcairo:setup.Cabal-1.16.0.1,
svgcairo:setup.Cabal-1.16.0, svgcairo:setup.Cabal-1.14.0,
svgcairo:setup.Cabal-1.12.0, svgcairo:setup.Cabal-1.10.2.0,
svgcairo:setup.Cabal-1.10.1.0, svgcairo:setup.Cabal-1.10.0.0,
svgcairo:setup.Cabal-1.8.0.6, svgcairo:setup.Cabal-1.8.0.4,
svgcairo:setup.Cabal-1.8.0.2, svgcairo:setup.Cabal-1.6.0.3,
svgcairo:setup.Cabal-1.6.0.2, svgcairo:setup.Cabal-1.6.0.1,
svgcairo:setup.Cabal-1.4.0.2, svgcairo:setup.Cabal-1.4.0.1,
svgcairo:setup.Cabal-1.4.0.0, svgcairo:setup.Cabal-1.2.4.0,
svgcairo:setup.Cabal-1.2.3.0, svgcairo:setup.Cabal-1.2.2.0,
svgcairo:setup.Cabal-1.2.1, svgcairo:setup.Cabal-1.1.6,
svgcairo:setup.Cabal-1.24.1.0 (constraint from minimum version of Cabal used
by Setup.hs requires >=3.4)
[__2] fail (backjumping, conflict set: svgcairo, svgcairo:setup.Cabal)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: ghc-vis, base, svgcairo:setup.Cabal,
cairo, svgcairo
Try running with --minimize-conflict-set to improve the error message.
This is not a bug. svgcairo
declares a dependency on an old version of Cabal
in its Setup.hs
, but your cabal-install
uses a newer one. I'm successfully building with --allow-newer=Cabal
right now, although it hasn't finished yet.
Custom Setup.hs
scripts are difficult to support, and depending on specific Cabal versions in them leads to this kind of failure. You just have to read the error carefully to recognize the problem.
(update, that was a dumb typo, whoops)
I needed one more hack which appears to be Debian/Ubuntu specific: svgcairo
looks for librsvg/librsvg-features.h
, but it's librsvg/rsvg-features.h
instead.
I have encountered all above problems when using cabal to install it, at the end I followed the instructions in project readme in github: https://github.com/def-/ghc-vis, changed the versions in https://github.com/def-/ghc-vis/blob/master/stack.yaml( from 0.13.8.0 to 0.13.10.0 because I had issued when installing with 0.13.8). Finally I can use it now! My OS is Ubuntu 22.04 and the commands I ran after git clone the project: stack install.
Describe the bug There is an issued while installing
ghc-vis
.To Reproduce
ghc-vis
usingcabal install ghc-vis
Expected behavior ghc-vis seems important to me as a learner.
System information