Ticket #615 (closed defect: duplicate)

Opened 4 years ago

Last modified 16 months ago

cabal install attempts to reinstall "same version" of already-installed package

Reported by: guest Owned by:
Priority: normal Milestone: cabal-install-0.14
Component: cabal-install tool Version: HEAD
Severity: normal Keywords:
Cc: Difficulty: very hard (<1 week)
GHC Version: Platform:

Description

This is on ghc 6.12.1 rc2. The problem occurs because I installed a different version of ghc-syb than the one in hackage, but which retained the same version *number* as the one in hackage. Bumping up the version number of the alternate version, solved the problem, but it was confusing, and I believe I may have experienced this before without understanding what was happening.

The alternate version of ghc-syb I used is at  git://github.com/waern/ghc-syb.git

I was working on scion to try and get it to build on ghc 6.12.1, and when I tried to cabal install it from my working directory, cabal install started to reinstall ghc-syb - even though ghc-syb was already installed, with the same version number as the version it was trying to reinstall.

Change History

Changed 4 years ago by duncan

  • difficulty changed from unknown to very hard (<1 week)
  • platform Linux deleted

If you do a --dry-run with -v it'll probably tell you that it's reinstalling the package because it has different and incompatible dependencies.

The solver only chooses relatively late between the installed and version of a package and the one from hackage. It does this because it is sometimes necessary to rebuild packages to get consistent dependencies. At the end, if it's possible it'll substitute installed instances in the plan instead of rebuilding things. However that's not possible if the dependencies of the installed one clash with the other versions of packages that the solver has already selected.

In general it is a good idea to bump the version if there are substantial changes. Since the solver does rather rely on the assumption that the hackage and installed instances of the same package version are essentially the same.

There are a few ways this could be improved. If we used a completely different solver implementation it might be able to try harder to pick installed package instances rather than falling back to rebuilding.

There is also the possibility to use "installed constraints" where you tell the solver explicitly to only use an installed instance of a particular package. This would only be a workaround of course. Ideally you'd like it to try harder in the first place to avoid rebuilding.

Changed 16 months ago by kosmikus

  • status changed from new to closed
  • resolution set to duplicate
  • milestone set to cabal-install-0.14

This is essentially the same issue as the more recent #884. It should be fixed, at least by using the modular solver, in cabal-install-0.14.

Note: See TracTickets for help on using tickets.