Oddity with 'cabal install' in GHC 7.4.1

Jason Dagit dagitj at gmail.com
Mon Feb 6 01:20:50 CET 2012

On Sun, Feb 5, 2012 at 10:48 AM, Conal Elliott <conal at conal.net> wrote:
> On Sun, Feb 5, 2012 at 12:43 AM, Andres Löh <andres.loeh at googlemail.com>
> wrote:
>> Hi Conal.
>> > Thanks for the reply! Note that I get this message even running 'cabal
>> > install' a second time after changing nothing. Is that scenario an
>> > example
>> > of what you mean by a "potentially dangerous cabal invocation"?
>> The check currently is entirely ad-hoc. Any reinstallation of an
>> existing package triggers the warning. There's no hash comparison.
> I'm confused. Isn't package re-installation an extremely common thing in
> cabal while developing software?

I would say, "You should never mutate your user or global package
database" and recommend using cabal-dev.  The way cabal-install does
destructive updates is evil. In particular, it likes to mutate your
global or user package database.  You run the risk of building
something and then breaking it later by mutating its dependencies.

With cabal-dev it would be more like this:
# Suppose you're in the source of bar
# Further suppose you just changed
# dependency 'foo' that you're also developing
cabal-dev add-source ../foo
cabal-dev install --reinstall foo

Technically this still mutates a package database but, it's a
throwaway package database in the bar directory.  I lose very little
when I 'rm -rf cabal-dev dist' and my user and global package
databases stay in tact.  I feel as though I can't sing the
sandboxed-build praise loudly enough.  The time my computer takes to
rebuild packages is negligible to the human time spent dealing with
broken package databases..

I hope that helps,

More information about the Libraries mailing list