Where should cabal install to by default?

Manuel M T Chakravarty chak at cse.unsw.edu.au
Sun Aug 3 21:56:19 EDT 2008

Duncan Coutts:
> 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
> prefix.
> 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
> interactive.
> 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).

Just some random remarks:

* Hiding installed files in a . directory is very bad style IMHO.  I  
think that should never happen.  Independent of whether you install  
right into /usr/local/bin or whether you symlink or whatever.  You  
might install files under /usr/local/lib/cabal and then symlink, but  
probably its nicer to installto /usr/local/lib/<package>-<version> and  
then symlink.

* On OS X, its not generally appropriate to install into /usr/local  
either.  Each user has ~/Applications and ~/Library directories that  
are usually used for per-user installs.  Just generally using sudo and  
put binaries into /usr/local is also bad because not every user will  
have admin rights on the machine.

* ~/.cabal is bad on Mac OS, too.  Preferences ought to go into ~/ 

* Versioning should be the default (and not optional).


More information about the Libraries mailing list