Вопрос

Just updated the GHC and cabal couple of days ago and now a lot of pacakages can not be built.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.2

$ cabal --version
cabal-install version 1.18.0.3
using version 1.18.1.3 of the Cabal library 

I can install vty but not vty-ui. I have the following error:

$ cabal install vty-ui
Resolving dependencies...
In order, the following would be installed:
containers-0.3.0.0 (latest: 0.5.5.1) (new version)
mtl-1.1.1.1 (latest: 2.2.0.1) (new version)
QuickCheck-2.1.2 (latest: 2.7.3) (new package)
parallel-1.1.0.1 (latest: 3.2.0.4) (new version)
parsec-3.1.5 (reinstall) changes: mtl-2.1.3.1 -> 1.1.1.1
pcre-light-0.3.1.1 (latest: 0.4.0.2) +small_base (new package)
semigroups-0.13.0.1 (new package)
void-0.6.1 (new package)
MemoTrie-0.6.2 (new package)
vector-space-0.5.9 (latest: 0.8.6) (new package)
vty-4.2.1.0 (latest: 4.7.5) (new version)
vty-ui-0.4 (latest: 1.6.1) (new package)
cabal: The following packages are likely to be broken by the reinstalls:
vty-4.7.5
Use --force-reinstalls if you want to install anyway.
Это было полезно?

Решение

I have the same setup and tried downloading the latest tarball and modifying vty-ui.cabal to bump up the versions, e.g.

unix >= 2.4 && < 2.8
array >= 0.3.0.0 && < 0.6.0.0
QuickCheck >= 2.4 && < 2.8

And then did a "cabal install". I think upstream simply put the upper limits in for safety's sake. I didn't down grade any packages and it seems to work fine. I did this a few days ago and am going by memory. YMMV.

Другие советы

The issue is that the vty-ui package has a dependency on an older version of vty and therefore can't use the version you have already installed. When resolving dependencies cabal wants to install older versions of some of the other packages, but is happy to use the same version of parsec. But since parsec is going to be used with some of its dependencies replaced with older versions it needs to be reinstalled too. GHC will happily let multiple versions of a package with different version numbers coexist, but can't deal with multiple copies of a package with the same version number in the same package database, so cabal needs to replace the parsec-3.1.5 install. That breaks the version of vty you have already installed.

There are several ways to deal with this:

You could use cabal sandbox init and install packages you want into a local sandbox, leaving your normal package database intact.

You could use the --force-reinstalls flag like cabal suggests. You will probably want to specify a newer version of vty-ui while you are at it, which will presumably break even more installed packages (which is why cabal picked such an old package). Afterwards you can try to reinstall any broken packages you still need and hope there won't be a conflict.

You could go to the source repository for vty-ui and see if there is a new version compatible with your version of vty there. If not you could try making the necessary changes yourself (which might be as easy as changing some upper bounds in the .cabal file), then submit a patch/pull request.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top