Skip to content

Instantly share code, notes, and snippets.

@Ou42
Last active September 22, 2023 01:56
Show Gist options
  • Save Ou42/b34daba4b7183a2bf79cabea37647855 to your computer and use it in GitHub Desktop.
Save Ou42/b34daba4b7183a2bf79cabea37647855 to your computer and use it in GitHub Desktop.
Trying to get `ghc-vis` to install

Attempt to install ghc-vis - 2023-09-20

Attempting to follow build instructions (first few minutes) from:

$ cabal install --env . --lib ghc-vis-0.7.2.9
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: ghc-vis (user goal)
[__0] rejecting: ghc-vis-0.9.3, ghc-vis-0.9.2, ghc-vis-0.9.1, ghc-vis-0.9,
ghc-vis-0.8 (constraint from user target requires ==0.7.2.9)
[__0] trying: ghc-vis-0.7.2.9
[__1] next goal: base (dependency of ghc-vis)
[__1] rejecting: base-4.14.3.0/installed-4.14.3.0 (conflict: ghc-vis =>
base>=4.5 && <4.9)
[__1] skipping: base-4.18.0.0, base-4.17.2.0, base-4.17.1.0, base-4.17.0.0,
base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0,
base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=4.5 && <4.9' from 'ghc-vis')
[__1] rejecting: base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2,
base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0,
base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0,
base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0,
base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable package requires
installed instance)
[__1] fail (backjumping, conflict set: base, ghc-vis)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, ghc-vis

goal: build/use ghc-vis - 2023-09-21 [SUCCESS!]

Attempting to follow build instructions (first few minutes) from:

sub-goal: build/compile a .c app that uses gtk3 [SUCCESS]

per: https://docs.gtk.org/gtk3/getting_started.html

$ sudo apt install build-essential libgtk-3-dev
$ gcc `pkg-config --cflags gtk+-3.0` -o test-gtk3 test-gtk3.c `pkg-config --libs gtk+-3.0`
$ ./test-gtk3 

And a 200x200 window was shown!!

$ cd ../take3
$ cabal install --env . --lib gtk3
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - utf8-string-1.0.2 (lib) (requires download & build)
 - glib-0.13.10.0 (lib:glib) (requires download & build)
 - cairo-0.13.10.0 (lib:cairo) (requires download & build)
 - gio-0.13.10.0 (lib:gio) (requires download & build)
 - pango-0.13.10.0 (lib:pango) (requires download & build)
 - gtk3-0.15.8 (lib:gtk3) (requires download & build)
Downloading  utf8-string-1.0.2
Downloaded   utf8-string-1.0.2
Downloading  cairo-0.13.10.0
Starting     utf8-string-1.0.2 (lib)
Building     utf8-string-1.0.2 (lib)
Downloaded   cairo-0.13.10.0
Downloading  glib-0.13.10.0
Downloaded   glib-0.13.10.0
Downloading  gio-0.13.10.0
Downloaded   gio-0.13.10.0
Downloading  pango-0.13.10.0
Downloaded   pango-0.13.10.0
Downloading  gtk3-0.15.8
Downloaded   gtk3-0.15.8
Installing   utf8-string-1.0.2 (lib)
Completed    utf8-string-1.0.2 (lib)
Starting     glib-0.13.10.0 (all, legacy fallback)
Starting     cairo-0.13.10.0 (all, legacy fallback)
Building     glib-0.13.10.0 (all, legacy fallback)
Building     cairo-0.13.10.0 (all, legacy fallback)
Installing   glib-0.13.10.0 (all, legacy fallback)
Completed    glib-0.13.10.0 (all, legacy fallback)
Starting     gio-0.13.10.0 (all, legacy fallback)
Building     gio-0.13.10.0 (all, legacy fallback)
Installing   cairo-0.13.10.0 (all, legacy fallback)
Completed    cairo-0.13.10.0 (all, legacy fallback)
Starting     pango-0.13.10.0 (all, legacy fallback)
Building     pango-0.13.10.0 (all, legacy fallback)
Installing   gio-0.13.10.0 (all, legacy fallback)
Completed    gio-0.13.10.0 (all, legacy fallback)
Installing   pango-0.13.10.0 (all, legacy fallback)
Completed    pango-0.13.10.0 (all, legacy fallback)
Starting     gtk3-0.15.8 (all, legacy fallback)
Building     gtk3-0.15.8 (all, legacy fallback)
Installing   gtk3-0.15.8 (all, legacy fallback)
Completed    gtk3-0.15.8 (all, legacy fallback)
$ cabal install gtk2hs-buildtools --overwrite-policy=always
Resolving dependencies...
Up to date
Symlinking 'gtk2hsC2hs' to '/home/me/.cabal/bin/gtk2hsC2hs'
Symlinking 'gtk2hsHookGenerator' to '/home/me/.cabal/bin/gtk2hsHookGenerator'
Symlinking 'gtk2hsTypeGen' to '/home/me/.cabal/bin/gtk2hsTypeGen'
$ cabal install --env . --lib ghc-vis
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: base (user goal)
[__0] rejecting: base-4.18.0.0, base-4.17.2.0, base-4.17.1.0, base-4.17.0.0,
base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0 (constraint from user target requires ==4.14.3.0)
[__0] trying: base-4.14.3.0/installed-4.14.3.0
[__1] trying: ghc-vis-0.9.3 (user goal)
[__2] next goal: svgcairo (dependency of ghc-vis)
[__2] 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, svgcairo-0.12.0
(conflict: pkg-config package librsvg-2.0>=2.16.0, not found in the pkg-config
database)
[__2] rejecting: svgcairo-0.11.1 (conflict: ghc-vis => svgcairo>=0.12)
[__2] skipping: svgcairo-0.11.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '>=0.12' from 'ghc-vis')
[__2] 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: ghc-vis, gtk, svgcairo, base
Try running with --minimize-conflict-set to improve the error message.
$ cabal install --env . --lib ghc-vis --allow-newer=base svgcairo
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: svgcairo (user goal)
[__0] 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, svgcairo-0.12.0,
svgcairo-0.11.1, svgcairo-0.11.0 (conflict: pkg-config package
librsvg-2.0>=2.16.0, not found in the pkg-config database)
[__0] fail (backjumping, conflict set: svgcairo)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: svgcairo
$ sudo apt install librsvg2-dev
$ cabal install --env . --lib ghc-vis --allow-newer=base svgcairo
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: svgcairo-0.13.2.1 (user goal)
[__1] next goal: svgcairo:setup.Cabal (dependency of svgcairo)
[__1] rejecting: svgcairo:setup.Cabal-3.2.1.0/installed-3.2.1.0 (conflict:
svgcairo => svgcairo:setup.Cabal>=1.24 && <3.1)
[__1] 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')
[__1] 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.2)
[__1] 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: svgcairo:setup.Cabal, svgcairo
$ apt-cache search cairo | grep dev
libcairo2-dev - Development files for the Cairo 2D graphics library
libcairomm-1.0-dev - C++ wrappers for Cairo (development files)
libpixman-1-dev - pixel-manipulation library for X and cairo (development files)
python3-cairo-dev - Python3 cairo bindings: development files
cairo-dock-dev - Cairo-dock development file
giza-dev - Lightweight scientific plotting library (development files)
golang-github-gotk3-gotk3-dev - Go bindings for GTK3
guile-cairo-dev - Guile bindings for Cairo, development files
lib2geom-dev - robust computational geometry framework -- development library
libaosd-dev - atheme.org's on screen display library - dev
libcairo-5c-dev - library for cairo nickle bindings dev files
libcairo-ocaml-dev - OCaml bindings for Cairo
libcairo2-ocaml-dev - OCaml binding for Cairo (development files)
libghc-cairo-dev - binding to the Cairo library
libghc-chart-cairo-dev - Cairo backend for Charts
libghc-chart-dev - library for generating 2D Charts and Plots
libghc-diagrams-cairo-dev - Cairo backend for the diagrams drawing EDSL
libghc-diagrams-dev - embedded domain-specific language for declarative vector graphics
libghc-diagrams-gtk-dev - Backend for rendering diagrams directly to GTK windows
libghc-gi-cairo-connector-dev - GI friendly Binding to the Cairo library
libghc-gi-cairo-dev - Cairo bindings
libghc-gi-cairo-render-dev - GI friendly Binding to the Cairo library.
libghc-pango-dev - binding to the Pango text rendering engine
libgoocanvas-2.0-dev - Canvas widget for GTK+ - development files
libgoocanvasmm-2.0-dev - C++ bindings for GooCanvas - development files
libgtk3.0-cil-dev - CLI binding for the GTK+ toolkit 3.0
libresvg-dev - SVG rendering library (development files)
librust-cairo-rs-dev - Rust bindings for the Cairo library - Rust source code
librust-cairo-sys-rs-dev - FFI bindings to libcairo - Rust source code
librust-gdkx11-sys-dev - FFI binding for libgdkx11 - Rust source code
librust-pangocairo-dev - Rust bindings for the PangoCairo library - Rust source code
librust-pangocairo-sys-dev - FFI bindings to libgtk-3 - Rust source code
librust-resvg-dev - SVG rendering library - Rust source code
r-cran-cairo - GNU R graphics device using cairo graphics library

sub-goal: install svgcairo [SUCCESS!]

$ sudo apt install libghc-cairo-dev
$ sudo apt install libghc-gi-cairo-dev
$ cabal install svgcairo
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: svgcairo-0.13.2.1 (user goal)
[__1] next goal: svgcairo:setup.Cabal (dependency of svgcairo)
[__1] rejecting: svgcairo:setup.Cabal-3.2.1.0/installed-3.2.1.0 (conflict:
svgcairo => svgcairo:setup.Cabal>=1.24 && <3.1)
[__1] 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')
[__1] 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.2)
[__1] 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: svgcairo:setup.Cabal, svgcairo
$ cabal install svgcairo --allow-newer=svgcairo
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: svgcairo-0.13.2.1 (user goal)
[__1] next goal: svgcairo:setup.Cabal (dependency of svgcairo)
[__1] rejecting: svgcairo:setup.Cabal-3.2.1.0/installed-3.2.1.0 (conflict:
svgcairo => svgcairo:setup.Cabal>=1.24 && <3.1)
[__1] 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')
[__1] 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.2)
[__1] 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: svgcairo:setup.Cabal, svgcairo
$ cabal install svgcairo --allow-newer=svgcairo:Cabal
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - svgcairo-0.13.2.1 (lib:svgcairo) (requires download & build)
Downloading  svgcairo-0.13.2.1
Downloaded   svgcairo-0.13.2.1
Starting     svgcairo-0.13.2.1 (all, legacy fallback)
Building     svgcairo-0.13.2.1 (all, legacy fallback)

Failed to build svgcairo-0.13.2.1.
Build log (
/home/me/.cabal/logs/ghc-8.10.7/svgcairo-0.13.2.1-ebe419cabd7523b490de364fb77c617bccd6af9252adca151e0a300b6a2dc6b0.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-39956/dist-newstyle/tmp/src-39956/svgcairo-0.13.2.1/dist/setup/setup.hs, /tmp/cabal-install.-39956/dist-newstyle/tmp/src-39956/svgcairo-0.13.2.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-39956/dist-newstyle/tmp/src-39956/svgcairo-0.13.2.1/dist/setup/setup ...
Configuring svgcairo-0.13.2.1...
./svgcairo.h:6:10: fatal error: librsvg/librsvg-features.h: No such file or directory
    6 | #include <librsvg/librsvg-features.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Preprocessing library for svgcairo-0.13.2.1..
setup: Error during preprocessing
cabal: Failed to build svgcairo-0.13.2.1. See the build log above for details.

Something actionable?!

  • searched and found: gtk2hs/svgcairo#14

    Savelenko commented Dec 9, 2021

    I was attempting to build ghc-vis with stack (in Manjaro Linux) and encountered the same problem. I simply made a symlink to rsvg-features.h named librsvg-features.h and this solved the problem.

To find where header files are located:

  • https://unix.stackexchange.com/questions/668836/how-to-find-all-possible-locations-for-libraries-and-header-files-on-any-distro
  • $ cpp -v /dev/null -o /dev/null
    ...
    #include <...> search starts here:
    /usr/lib/gcc/x86_64-linux-gnu/11/include
    /usr/local/include
    /usr/include/x86_64-linux-gnu
    /usr/include
    End of search list.
    ...
    LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
    ...
    
    ---
    
    $ cd /usr/include
    
    $ tree | grep svg
    │   ├── cairo-svg.h
    ├── librsvg-2.0
    │   └── librsvg
    │       ├── rsvg-cairo.h
    │       ├── rsvg-features.h
    │       ├── rsvg.h
    │       └── rsvg-version.h
    
    ---
    
    $ ln -s rsvg-features.h librsvg-features.h
    ln: failed to create symbolic link 'librsvg-features.h': Permission denied
    
    $ sudo ln -s rsvg-features.h librsvg-features.h
    
    $ ll
    total 96
    drwxr-xr-x 2 root root  4096 Sep 21 10:49 .
    drwxr-xr-x 3 root root  4096 Sep 21 09:17 ..
    lrwxrwxrwx 1 root root    15 Sep 21 10:49 librsvg-features.h -> rsvg-features.h
    -rw-r--r-- 1 root root 17984 Jul 28 05:55 rsvg-cairo.h
    -rw-r--r-- 1 root root  6193 Jul 28 05:55 rsvg-features.h
    -rw-r--r-- 1 root root 54282 Jul 28 05:55 rsvg.h
    -rw-r--r-- 1 root root   338 Jul 28 05:55 rsvg-version.h
    
    

Still not compiling:

~/cs/haskell/ghc-vis/take3
$ cabal install svgcairo --allow-newer=svgcairo:Cabal 
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - svgcairo-0.13.2.1 (lib:svgcairo) (requires build)
Starting     svgcairo-0.13.2.1 (all, legacy fallback)
Building     svgcairo-0.13.2.1 (all, legacy fallback)

Failed to build svgcairo-0.13.2.1.
Build log (
/home/me/.cabal/logs/ghc-8.10.7/svgcairo-0.13.2.1-ebe419cabd7523b490de364fb77c617bccd6af9252adca151e0a300b6a2dc6b0.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-47971/dist-newstyle/tmp/src-47971/svgcairo-0.13.2.1/dist/setup/setup.hs, /tmp/cabal-install.-47971/dist-newstyle/tmp/src-47971/svgcairo-0.13.2.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-47971/dist-newstyle/tmp/src-47971/svgcairo-0.13.2.1/dist/setup/setup ...
Configuring svgcairo-0.13.2.1...
Preprocessing library for svgcairo-0.13.2.1..
Building library for svgcairo-0.13.2.1..
[1 of 1] Compiling Graphics.Rendering.Cairo.SVG ( dist/build/Graphics/Rendering/Cairo/SVG.hs, dist/build/Graphics/Rendering/Cairo/SVG.o, dist/build/Graphics/Rendering/Cairo/SVG.dyn_o )
In file included from /usr/include/stdio.h:894,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/Flags.h:16,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/storage/GC.h:249,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/Rts.h:210,

                 from /tmp/ghc48170_0/ghc_3.c:2:0: error: 
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘sprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       39 |                                   __glibc_objsize (__s), __fmt,
          |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       40 |                                   __va_arg_pack ());
          |                                   ~~~~~~~~~~~~~~~~~
   |
38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘snprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       72 |                                    __glibc_objsize (__s), __fmt,
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       73 |                                    __va_arg_pack ());
          |                                    ~~~~~~~~~~~~~~~~~
   |
71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘fprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      106 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:112:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘dprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:149:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      150 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:186:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      187 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘__asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:194:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      195 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘obstack_printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:202:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      203 |                                __va_arg_pack ());
          |                                ~~~~~~~~~~~~~~~~~
    |
202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build svgcairo-0.13.2.1. See the build log above for details.

$ apt-cache search pango
$ apt-cache search pango | grep dev
$ h | grep install
$ sudo apt install libghc-gi-pango-dev libghc-pango-dev
$ apt-cache search graphviz | grep dev
$ sudo apt install libghc-graphviz-dev
$ cabal update
$ cabal install gtk2hs-buildtools --overwrite-policy=always

$ cabal install ghc-vis --disable-library-profiling --allow-newer
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - base-compat-0.13.0 (lib) (requires build)
 - colour-2.3.6 (lib) (requires build)
 - dlist-1.0 (lib) (requires build)
 - fgl-5.8.1.1 (lib) (requires download & build)
 - ghc-heap-view-0.6.4 (lib:ghc-heap-view) (requires download & build)
 - polyparse-1.13 (lib) (requires download & build)
 - svgcairo-0.13.2.1 (lib:svgcairo) (requires build)
 - temporary-1.3 (lib) (requires download & build)
 - wl-pprint-text-1.2.0.2 (lib) (requires download & build)
 - graphviz-2999.20.1.0 (lib) (requires download & build)
 - xdot-0.3.0.4 (lib) (requires download & build)
 - ghc-vis-0.9.3 (lib:ghc-vis) (requires download & build)
Downloading  fgl-5.8.1.1
Starting     colour-2.3.6 (lib)
Starting     dlist-1.0 (lib)
Starting     base-compat-0.13.0 (lib)
Downloaded   fgl-5.8.1.1
Downloading  temporary-1.3
Starting     fgl-5.8.1.1 (lib)
Building     dlist-1.0 (lib)
Building     colour-2.3.6 (lib)
Downloaded   temporary-1.3
Downloading  polyparse-1.13
Building     base-compat-0.13.0 (lib)
Downloaded   polyparse-1.13
Downloading  wl-pprint-text-1.2.0.2
Building     fgl-5.8.1.1 (lib)
Downloaded   wl-pprint-text-1.2.0.2
Downloading  graphviz-2999.20.1.0
Downloaded   graphviz-2999.20.1.0
Downloading  ghc-heap-view-0.6.4
Downloaded   ghc-heap-view-0.6.4
Downloading  xdot-0.3.0.4
Downloaded   xdot-0.3.0.4
Downloading  ghc-vis-0.9.3
Downloaded   ghc-vis-0.9.3
Installing   dlist-1.0 (lib)
Completed    dlist-1.0 (lib)
Starting     ghc-heap-view-0.6.4 (all, legacy fallback)
Installing   base-compat-0.13.0 (lib)
Completed    base-compat-0.13.0 (lib)
Starting     polyparse-1.13 (lib)
Building     polyparse-1.13 (lib)
Building     ghc-heap-view-0.6.4 (all, legacy fallback)
Installing   colour-2.3.6 (lib)
Completed    colour-2.3.6 (lib)
Starting     svgcairo-0.13.2.1 (all, legacy fallback)
Building     svgcairo-0.13.2.1 (all, legacy fallback)
Installing   ghc-heap-view-0.6.4 (all, legacy fallback)
Starting     temporary-1.3 (lib)
Completed    ghc-heap-view-0.6.4 (all, legacy fallback)
Building     temporary-1.3 (lib)
Installing   fgl-5.8.1.1 (lib)
Completed    fgl-5.8.1.1 (lib)
Installing   temporary-1.3 (lib)
Completed    temporary-1.3 (lib)
Installing   polyparse-1.13 (lib)
Completed    polyparse-1.13 (lib)

Failed to build svgcairo-0.13.2.1.
Build log (
/home/me/.cabal/logs/ghc-8.10.7/svgcairo-0.13.2.1-ebe419cabd7523b490de364fb77c617bccd6af9252adca151e0a300b6a2dc6b0.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-56453/dist-newstyle/tmp/src-56454/svgcairo-0.13.2.1/dist/setup/setup.hs, /tmp/cabal-install.-56453/dist-newstyle/tmp/src-56454/svgcairo-0.13.2.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-56453/dist-newstyle/tmp/src-56454/svgcairo-0.13.2.1/dist/setup/setup ...
Configuring svgcairo-0.13.2.1...
Preprocessing library for svgcairo-0.13.2.1..
Building library for svgcairo-0.13.2.1..
[1 of 1] Compiling Graphics.Rendering.Cairo.SVG ( dist/build/Graphics/Rendering/Cairo/SVG.hs, dist/build/Graphics/Rendering/Cairo/SVG.o, dist/build/Graphics/Rendering/Cairo/SVG.dyn_o )
In file included from /usr/include/stdio.h:894,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/Flags.h:16,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/storage/GC.h:249,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/Rts.h:210,

                 from /tmp/ghc58124_0/ghc_3.c:2:0: error: 
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘sprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       39 |                                   __glibc_objsize (__s), __fmt,
          |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       40 |                                   __va_arg_pack ());
          |                                   ~~~~~~~~~~~~~~~~~
   |
38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘snprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       72 |                                    __glibc_objsize (__s), __fmt,
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       73 |                                    __va_arg_pack ());
          |                                    ~~~~~~~~~~~~~~~~~
   |
71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘fprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      106 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:112:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘dprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:149:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      150 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:186:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      187 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘__asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:194:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      195 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘obstack_printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:202:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      203 |                                __va_arg_pack ());
          |                                ~~~~~~~~~~~~~~~~~
    |
202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build svgcairo-0.13.2.1 (which is required by ghc-vis-0.9.3).
See the build log above for details.

Built / Installed svgcairo locally but SEMI-NO GO!

  • Downloaded svgcairo-0.13.2.1
  • Edited svgcairo.cabal
  • built via: $ cabal install --lib

But how to use this version when building ghc-vis?!

$ cd ~/cs/haskell/ghc-vis/ghc-vis-0.9.3
$ cabal install --env . --lib ghc-vis --allow-newer=base svgcairo:Cabal
cabal: Internal error in target matching. It should always be possible to find
a syntax that's sufficiently qualified to give an unambiguous match. However
when matching 'svgcairo:Cabal' we found svgcairo:Cabal (unknown-component)
which does not have an unambiguous syntax. The possible syntax and the targets
they match are as follows:
'svgcairo:Cabal' which matches svgcairo:Cabal (unknown-component),
:pkg:svgcairo:lib:svgcairo:module:Cabal (unknown-module),
:pkg:svgcairo:lib:svgcairo:file:Cabal (unknown-file)

$ cabal install --env . --lib ghc-vis --allow-newer
Wrote tarball sdist to
/home/me/cs/haskell/ghc-vis/ghc-vis-0.9.3/dist-newstyle/sdist/ghc-vis-0.9.3.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - svgcairo-0.13.2.1 (lib:svgcairo) (requires build)
 - wl-pprint-text-1.2.0.2 (lib) (requires build)
 - graphviz-2999.20.1.0 (lib) (requires build)
 - xdot-0.3.0.4 (lib) (requires build)
 - ghc-vis-0.9.3 (lib:ghc-vis) (requires build)
Starting     svgcairo-0.13.2.1 (all, legacy fallback)
Starting     wl-pprint-text-1.2.0.2 (lib)
Building     wl-pprint-text-1.2.0.2 (lib)
Building     svgcairo-0.13.2.1 (all, legacy fallback)
Installing   wl-pprint-text-1.2.0.2 (lib)
Completed    wl-pprint-text-1.2.0.2 (lib)
Starting     graphviz-2999.20.1.0 (lib)
Building     graphviz-2999.20.1.0 (lib)
Installing   graphviz-2999.20.1.0 (lib)
Completed    graphviz-2999.20.1.0 (lib)

Failed to build svgcairo-0.13.2.1.
Build log (
/home/me/.cabal/logs/ghc-8.10.7/svgcairo-0.13.2.1-ebe419cabd7523b490de364fb77c617bccd6af9252adca151e0a300b6a2dc6b0.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-65092/dist-newstyle/tmp/src-65092/svgcairo-0.13.2.1/dist/setup/setup.hs, /tmp/cabal-install.-65092/dist-newstyle/tmp/src-65092/svgcairo-0.13.2.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-65092/dist-newstyle/tmp/src-65092/svgcairo-0.13.2.1/dist/setup/setup ...
Configuring svgcairo-0.13.2.1...
Preprocessing library for svgcairo-0.13.2.1..
Building library for svgcairo-0.13.2.1..
[1 of 1] Compiling Graphics.Rendering.Cairo.SVG ( dist/build/Graphics/Rendering/Cairo/SVG.hs, dist/build/Graphics/Rendering/Cairo/SVG.o, dist/build/Graphics/Rendering/Cairo/SVG.dyn_o )
In file included from /usr/include/stdio.h:894,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/Flags.h:16,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/rts/storage/GC.h:249,
                 from /home/me/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/include/Rts.h:210,

                 from /tmp/ghc65480_0/ghc_3.c:2:0: error: 
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘sprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       39 |                                   __glibc_objsize (__s), __fmt,
          |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       40 |                                   __va_arg_pack ());
          |                                   ~~~~~~~~~~~~~~~~~
   |
38 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘snprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
       71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       72 |                                    __glibc_objsize (__s), __fmt,
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       73 |                                    __va_arg_pack ());
          |                                    ~~~~~~~~~~~~~~~~~
   |
71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
   |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘fprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      106 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
105 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:112:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
112 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘dprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:149:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      150 |                         __va_arg_pack ());
          |                         ~~~~~~~~~~~~~~~~~
    |
149 |   return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:186:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      187 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
186 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘__asprintf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:194:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      195 |                          __va_arg_pack ());
          |                          ~~~~~~~~~~~~~~~~~
    |
194 |   return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
/usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘obstack_printf’:

/usr/include/x86_64-linux-gnu/bits/stdio2.h:202:10: error:
     error: invalid use of ‘__builtin_va_arg_pack ()’
      202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      203 |                                __va_arg_pack ());
          |                                ~~~~~~~~~~~~~~~~~
    |
202 |   return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
    |          ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build svgcairo-0.13.2.1 (which is required by ghc-vis-0.9.3).
See the build log above for details.

$ cd ~/cs/haskell/ghc-vis/reg-way/svgcairo-0.13.2.1
$ cabal install --env ~/cs/haskell/ghc-vis/ghc-vis-0.9.3 --allow-newer --lib svgcairo --v

$ cd ~/cs/haskell/ghc-vis/ghc-vis-0.9.3
$ cabal install --env . --lib ghc-vis
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.2.1.0/installed-3.2.1.0 (conflict:
svgcairo => svgcairo:setup.Cabal>=1.24 && <3.1)
...

Need to tell cabal where to find the local svgcairo!

  • IN .../ghc-vis-0.9.3
  • create: cabal.project:
    packages: .
    
    repository my-local-repository
    url: file+noindex:///home/me/cs/haskell/ghc-vis/reg-way/svgcairo-0.13.2.1/dist-newstyle/sdist
    
  • then build ghc-vis with: $ cabal install --env . --lib ghc-vis --allow-newer --v
  • and play:
    $ ghci
    GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
    Loaded package environment from /home/me/cs/haskell/ghc-vis/ghc-vis-0.9.3/.ghc.environment.x86_64-linux-8.10.7
    Prelude> import GHC.Vis
    Prelude GHC.Vis> vis
    Prelude GHC.Vis> view (Just 1) "Just 1"
    Prelude GHC.Vis> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment