[Haskell] cabal conflicting rules

Claudio Nieder private at claudio.ch
Wed Oct 26 02:26:04 CEST 2011


Hi,

many thanks to all who answered my post, I learned a lot by reading them 
and the referenced web pages.

> You probably have some packages of yours installed as user and some
> others globally.  Have a look at:
> 
> http://www.haskell.org/cabal/FAQ.html#dependencies-conflict

This explains well why I got the strange error.

> I recommend that as soon as you have a running Haskell Platform to
> always install new packages with cabal install ... --user

This is actually what I did. But this is not fool proof (and I was here 
the fool), because I can still do harm by asking cabal to install 
packages - which get registered in the user package db - that are part 
of ghc - thus registered also in the global db.

So I decided now to go the all global route - which is not really global 
as I did install ghc anyway in my own directory - so that there is only 
one package db.

For the sake of anybody stumbling over this thread in the future, this 
is what I do now:

# Fetch and untar both ghc and cabal-install, install ghc
cd /tmp
curl -O 
http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.b
z2
curl -O 
http://www.haskell.org/cabal/release/cabal-install-0.10.2/cabal-install-0
.10.2.tar.gz
tar xf ghc-7.0.4-x86_64-apple-darwin.tar.bz2
tar xf cabal-install-0.10.2.tar.gz
cd /tmp/ghc-7.0.4
./configure --prefix=/Users/claudio/Haskell/GHC
make install

# Modify the path in bootstrap.sh for my own "global" directory
# and execute it with the --global option so that all packages it
# installs go to the global package db.
cd /tmp/cabal-install-0.10.2
perl -i -pe 's"/usr/local"\$HOME/Haskell/GHC"' bootstrap.sh
chmod u+rwx bootstrap.sh
./bootstrap.sh --global
PATH=$PATH:$HOME/Haskell/GHC/bin
cabal update

At this point cabal has created its config file $HOME/.cabal/config 
which I modify so that cabal defaults to global but uses my own 
directory by applying these changes:

$ diff -d  config.orig config
31c31
< -- user-install: True
---
> user-install: False
68c68
<   -- prefix: /usr/local
---
>   prefix: /Users/claudio/Haskell/GHC


claudio




More information about the Haskell mailing list