[Haskell-cafe] Re: Unable to install packages

Albert Y. C. Lai trebla at vex.net
Mon Nov 29 21:15:44 CET 2010

On 10-11-28 09:55 AM, Ketil Malde wrote:
> Joachim Breitner<mail at joachim-breitner.de>  writes:
>> I would not recommend using --global on Debian/Ubuntu-systems, as it
>> might interfere with packages installed by Debian.
> But 'cabal install --global' installs in /usr/local/, does it not?
> And official packages (i.e. debs) put stuff in /usr, so these would be
> separate.

Metadata is more important than data.

In the case of Debian/Ubuntu's GHC, both 'cabal install --global' and 
'apt-get install' records in /var/lib/ghc-6.12.3/package.conf.d

If you cabal install one version and apt-get another version, sure, they 
are two different records in the metadata, no immediate problem.

But how about

   cabal install --global binary
   apt-get install libghc6-binary-dev

They are the same version (at the time of writing, and assume Ubuntu 
10.10) and they will fight for the unique throne of "binary-" in 
the metadata.

The immediate problem: they likely have different ABI hashes because 
they're built differently. Suppose you

   cabal install --global binary
   (suppose it becomes binary-
   cabal install --global I-depend-on-binary
   apt-get install libghc6-binary-dev
   (this is binary- in Ubuntu 
10.10 i386 32-bit)

Now I-depend-on-binary is hosed. It was built against 
binary- but that's usurped.

OK, who would knowingly usurp his/her own binary- Of course no 
one knowingly does. But everyone does it unknowingly:

   cabal install --global maccatcher
   (this brings in binary)
   apt-get install libghc6-agda-dev
   (this brings in libghc6-binary-dev)

Now maccatcher is hosed.

See also my http://www.vex.net/~trebla/haskell/sicp.xhtml

P.S. Deleting "--global" mitigates this problem but causes some other 
problem. I will describe it in my article in the future.

More information about the Haskell-Cafe mailing list