[Hackage] #762: cabal-install failed to resolve dependencies
Hackage
cvs-ghc at haskell.org
Thu Nov 11 08:53:03 EST 2010
#762: cabal-install failed to resolve dependencies
---------------------------------+------------------------------------------
Reporter: james_m_chapman | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: cabal-install tool | Version: 1.8.0.2
Severity: normal | Keywords:
Difficulty: unknown | Ghcversion: 6.12.1
Platform: |
---------------------------------+------------------------------------------
Old description:
> I tried to update my installation of the development version of Agda.
>
> I did a darcs pull from the repo (darcs get --lazy
> http://code.haskell.org/Agda) and then tried to build it:
>
> $ darcs pull
> $ cabal update
> $ cabal clean
> $ cabal install
>
> I get the following error:
>
> "Resolving dependencies...
> cabal: cannot configure haskeline-0.6.2.2. It requires mtl ==1.1.*
> For the dependency on mtl ==1.1.* there are these packages: mtl-1.1.0.0,
> mtl-1.1.0.1, mtl-1.1.0.2 and mtl-1.1.1.0. However none of them are
> available.
> mtl-1.1.0.0 was excluded because Agda-2.2.9 requires mtl ==2.0.*
> mtl-1.1.0.1 was excluded because Agda-2.2.9 requires mtl ==2.0.*
> mtl-1.1.0.2 was excluded because Agda-2.2.9 requires mtl ==2.0.*
> mtl-1.1.1.0 was excluded because Agda-2.2.9 requires mtl ==2.0.*"
>
> Agda's .cabal file is here
>
> http://code.haskell.org/Agda/Agda.cabal
>
> and contains the build-depends line
>
> haskeline >= 0.3 && < 0.7
>
> The solution is to upgrade haskeline to the latest version by running:
>
> $ cabal install haskeline
>
> Should cabal-install have been able to work this out itself?
New description:
I tried to update my installation of the development version of Agda.
I did a darcs pull from the repo (darcs get --lazy
http://code.haskell.org/Agda) and then tried to build it:
{{{
$ darcs pull
$ cabal update
$ cabal clean
$ cabal install
}}}
I get the following error:
{{{
Resolving dependencies...
cabal: cannot configure haskeline-0.6.2.2. It requires mtl ==1.1.*
For the dependency on mtl ==1.1.* there are these packages: mtl-1.1.0.0,
mtl-1.1.0.1, mtl-1.1.0.2 and mtl-1.1.1.0. However none of them are
available.
mtl-1.1.0.0 was excluded because Agda-2.2.9 requires mtl ==2.0.*
mtl-1.1.0.1 was excluded because Agda-2.2.9 requires mtl ==2.0.*
mtl-1.1.0.2 was excluded because Agda-2.2.9 requires mtl ==2.0.*
mtl-1.1.1.0 was excluded because Agda-2.2.9 requires mtl ==2.0.*"
}}}
Agda's .cabal file is here
{{{
http://code.haskell.org/Agda/Agda.cabal
}}}
and contains the build-depends line
{{{
haskeline >= 0.3 && < 0.7
}}}
The solution is to upgrade haskeline to the latest version by running:
{{{
$ cabal install haskeline
}}}
Should cabal-install have been able to work this out itself?
--
Comment(by duncan):
In principle, a sufficiently good constraint solver would indeed work that
out. The current solver deliberately does no backtracking so it cannot
undo guesses. So when it guesses wrong it can cause it to find no
solution. A better solver would find solutions more often without
significantly increasing runtime.
The current solver will also get it if you give it some hints like:
{{{
cabal install --constraint='haskeline >= 0.6.3'
}}}
Specifically, the problem is that it guesses the version of haskeline
before it finds out about the mtl constraint. By default when it has to
guess, it tries using the installed version if there is one, or the latest
version if there is none installed. By adding the user-specified
constraint, it changes the order of choices.
A smarter solver would take advantage of the fact that agda specifies
mtl-2, and use that to exclude options like old versions of haskeline that
require mtl-1. This kind of bottom-up constraint propagation is on the
TODO list, see ticket #420.
--
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/762#comment:3>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects
More information about the cabal-devel
mailing list