Question

The same (basically) question can be found here but I'm looking for a specific answer to my current question (as opposed to the general answer found in the link).

I have a problem using Haskell and cabal, in that, my project depends on two different versions of bytestring. The project still runs - but it prevents me from using ghci, which kind of sucks.

Here is the error message:

 |package. This is highly likely to cause a compile failure.
 |package text-0.11.3.1 requires bytestring-0.10.0.2
 |package stb-image-0.2.1 requires bytestring-0.10.0.2
 |package parsec-3.1.5 requires bytestring-0.10.0.2
 |package bitmap-0.0.2 requires bytestring-0.10.0.2
 |package zlib-0.5.4.1 requires bytestring-0.10.4.0
 |package unix-2.7.0.0 requires bytestring-0.10.4.0
 |package repa-3.2.3.3 requires bytestring-0.10.4.0
 |package daimyo-0.1.0.0 requires bytestring-0.10.4.0
 |package binary-0.7.1.0 requires bytestring-0.10.4.0
 |package JuicyPixels-repa-0.7 requires bytestring-0.10.4.0
 |package JuicyPixels-3.1.3.2 requires bytestring-0.10.4.0

I can't isolate my packages down to one version of bytestring, since I need both parsec and JuicyPixels-repa.

ghci throws the error

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
    _fps_count

regarding the bytestring package.

Is there any way that I can use ghci in spite of this?

Was it helpful?

Solution

I assume daimyo is your project. That being so, your problem is that the version constraints in your cabal file are too strict. In particular, the bytestring constraint should be bytestring == 0.10.*, so that the package works with bytestring-0.10.0.2, which probably came with your Haskell Platform or equivalent. There should be no incompatibilities, as according to the package versioning policy the two first parts of the version being equal implies the APIs are compatible.

As for actually making it work, you will have to unregister the new bytestring package (ghc-pkg unregister bytestring-0.10.4.0) and all packages that depend on it, and then reinstall those packages (except bytestring of course). After that, you can minimize the frequency of such headaches by using Cabal 1.18 (cabal install cabal-install if you don't have it) and its sandboxes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top