Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install ghc-vis #9170

Open
Aritra8438 opened this issue Aug 13, 2023 · 9 comments
Open

Failed to install ghc-vis #9170

Aritra8438 opened this issue Aug 13, 2023 · 9 comments

Comments

@Aritra8438
Copy link

Describe the bug
There is an issued while installing ghc-vis.

In order, the following will be built (use -v for more details):
 - cairo-0.13.10.0 (lib:cairo) (requires build)
 - glib-0.13.10.0 (lib:glib) (requires build)
 - svgcairo-0.13.2.1 (lib:svgcairo) (requires build)
 - pango-0.13.10.0 (lib:pango) (requires build)
 - gio-0.13.10.0 (lib:gio) (requires build)
 - gtk3-0.15.8 (lib:gtk3) (requires build)
 - xdot-0.3.0.4 (lib) (requires build)
 - ghc-vis-0.9.3 (lib:ghc-vis) (requires build)
Starting     glib-0.13.10.0 (all, legacy fallback)
Starting     cairo-0.13.10.0 (all, legacy fallback)

Failed to build cairo-0.13.10.0. The failure occurred during the configure
step.
Build log (
/home/aritra/.cabal/logs/ghc-8.8.4/cairo-0.13.10.0-81b8c943a021bd4237b0e6e66141cec1a243c78847a3f4ee42b73e4f788c4b52.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18076/cairo-0.13.10.0/dist/setup/setup.hs, /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18076/cairo-0.13.10.0/dist/setup/Main.o )
Linking /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18076/cairo-0.13.10.0/dist/setup/setup ...
Configuring cairo-0.13.10.0...
setup: The program 'pkg-config' version >=0.9.0 is required but it could not
be found.


Failed to build glib-0.13.10.0. The failure occurred during the configure
step.
Build log (
/home/aritra/.cabal/logs/ghc-8.8.4/glib-0.13.10.0-01abe28a789687fd3b06788a8baed6586a6bcaa979f42695260a3010ad2980ea.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18077/glib-0.13.10.0/dist/setup/setup.hs, /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18077/glib-0.13.10.0/dist/setup/Main.o )
Linking /tmp/cabal-install.-18076/dist-newstyle/tmp/src-18077/glib-0.13.10.0/dist/setup/setup ...
Configuring glib-0.13.10.0...
setup: The program 'pkg-config' version >=0.9.0 is required but it could not
be found.

cabal: Failed to build cairo-0.13.10.0 (which is required by ghc-vis-0.9.3).
See the build log above for details.
Failed to build glib-0.13.10.0 (which is required by ghc-vis-0.9.3). See the
build log above for details.

To Reproduce

  • Install haskell.
  • Attempt to install ghc-vis using cabal install ghc-vis

Expected behavior
ghc-vis seems important to me as a learner.

System information

cabal-install version 3.0.0.0
compiled using version 3.0.1.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 8.8.4
@geekosaur
Copy link
Collaborator

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.

@Aritra8438
Copy link
Author

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

@geekosaur
Copy link
Collaborator

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.

@Aritra8438
Copy link
Author

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 😔

@chreekat
Copy link
Collaborator

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.

@put101
Copy link

put101 commented Sep 30, 2023

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.

@geekosaur
Copy link
Collaborator

geekosaur commented Sep 30, 2023

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)

@geekosaur
Copy link
Collaborator

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.

@AnDongLi
Copy link

AnDongLi commented Jan 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants