[Top] [All Lists]

Re: [Haskell-cafe] Re: Why cabal forces reinstallation of happstack-util

Subject: Re: [Haskell-cafe] Re: Why cabal forces reinstallation of happstack-utils?
From: Daniel Fischer
Date: Wed, 5 May 2010 16:42:00 +0200
On Wednesday 05 May 2010 15:45:38, Henning Thielemann wrote:
> Maciej Piechotka schrieb:
> > On Wed, 2010-05-05 at 01:09 +0200, Daniel Fischer wrote:
> >> On Mittwoch 05 Mai 2010 00:55:38, Maciej Piechotka wrote:
> >>> I try to configure happstack with parsec 3.1. It seems to fail due
> >>> to cabal:
> >>
> >> happstack-util.cabal says parsec < 3, so --constraint="parsec > 3"
> >> and the given dependencies are incompatible, hence it can't be
> >> configured.
> >>
> >> Probably parsec < 3 was specified because parsec-3.0 was
> >> significantly slower than parsec-2.*.
> >
> > I updated local copy, as shown, but cabal wants to rebuild it anyway.
> > My question was rather why the repo is considered at all when the
> > package is installed.

Maciej, if you need to edit further .cabal files, you could make a minor-
minor version bump, x.y.z -> x.y.z.1 e.g., maybe that would convince cabal-
install not to reinstall.

> Surprisingly using plain Cabal (runhaskell Setup configure; runhaskell
> Setup build; runhaskell Setup install) often works in these cases.

That's not surprising.
runhaskell ./Setup.hs configure
can only go by what the .cabal file in the current directory and ghc-pkg 
say. If you edit the .cabal file to install e.g. happstack-util-0.5.0 with 
parsec-3, the changed .cabal file and the ghc-pkg output are consistent, so 
Cabal sees no reason to reinstall.

cabal-install presumably looks at the downloaded index from Hackage (it 
must recursively follow the dependencies to see which of them must be 
installed before [and in which order]).
The happstack-util .cabal file there says parsec < 3.
But ghc-pkg says
- there is no parsec < 3 installed
- happstack-util-0.5.0 was built with parsec-3.*
(don't know which check comes first if both are made).
That is inconsistent with what cabal-install knows from other sources, 
hence it assumes it's broken.

> Cabal-install is somehow too clever and if it cannot resolve the
> dependencies it thinks this must be impossible. If it finds a package,
> that it could not have installed by itself, it tries to install it by
> itself.
> First I thought that this due to cabal-install trying to find
> appropriate flag assignments by itself. However, Duncan Coutts told me
> that plain Cabal tries this as well. I have no idea, what the key
> difference between cabal-install and plain Cabal is.

Haskell-Cafe mailing list

<Prev in Thread] Current Thread [Next in Thread>