[Haskell-cafe] cabal configure && cabal build && cabal install

Albert Y. C. Lai trebla at vex.net
Tue Nov 27 00:21:33 CET 2012

On 12-11-26 04:34 AM, Kim-Ee Yeoh wrote:
> Nice tip, Albert! Good to know! One question I have is, is (runghc
> Setup.lhs) equivalent to (cabal) in
> runghc Setup.lhs <$> [configure, build, install]
> ?

Setup defaults to --global --prefix=/usr/local
cabal defaults to --user --prefix=$HOME/.cabal

This confuses a lot of people.

FAQ #1: Why does "Setup copy" abort and say "no permission"?
Answer: because you haven't escalated privilege for writing to /usr/local

FAQ #2: Why does "sudo cabal install" register nothing in both the 
global database and my database?
Answer: because "--user" means not global, and "sudo" means the user is 
root, not you. Look under /root.

Lastly, there is no "Setup install". Use "copy" and "register".

> On Mon, Nov 26, 2012 at 8:08 AM, Brent Yorgey <byorgey at seas.upenn.edu
> <mailto:byorgey at seas.upenn.edu>> wrote:
>      > [cabal haddock, if you want]
>      > cabal copy
>      > cabal register
>     Even this does not do the same thing as 'cabal install', because it
>     does not download and install any dependencies (whereas 'cabal
>     install' does).
> Brent, that's useful to know too, thanks!
> Fwiw, I think Albert had the backdrop of classic GNU autoconf in mind,
> predating all that newfangled stuff of downloading (!) dependencies (!!).

This is ignorant of a common workflow.

"cabal configure" is used by a lot of programmers. Today. Why?

Because they use it on their own projects. They use cabal-install as a 
builder, not exactly an installer.

In fact, some of them do:

cabal configure
cabal build
cabal register --inplace

This has no "cabal install" correspondence.

So you ask, "but surely their own projects require some packages from 

Yes, surely. But those packages have already been installed in the past, 
once and for all. That is, when the project started, they already did 
"cabal install yesod".

This is not so old-school, is it?

More information about the Haskell-Cafe mailing list