diagrams / diagrams-gtk

Optional add-on to diagrams-cairo allowing diagrams to be rendered directly to GTK windows.
Other
4 stars 5 forks source link

Install fails #6

Closed s5k6 closed 8 years ago

s5k6 commented 8 years ago

Here is the output of trying to install diagrams-gtk:

$ cabal install diagrams-gtk
Resolving dependencies...
Notice: installing into a sandbox located at
/home/sk/prg/diagrams/.cabal-sandbox
Configuring cairo-0.13.3.0...
Configuring glib-0.13.4.0...
Failed to install cairo-0.13.3.0
Build log ( /home/sk/prg/diagrams/.cabal-sandbox/logs/cairo-0.13.3.0.log ):
Failed to install glib-0.13.4.0
Build log ( /home/sk/prg/diagrams/.cabal-sandbox/logs/glib-0.13.4.0.log ):
cabal: Error: some packages failed to install:
cairo-0.13.3.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:

/tmp/cabal-tmp-18504/cairo-0.13.3.0/dist/dist-sandbox-df16c69b/setup/setup.hs:5:8:
Could not find module ‘Gtk2HsSetup’
Use -v to see a list of the files searched for.
)
diagrams-cairo-1.3.0.6 depends on glib-0.13.4.0 which failed to install.
diagrams-gtk-1.3.0.1 depends on glib-0.13.4.0 which failed to install.
gio-0.13.3.0 depends on glib-0.13.4.0 which failed to install.
glib-0.13.4.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:

/tmp/cabal-tmp-18505/glib-0.13.4.0/dist/dist-sandbox-df16c69b/setup/setup.hs:5:8:
Could not find module ‘Gtk2HsSetup’
Use -v to see a list of the files searched for.
)
gtk-0.14.4 depends on glib-0.13.4.0 which failed to install.
pango-0.13.3.0 depends on glib-0.13.4.0 which failed to install.

The log files are empty. I have tired this after successfully doing

$ cabal install cabal
$ cabal install diagrams

Actually I was forced to cabal install cabal as without there was a complaint about an outdated cabal library.

All this happened on an up-to-date Arch Linux.

bergey commented 8 years ago

I think you need to install gtk2hs-buildtools.

If you want to build gtk2hs-buildtools in a sandbox, you'll need to put the resulting executables on your $PATH somehow.

This should of course be in the README. I'll try to put it in next week.

Please let us know whether these steps are enough.

s5k6 commented 8 years ago

That worked well, just some warnings. The complete set of instructions to do get this working is now (on my machine):

cabal sandbox init
PATH+=':.cabal-sandbox/bin/'
cabal update
cabal install cabal
cabal install gtk2hs-buildtools
cabal install diagrams diagrams-gtk

It fails if I put the packages together in one single cabal install instruction. The installation of cabal itself is req'd, otherwise it wails with

[...]
cabal: Error: some packages failed to install:
cairo-0.13.3.0 failed during the configure step. The exception
was: user error (The package 'cairo' requires Cabal library
version -any && >=1.24 but no suitable version is installed.)
[...]
glib-0.13.4.0 failed during the configure step. The exception was:
user error (The package 'glib' requires Cabal library version -any
&& >=1.24 but no suitable version is installed.)
[...]

And a lot of failures due to dependencies.

The successful compilation spills out the following warnings,

[...]
Building cairo-0.13.3.0...
Warning: /tmp/pkgConf-glib-0.13.420448977631967513926.0: Unrecognized field abi on line 28
[...]
Configuring gio-0.13.3.0...
Warning: /tmp/pkgConf-cairo-0.13.32947025671726956429.0: Unrecognized field abi on line 35
[...]
Building pango-0.13.3.0...
Warning: /tmp/pkgConf-pango-0.13.311015139291801979802.0: Unrecognized field abi on line 29
[...]
Building diagrams-cairo-1.3.0.6...
Warning: /tmp/pkgConf-gio-0.13.36281750111656478042.0: Unrecognized field abi on line 33
[...]
Building gtk-0.14.4...
Warning: /tmp/pkgConf-gtk-0.141497983152038664370.4: Unrecognized field abi on line 175
[...]

takes around 25 Minutes (4×3GHz CPU, 8GiB RAM) and will consume 307MB of disk space. Which brings me to the question: Is it smart to do this in a sandbox? Or is that just the way it has to be with Haskell?

Thanks for your help!

bergey commented 8 years ago

I'm a big fan of sandboxes, and would definitely recommend them here. You can get a bit fancier, and share some built artifacts between multiple sandboxes to save time & space. cabal, stack, & Nix all do this at varying levels of convenience & granularity.

Thanks for the feedback that it worked, and that gtk needs a recent cabal. I think if you upgrade your cabal-install program, the "unrecognized field" warnings go away - but they're just warnings, and ignoring them should be fine.

s5k6 commented 8 years ago

More feedback: Yes, indeed, after a global

cabal --no-require-sandbox install cabal-install

the cabal binary got updated (I did not know that cabal-install was a separate thing from installing cabal) and the warnings went away.

I'm on a different machine now and I've noticed that I additionally had to cabal install alex to build gtk2hs-buildtools, otherwise I see

Configuring gtk2hs-buildtools-0.13.2.1...
Failed to install gtk2hs-buildtools-0.13.2.1
Build log ( /tmp/foo/.cabal-sandbox/logs/gtk2hs-buildtools-0.13.2.1.log ):
cabal: Entering directory '/tmp/cabal-tmp-9379/gtk2hs-buildtools-0.13.2.1'
Configuring gtk2hs-buildtools-0.13.2.1...
cabal: The program 'alex' version >=3.0.1 is required but it could not be
found.

Thanks for helping me!