Re: [Hackage] #474: cabal-install needlessly reinstalls an existing package

#474: cabal-install needlessly reinstalls an existing package ---------------------------------+------------------------------------------ Reporter: judah | Owner: kosmikus Type: defect | Status: new Priority: high | Milestone: cabal-install-0.16 Component: cabal-install tool | Version: 1.6.0.1 Severity: normal | Keywords: solver Difficulty: unknown | Ghcversion: Platform: | ---------------------------------+------------------------------------------ Changes (by kosmikus): * priority: normal => high * milestone: cabal-install-0.14 => cabal-install-0.16 Comment: Ok, I can reproduce a similar situation and it seems it's still handled as described in this bug. Using an imaginary version `process-1.0.1.6` with `ghc-7.0.4`, I get: {{{ In order, the following would be installed: Cabal-1.10.2.0 (reinstall) changes: process-1.0.1.5 -> 1.0.1.6 deepseq-1.3.0.0 (new package) text-0.11.1.13 (new package) transformers-0.2.2.0 (new package) mtl-2.0.1.0 (new package) parsec-3.1.2 (new package) network-2.3.0.11 (new package) HTTP-4000.2.2 (new package) zlib-0.5.3.3 (new package) cabal-install-0.10.2 -bytestring-in-base (new package) Warning: The following packages are likely to be broken by the reinstalls: ghc-7.0.4 bin-package-db-0.0.0.0 Use --force-reinstalls if you want to install anyway. }}} Using the modular solver does not help, as it's using the same policy to pick the latest installed package by default, and doing this does not lead to an error, only to a reinstallation -- although that reinstallation breaks the `ghc` and `bin-package-db` packages. We can fix this by using the `--avoid-reinstalls` flag. However, I don't want to make that flag the default, because it may lead to confusing install plans, as we can actually observe here: {{{ In order, the following would be installed (use -v for more details): Cabal-1.10.1.0 deepseq-1.3.0.0 text-0.11.1.13 transformers-0.2.2.0 mtl-2.0.1.0 parsec-3.1.2 network-2.3.0.11 HTTP-4000.2.2 zlib-0.5.3.3 cabal-install-0.10.2 }}} Now, we get an older version of `Cabal`, which is also not what we really want. We get the "correct" solution by passing `--constraint="process == 1.0.1.5": {{{ Resolving dependencies... In order, the following would be installed (use -v for more details): deepseq-1.3.0.0 text-0.11.1.13 transformers-0.2.2.0 mtl-2.0.1.0 parsec-3.1.2 network-2.3.0.11 HTTP-4000.2.2 zlib-0.5.3.3 cabal-install-0.10.2 }}} One option to fix problems like this one would be to actually try to find several install plans for a given problem and try to pick the "best". Picking an older uninstalled version should have a higher penalty as picking an older installed version. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/474#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage