[Haskell-cafe] GHC 6.10.1 and cabal[-install]

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Nov 18 16:24:58 EST 2008

On Tue, 2008-11-18 at 14:23 +0100, Wolfgang Jeltsch wrote:
> Am Dienstag, 18. November 2008 11:01 schrieb Wolfgang Jeltsch:
> > Hello,
> >
> > I installed GHC 6.10.1 today and expected it to contain the cabal command
> > line utility.  Unfortunately, this was not the case.  Where can I download
> > it?
> Meanwhile, I found out that the package cabal-install includes the cabal 
> command.  On the other hand I thought that there was a now deprecated command 
> line tool named cabal-install.  I find this a bit confusing.

The Cabal package provides the library. The cabal-install package
provides the 'cabal' command line tool.

The deprecated package you're thinking of is cabal-get or cabal-setup.

> > How do I install and configure it so that it is integrated best with
> > GHC 6.10.1?  For example, should cabal use some directory in the GHC tree 
> > to place compiled packages in?

The defaults for user or global should be fine. There is no need to put
additional packages into the ghc install tree, indeed I would recommend
against doing that.

> Cabal wants to place package info in $HOME/.cabal.  However, I want to install 
> packages globally with sudo.  So I want to have a global package cache.  Is 
> there a common directory to be used for that or is cabal[-install] only for 
> per-user installations?

It can do per-user or global. Per-user is the default.

If you want to do the build as user and just the install as root then
you can use the --global --root-cmd=sudo options. If you want to use
this every time then you can set that in the ~/.cabal/config file.

> Well, there is the --global option but it is apparently only for registering 
> packages globally.  Does it change the destination directory for the 
> installed packages too? 


> If yes, to what directory?


> Is the default --global or --user?


> Sorry, but I cannot find the answers to this in the docs and I 
> don’t want to mess up my file system.

The cabal user guide lists the default install directories for global
and user installs.

The default ~/.cabal/config file is slightly self-documenting in that it
lists the available options and their defaults:

-- user-install: True

install-dirs user
  -- prefix: /home/duncan/.cabal

install-dirs global
  -- prefix: /usr/local

More information about the Haskell-Cafe mailing list