Cabal’s default install location

Cabal’s default install location is somewhat controversial – Many people seem to like the default of user installs, while many others would prefer that it matched all other software and installed globally. The assumption amongst the community at the moment is that “most” want user installs. I wanted to find out if they’re right. If you’re a Haskeller, please vote, it’ll take a lot less time than voting for a new logo πŸ™‚

This entry was posted in Haskell.

17 comments on “Cabal’s default install location

  1. Don Stewart says:

    Of course, the problem with global installs is root access. Only a subset of users have root access.

    We’re simply more likely to have a successful Haskell install if cabal installs into $HOME by default.

    • beelsebob says:

      Yep, completely valid reasoning. The opposing completely valid reasoning is that every other installer under the sun goes to global by default and uses an extra flag to get user installs.

      As there’s valid reasons in either direction, a poll asking which one people like more is probably a good plan.

      Fwiw, here’s a couple of less valid reasons:
      People who are instructed to use runhaskell Setup.hs will get errors about their packages not being installed.
      People trying to install UHC will get very confusing errors about packages not being there (no idea why in this instance).

  2. Aaron says:

    Fix the Setup.hs to default to user too. Do it now, before the installed base gets any larger.

  3. augustss says:

    I think it should install in a sibling directory to ghc. Whereever you managed to install ghc, you should also be able to install packages.

    • And if you use ghc from a distro package, just stop and tell the user to install the package from a distro package as well.

      It would be logical (I mean, this is just a clarification of your idea), but not really useful, hm?

    • Duncan says:

      But this just isn’t true. People very often have a global install of ghc but cannot (or cannot easily without using su/sudo) install to where ghc is installed.

      It used to trip up users all the time that a simple “cabal install” would fail by default since they did not run it with sudo. Checking beforehand if we can write to the destination directory can make the errors less bad but such checks are not foolproof. Even if we correctly diagnose when the user has forgotten to use sudo it’s still preferable for most new users for it to “just work”. Experienced users can change the config file to do global installs by default.

  4. R Hayes says:

    Cabal should default to installing globally if you are root, locally otherwise.

  5. Drew Vogel says:

    Just make the –user versus –global flag match the installation target. E.g. if it is installed globally, the –global flag should be implied when you run it and if it is installed in your home directory, the –user flag should be implied when you run it.

  6. Cale says:

    I prefer user installs, however, one thing that I think might be helpful is that if cabal is installing a binary executable, and the location it is installing to is not in the current PATH, it should print a prominent notice at the end of the installation that this is the case, providing the location. (presumably ~/.cabal/bin)

    (Thinking about this some more, it might be nice to account for symlinks somehow in this process.)

  7. Miguel says:

    Where is the button “submit poll”, or something like that?

  8. Doaitse Swierstra says:

    I think that the whole issue can be solved by printing a message when installing, like:

    I will install the package globally. For local install use the -local option.

    or

    I will install the package locally. For global installation use the -global option.

    Most people are not installing that often, and I think that presenting the se few extra pixels would solve most of the problems.

  9. Victor Nazarov says:

    I support the idea that cabal should install globally if is runned as root, or locally if is runned as normal user. The problem with this idea is sharing of package list. It seems reasonable thet user should call cabal update only once as normal user.

Leave a comment