Ambiguous occurence `unsafePerformIO' when installing binary-strict

168 views Asked by At

I'm trying to cabal install binary-strict and I get this error:

src/Data/Binary/BitBuilder.hs:205:37:
Ambiguous occurrence `unsafePerformIO'
It could refer to either `Foreign.unsafePerformIO',
                         imported from `Foreign' at src/Data/Binary/BitBuilder.hs:38:1-14
                      or `System.IO.Unsafe.unsafePerformIO',
                         imported from `System.IO.Unsafe' at   src/Data/Binary/BitBuilder.hs:42:26-40
                         (and originally defined in `GHC.IO')
Failed to install binary-strict-0.4.8.1
cabal: Error: some packages failed to install:
binary-strict-0.4.8.1 failed during the building phase. The exception was:
ExitFailure 1

I'm running ghc 7.6.3. If it's relevant, I have binary-0.7.2.3 installed too.

2

There are 2 answers

1
Thomas M. DuBuisson On BEST ANSWER

As written, binary-strict only works for base >= 4.7. GHC 7.6.3 uses base = 4.6.* so it will not work. You should file a bug with the maintainer and work around the issue by adding hiding (unsafePerformIO) to the import Foreign line of the file in question.

0
idontgetoutmuch On

I only just found out about this. It is now fixed. Also I have listed the git repo in the package details so you can now raise issues and I will know about them. Thanks to Thomas for suggesting the fix.