0

In my /home/sk/.ghc/x86_64-linux-7.8.4/package.conf.d folder, there is an entry for bytestring package as,

bytestring-0.10.6.0-7682cf7d45ee92d104399a67f3bce6ba.conf

In my /opt/ghc/7.8.4/lib/ghc-7.8.4/package.conf.d folder, there is an entry for bytestring as,

bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5.conf

Why does haskell store bytestring libraries in two different places. This is leading to compilation errors due to type/version mis-match.

How can i ensure, only one version of any library is stored and used at a time on my ubuntu 14.04 machine?

  • My guess: You have two packages installed- one globally and one per-user. – Sibi May 20 '15 at 13:03
  • you should be able to manage those with the `ghc-pkg` helper - if all else fails you can always reset your installation :( – Random Dev May 20 '15 at 13:03

1 Answers1

2

Why does haskell store bytestring libraries in two different places. This is leading to compilation errors due to type/version mis-match.

Well, no. The problem is that you have two versions of the bytestring library installed, period. It doesn't matter whether they are in the same package database or not.

You should fix this with ghc-pkg unregister bytestring-0.10.6.0 (first unregistering any packages that would break, if any) and then add a line

constraint: bytestring installed

to your ~/.cabal/config to prevent it from happening again. You probably want to do the same with other packages that came with GHC, at least all the ones that are dependencies of the ghc package (see ghc-pkg describe ghc).

I don't know if there is a way to tell cabal to never install a second version of any package. (In practice I find temporarily installing multiple versions of packages useful enough that I would find it more annoying than helpful.)

Reid Barton
  • 14,951
  • 3
  • 39
  • 49