[Haskell-beginners] Cabal: Upgrading to the latest version of library

Hugo Ferreira hmf at inescporto.pt
Tue Nov 1 17:04:12 CET 2011


On 11/01/2011 12:07 PM, Daniel Fischer wrote:
> On Tuesday 01 November 2011, 11:50:45, Hugo Ferreira wrote:
>> Hello,
>>
>> Recently I had to update and install a newer version of a library.
>> I executed the "cabal update", which downloads the latest package list.
>> I had assumed that this command would also detect, build and install
>> those libraries that have been upgraded. However this does not seem to
>> be the case. I had to manually build the library and then use GHC's
>> package manager do unregister the old version.
>
> Unregistering the old version is not necessary, different versions of the
> same package can coexist. However, if some of the installed packages depend
> on the old version and some on the newer, those packages can generally not
> be used together, so unregistering is safer.
>

Ok.

>>
>> My question is: how does one check for and upgrade the cabal libraries
>> automatically?
>
> Not.
>
> 1. It's not possible to do it automatically since the latest versions of
> some packages can have incompatible dependencies, e.g. the latest foo
> depends on bar>= x.y&&  <  x.(y+1), the latest baz however depends on bar
>> = x.(y+1).
>
> Then you can't have foo together with the latest baz.
>
> 2. Usually, some not-updated packages depend on updated packages. Even if
> no incompatibility as above is introduced, that would cause a *lot* of
> recompilation and reinstallation. You don't inflict that on users unless
> they explicitly ask for it.
>
> 3. Often there's no real point in upgrading packages. Say the widely used
> package quux-x.y.z.d (think of something like text) had a typo in the
> haddocks, author fixes and uploads quux-x.y.z.e; thanks for recompiling my
> entire set of installed packages. Or a minor addition to the API that you
> don't need. Or a fix in a CPP macro that doesn't affect you, ...
>
> Installation of newer versions of packages you already have should be a
> conscious decision by you, after pondering the consequences.
>

I must confess I am a little disappointed. :-(

I have used Ocaml + the GODI "package manager" and it seems work ok.
GODI allows one to identify newer packages, select those we want to
upgrade and recompiles any dependencies automatically.

Thanks for the info.
Hugo F.






More information about the Beginners mailing list