[Haskell-cafe] A new cabal odissey: cabal-1.8 breaking its own
neck by updating its dependencies
Paolo Giarrusso
p.giarrusso at gmail.com
Sat Sep 11 16:29:20 EDT 2010
On Sat, Sep 11, 2010 at 21:43, Daniel Fischer <daniel.is.fischer at web.de> wrote:
> On Saturday 11 September 2010 20:38:21, Paolo Giarrusso wrote:
>> Hi,
>> after Andrew Coppin's odissey [1], I also had a few problem with
>> cabal, which stopped installing new packages. Details will follow;
>> meanwhile, here are some questions prompted by what happened:
>>
>> - when recompiling a package with ABI changes, does cabal always
>> update dependent packages? It seems "not always"
>
> cabal will not automatically update packages which depend on an updated
> package. Since it doesn't keep a record of packages depending on foo, it
> would have to check all installed packages on every update to do that.
ghc-pkg has such a dependency database, and cabal used it to correctly
recompile other packages broken by an upgrade, but not the Cabal
library, which resulted in linking errors for Setup.hs and
impossibility of further upgrades.
>> - it didn't update
>> itself, nor refuse the breaking upgrade, and the ABI breakage caused
>> linker errors on Setup.hs. Luckily, cabal was already linked so I
>> could always use it for queries.
>> - can cabal extract and check dependencies as specified in the .hi
>> files?
> No.
>> I had a broken dependency which I could see with "grep" but not
>> otherwise.
> ghc-pkg check?
I tried that, but it didn't notice any breakage. As far as I
understand, a package won't depend on packages which were hidden
during its build, and all available packages will be recorded as
dependencies in the ghc-pkg DB. Yet, for some reason this did not
work.
>> - is there a "specification" of which are the "core" packages?
> "core" as in *do not update*?
Yep, as in the output of "cabal upgrade" ("Note that it is generally
not recommended to upgrade core packages."), and in the Cabal FAQ I
linked. Note that cabal install --help gives no warning, which makes a
huge difference - I need to try "cabal upgrade" to learn what I
shouldn't try to install.
> Basically, what comes with GHC shouldn't be updated.
> Though I heard updating Cabal was okay.
I did update Cabal here to the latest version, while still using GHC
6.10.4 (I'll upgrade that later). My experience suggests that the
answer is probably "ghc and cabal dependencies", and that cabal should
have special handling for this case, as suggested in the other mail:
recompile core dependencies, any broken package, and only _then_
reinstall everything together - in my case, its choices broke package
upgrade - I was installing just pandoc.
I could have done something not so good before, but the final damage
was cabal's choice.
>> Not sure if this is more useful as a bug report or as discussion, or
>> if I just misused cabal and it's the only perfect software in the
>> world; still I wanted to share my experience.
> It's not perfect, and its guards against users breaking their package dbs
> aren't strong enough yet.
> But I wouldn't want to go back to a Haskell without it.
Agreed on both - I want my criticism to be constructive, even if I
might have phrased it not perfectly. And when I admitted that maybe
cabal was perfect, and maybe I used it badly, it might have sounded as
ironic, but I did mean it, even if I tried my best to check that it
wasn't the case.
--
Paolo Giarrusso - Ph.D. Student
http://www.informatik.uni-marburg.de/~pgiarrusso/
More information about the Haskell-Cafe
mailing list