Where should cabal install to by default?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Aug 3 15:11:02 EDT 2008

Hi folks,

cabal-install is supposed to make things simpler for users, especially
new users. It's partly successful at that currently. Many users do not
know ghc-pkg even exists for example (not that it was a design goal but
it seems to be a consequence). On the other hand we're currently failing
users by not making programs they install work by default.

Currently cabal-install installs all binaries to ~/.cabal/bin by
default. It does per-user installs by default and uses ~/.cabal as its

Obviously ~/.cabal/bin is not on the $PATH, so users who install say,
yi or whatever find that typing yi at the prompt does not do anything
even though they just installed it. That's a failure on our part. It
should work, and if we cannot make it work by default then we need to
tell users what they need to do to make it work.

So I'd like to discuss what defaults we should use.

For reference, these are the features that are implemented right now
that we have to play with:
      * We can do per-user or global installs (affects which package db
        we use but it also changes the default prefix)
      * We can set any --prefix we like
      * We can use versioned binaries (ie adding -$version suffixes)
      * We can add symlinks to binaries in some other directory
      * We can use a commend like sudo to do the install phase

We can control all these features in the ~/.cabal/config file.

When cabal-install is first run it creates a default ~/.cabal/config
file. So the question is what default it should set and how we report
failure cases to the user. We do not have to use the same defaults on
every platform.

If we can get away with it I think it's much nicer not to make it

Here's a couple suggestions:

For unix systems, do per-user installs to --prefix=~/.cabal but if ~/bin
exists then add symlinks there.

Or perhaps if ~/bin is not a convention on that unix platform (eg OSX)
then do global installs by default to /usr/local and use sudo for the
install phase (we know that OS X comes with sudo where as it may or may
not on other unix systems).


More information about the Libraries mailing list