Alson Kemp

Cabal-install is awesome

See also: 2009-The Year Of Hackage and A Plea For Cabal-install

I’m finally getting Turbinado updated for GHC 6.10 and I owe a huge debt to the cabal-install team (my preferred currency for debt payment is beer).  Turbinado is a bitch to install by hand because it depends on specific version of various packages.  One minor rev off and everything explodes.

So I’ve been bouncing between 3 machines working on Turbinado and trying to get the build cleaned up.  Once cabal-install is installed, it’s a simple “cabal install” to get all dependencies downloaded and built.  Much better than setting up a local packages directory, downloading 10 packages, trying to get the install order figured out and trying to remember which of the 10 packages is installed or not.

It’s fantastic that GHC is finally getting a package and build manager.

If you haven’t played with cabal-install, you should:

darcs get --partial http://darcs.haskell.org/cabal-install/
cd cabal-install
sh bootstrap.sh
ln -s ~/.cabal/bin/cabal ~/bin/cabal  ### or somewhere else useful
cabal update

My only want for cabal-install is for it to install executables somewhere more useful than ~/.cabal.  But that’s a minor gripe…

Written by alson

January 31st, 2009 at 9:15 pm

Posted in Haskell

with 13 comments

13 Responses to 'Cabal-install is awesome'

Subscribe to comments with RSS or TrackBack to 'Cabal-install is awesome'.

  1. Re: installing binaries in someplace more useful than ~/.cabal:

    If you pass the –global flag to cabal install, it should put your executables in /usr/local/bin.


    31 Jan 09 at 11:24 pm

  2. Denis,

    Agreed, but many packages are installed with –user and those executables go into ~/.cabal (which is an unexpected location). In order to use –global you need to have root access (or similar)…



    1 Feb 09 at 12:57 am

  3. You can also set the option ‘bindir’ in .cabal/config to something more useful, like ~/bin. But maybe that should be the default. I was confused by this in the beginning.


    1 Feb 09 at 8:17 am

  4. Yes, if we could agree where to install user executables that would be great. The current setting is obviously not ideal and we all know it. However getting a consensus on where is better is much harder than it should be.

    I’d really appreciate some more discussion on what to do here. The ticket is:


    1 Feb 09 at 10:04 am

  5. Duncan,

    Yeah, I tried to help out with cabal-install and the directories thing a couple of years ago, but couldn’t figure out a good solution. I probably did more harm than good. I’ll drop a note in the ticket.


    Thanks for the info. That might be a nice solution: if bindir isn’t configured, cabal will ask you for the bindir location, then will save it to .cabal/config… Standard locations could be suggested based on *nix or Windows.



    1 Feb 09 at 4:26 pm

  6. Successfully built on Windows (MinGW/MSYS) – don’t know whether it’s due some of your latest effort or updates on hackage, but as the pages are stating that currently Turbinado is linux-only, I’m reporting success ;-).

    Only fetched turbinado from git repository, then for some packages it was necessarry to give exact version to cabal install so it would pick the package at all (cabal install happy 1.18.2).

    hs-plugins required few tweaks: config.h file – double the \’s in GHC_LIB_PATH, otherwisely error is reported in System.Plugins.Consts.hs;

    then two imports in System.Plugins.Env.hs — System.Environment (getEnv) & System.Plugins.Consts (ghcLibraryPath).

    Then just cabal install in the turbinado dir & evoila 😉


    2 Feb 09 at 2:13 pm

  7. I tried to install turbinado via cabal on mac but it failed when it tried to install the postgresql hdbc driver:

    Warning: In the use of `defaultUserHooks’
    (imported from Distribution.Simple):
    Deprecated: “Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
    compatibility in which case you must stick with defaultUserHooks”
    Linking /tmp/TMPHDBC-postgresql- …
    Warning: defaultUserHooks in Setup script is deprecated.

    Configuring HDBC-postgresql-…
    setup: pgconfig is required but it could not be found.
    cabal: Error: some packages failed to install:
    HDBC-postgresql- failed during the configure step. The exception was:
    exit: ExitFailure 1
    turbinado-0.4.9 depends on HDBC-postgresql- which failed to install.

    did someone of you succeed in installing turbinado on leopard? Or does it really work only on linux?


    5 Feb 09 at 5:35 pm

  8. Bodo,

    Doh. That doesn’t look too pretty. You might contact John Goerzen and file a bug. See here: http://software.complete.org/software/projects/show/hdbc


    5 Feb 09 at 6:33 pm

  9. I found the problem that caused the error of my previous post, actually the dev package for postgresql was missing on my machine.

    I switched now to my ubuntu server 8.10 machine and tried to install turbinado there, but I get an error after the dependencies are installed.

    So this is what I did actually on my freshly installed ubuntu box:

    sudo su
    apt-get update
    apt-get upgrade

    apt-get install libedit-dev darcs git-core libgmp3-dev zlib1g-dev postgresql postgresql-server-dev-8.3 happy make

    cd /usr/local/src
    wget http://haskell.org/ghc/dist/6.10.1/ghc-6.10.1-i386-unknown-linux-libedit2.tar.bz2
    tar xjvf ghc-6.10.1-i386-unknown-linux-libedit2.tar.bz2
    cd ghc-6.10.1
    make install

    cd /usr/local/src
    darcs get –partial http://darcs.haskell.org/cabal-install/
    cd cabal-install
    sh bootstrap.sh

    vim /etc/environment
    –> Add the local bin path (reload the path)
    –> /root/.cabal/bin/

    reboot (because of a kernel upgrade + path refreshment)

    cabal update

    cd /usr/local/src
    git clone git://github.com/alsonkemp/turbinado.git
    cd turbinado
    cabal install

    And I get the following error:

    Configuring turbinado-0.4.9…
    Preprocessing executables for turbinado-0.4.9…
    Building turbinado-0.4.9…

    Could not find module `Config.App’:
    Use -v to see a list of the files searched for.
    cabal: Error: some packages failed to install:
    turbinado-0.4.9 failed during the building phase. The exception was:
    exit: ExitFailure 1


    7 Feb 09 at 9:42 am

  10. Bodo,

    A sample App.hs is included with Turbinado, but you need to create your own. That could be as simple as copying Config/App.hs.sample -> Config/App.hs.

    You might try starting with the turbinado-website (though then you’ll need to disable the databaseConnection in Config/App.hs).


    7 Feb 09 at 1:27 pm

  11. Great, I can start the server right now. So I’ll try the wiki thing you wrote about earlier. 😀


    7 Feb 09 at 2:08 pm

  12. I use cabal install . But did not finish install Turbinado beacause i did not install ‘happy’.
    This is awesome to install from Cabal (


    16 Nov 09 at 10:56 am

  13. how to ninstall cabal in Haskell


    1 Mar 12 at 3:11 pm

Leave a Reply