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

Install fails #6

Closed
s5k6 opened this issue Jun 3, 2016 · 4 comments
Closed

Install fails #6

s5k6 opened this issue Jun 3, 2016 · 4 comments

Comments

@s5k6
Copy link

s5k6 commented Jun 3, 2016

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
Copy link
Member

bergey commented Jun 3, 2016

I think you need to install gtk2hs-buildtools.

  • From outside any cabal sandbox, run cabal install gtk2hs-buildtools.
  • Make sure that $HOME/.cabal/bin is on $PATH.
  • rerun cabal install diagrams-gtk

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
Copy link
Author

s5k6 commented Jun 3, 2016

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!

@s5k6 s5k6 closed this as completed Jun 3, 2016
@bergey
Copy link
Member

bergey commented Jun 3, 2016

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
Copy link
Author

s5k6 commented Jun 4, 2016

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!

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

No branches or pull requests

2 participants