QRE: Cabal and simultaneous installations of the same package

Boespflug, Mathieu m at tweag.io
Mon May 11 15:42:00 UTC 2015


As I think Simon was saying earlier, think of this feature as allowing
strictly more installation plans to succeed, while still keeping to the
exact same model that we use today of just one instance of a lib in any
given binary.

Currently, if you install B-0.1 and then install A-2.0 that has a
constraint B>=0.1, then you can't build an app that depends on both A and
B-0.2. That's counter intuitive because had you started from an empty
sandbox, then you would be able to build the app!

The reason is that currently you can only have a single instance of A-2.0
installed. The proposal is *not* to allow building an app against an A-2.0
built against B-0.1 and against B-0.2 simultaneously. It's to allow
multiple instances of A-2.0 in the same package database, and teach Cabal
to handle that, so that an app can ask for an A-2.0 that is built against
the right version of B, no matter what, and link that in.

In your example, an app wouldn't get both C 1.0 and 2.0. It would get
whichever one of those fits the constraints of both A and B, or the build
will fail if no such C exists.

Since only one instance of a library ever makes it into a binary, as is the
case currently, no particular problem arises with linking in external
dependencies such as C code.


On 11 May 2015 at 14:52, Daniel Trstenjak <daniel.trstenjak at gmail.com>
wrote:

>
> Hi Simon,
>
> On Mon, May 11, 2015 at 11:27:58AM +0000, Simon Peyton Jones wrote:
> > Well, no one is actually suggesting that!
>
> But you're just getting it automatically if you're depending e.g.
> on the libraries A and B, and A depends on C 1.0 and B depends on C 2.0.
>
> Currently you can't build this dependency graph, right? And with
> this proposed feature you will be getting C 1.0 and 2.0 into your binary.
>
>
> Perhaps a even more nasty case is, if you're using a haskell library
> which wraps a stateful c library, and now you're having multiple
> versions of the same haskell library operating on the same c library state.
>
>
> Greetings,
> Daniel
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150511/23a00ac7/attachment.html>


More information about the ghc-devs mailing list