What can be done to resolve this dependency issue?

421 views Asked by At

I'm trying to install aeson after resetting ~/.ghc and ~/.cabal.

cabal install aeson gives me the following error message:

Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: aeson (user goal)
rejecting: aeson-0.9.0.1, 0.9.0.0, 0.8.1.1, 0.8.1.0 (global constraint
requires ==0.8.0.2)
trying: aeson-0.8.0.2
next goal: bytestring (user goal)
rejecting: bytestring-0.10.6.0, 0.10.4.1, 0.10.4.0, 0.10.2.0 (global
constraint requires installed instance)
rejecting: bytestring-0.10.0.2/installed-4f9... (conflict: aeson =>
bytestring>=0.10.4.0)
rejecting: bytestring-0.10.0.2, 0.10.0.1, 0.10.0.0, 0.9.2.1, 0.9.2.0,
0.9.1.10, 0.9.1.9, 0.9.1.8, 0.9.1.7, 0.9.1.6, 0.9.1.5, 0.9.1.4, 0.9.1.3,
0.9.1.2, 0.9.1.1, 0.9.1.0, 0.9.0.4, 0.9.0.3, 0.9.0.2, 0.9.0.1, 0.9 (global
constraint requires installed instance)
Dependency tree exhaustively searched.

The current version of bytestring package in my system is 0.10.2.0. I tried cabal install bytestring --reinstall so that I can have a more recent version of bytestring (thereby solving aeson dependency issue). But that returns a very odd error:

Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: bytestring (user goal)
rejecting: bytestring-0.10.6.0, 0.10.4.1, 0.10.4.0, 0.10.2.0, 0.10.0.2,
0.10.0.1, 0.10.0.0, 0.9.2.1, 0.9.2.0, 0.9.1.10, 0.9.1.9, 0.9.1.8, 0.9.1.7,
0.9.1.6, 0.9.1.5, 0.9.1.4, 0.9.1.3, 0.9.1.2, 0.9.1.1, 0.9.1.0, 0.9.0.4,
0.9.0.3, 0.9.0.2, 0.9.0.1, 0.9 (global constraint requires installed instance)
Dependency tree exhaustively searched.

I can solve the problem by using sandboxes. But I'm interested to know if there is a nicer method resolve the dependency issue.


Update: Following a suggestion, I removed bytestring by ghc-pkg unregister --force bytestring, which broke some packages and am still not able to install aeson.

Following is the output of ghc-pkg list lists: http://lpaste.net/135108.

1

There are 1 answers

0
NovaDenizen On

Where is your constraint (global constraint requires ==0.8.0.2) coming from?

~/prog$ cd
~$ mkdir sbox
~$ cd sbox
~/sbox$ HOME=`pwd`
~$ export HOME
~$ cabal install bytestring
Config file path source is default config file.
Config file /home/novadenizen/sbox/.cabal/config not found.
Writing default configuration to /home/novadenizen/sbox/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
cabal: There is no package named 'bytestring'.
You may need to run 'cabal update' to get the latest list of available
packages.
~$ cabal update
Downloading the latest package list from hackage.haskell.org
~$ cabal install aeson
Resolving dependencies...
Downloading bytestring-0.10.6.0...
Downloading dlist-0.7.1.1...
Configuring dlist-0.7.1.1...
Downloading syb-0.5.1...
Downloading transformers-0.4.3.0...
Configuring syb-0.5.1...
Building dlist-0.7.1.1...
Building syb-0.5.1...
Installed dlist-0.7.1.1
Configuring bytestring-0.10.6.0...
Building bytestring-0.10.6.0...
Configuring transformers-0.4.3.0...
Installed syb-0.5.1
Building transformers-0.4.3.0...
Installed transformers-0.4.3.0
Downloading mtl-2.2.1...
Downloading primitive-0.6...
Configuring primitive-0.6...
Building primitive-0.6...
Configuring mtl-2.2.1...
Installed primitive-0.6
Downloading vector-0.10.12.3...
Building mtl-2.2.1...
Configuring vector-0.10.12.3...
Installed mtl-2.2.1
Building vector-0.10.12.3...
Installed bytestring-0.10.6.0
Downloading binary-0.7.5.0...
Configuring binary-0.7.5.0...
Building binary-0.7.5.0...
Installed binary-0.7.5.0
Downloading text-1.2.1.1...
Configuring text-1.2.1.1...
Building text-1.2.1.1...
Installed vector-0.10.12.3
Installed text-1.2.1.1
Downloading hashable-1.2.3.2...
Configuring hashable-1.2.3.2...
Building hashable-1.2.3.2...
Installed hashable-1.2.3.2
Downloading scientific-0.3.3.8...
Downloading unordered-containers-0.2.5.1...
Configuring scientific-0.3.3.8...
Configuring unordered-containers-0.2.5.1...
Building scientific-0.3.3.8...
Building unordered-containers-0.2.5.1...
Installed scientific-0.3.3.8
Downloading attoparsec-0.13.0.0...
Configuring attoparsec-0.13.0.0...
Building attoparsec-0.13.0.0...
Installed unordered-containers-0.2.5.1
Installed attoparsec-0.13.0.0
Downloading aeson-0.9.0.1...
Configuring aeson-0.9.0.1...
Building aeson-0.9.0.1...
Installed aeson-0.9.0.1
~$