Error when installing RSA (for yesod) with GHC 7.2.1

I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when "cabal install rsa" I got the error $ cabal install rsa Resolving dependencies... Configuring RSA-1.0.6.2... Preprocessing library RSA-1.0.6.2... Preprocessing executables for RSA-1.0.6.2... Building RSA-1.0.6.2... [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o ) Codec/Crypto/RSA.hs:580:10: Duplicate instance declarations: instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21 instance Random Word8 -- Defined in System.Random cabal: Error: some packages failed to install: RSA-1.0.6.2 failed during the building phase. The exception was: ExitFailure 1 Apparently it's an instance being declared twice. However RSA hackage page states that it compiles under GHC 7.2: http://hackage.haskell.org/package/RSA

Try to install with: cabal install RSA 'random == 1.0.1.0'
I'm guessing the issue is your "random" library is less than 1.0.1 and
also includes an instance of Word8 (in other words, the GHC release
you use pulled an unofficial version from the repo).
Cheers,
Thomas
On Mon, Oct 24, 2011 at 2:13 PM, Yves Parès
I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when "cabal install rsa"
I got the error $ cabal install rsa Resolving dependencies... Configuring RSA-1.0.6.2... Preprocessing library RSA-1.0.6.2... Preprocessing executables for RSA-1.0.6.2... Building RSA-1.0.6.2... [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o )
Codec/Crypto/RSA.hs:580:10: Duplicate instance declarations: instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21 instance Random Word8 -- Defined in System.Random cabal: Error: some packages failed to install: RSA-1.0.6.2 failed during the building phase. The exception was: ExitFailure 1
Apparently it's an instance being declared twice. However RSA hackage page states that it compiles under GHC 7.2: http://hackage.haskell.org/package/RSA
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Nope, I already have random 1.0.1.0 installed...
2011/10/24 Thomas DuBuisson
Try to install with: cabal install RSA 'random == 1.0.1.0'
I'm guessing the issue is your "random" library is less than 1.0.1 and also includes an instance of Word8 (in other words, the GHC release you use pulled an unofficial version from the repo).
Cheers, Thomas
On Mon, Oct 24, 2011 at 2:13 PM, Yves Parès
wrote: I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when "cabal install rsa"
I got the error $ cabal install rsa Resolving dependencies... Configuring RSA-1.0.6.2... Preprocessing library RSA-1.0.6.2... Preprocessing executables for RSA-1.0.6.2... Building RSA-1.0.6.2... [1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o )
Codec/Crypto/RSA.hs:580:10: Duplicate instance declarations: instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:580:10-21 instance Random Word8 -- Defined in System.Random cabal: Error: some packages failed to install: RSA-1.0.6.2 failed during the building phase. The exception was: ExitFailure 1
Apparently it's an instance being declared twice. However RSA hackage page states that it compiles under GHC 7.2: http://hackage.haskell.org/package/RSA
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Monday 24 October 2011, 23:13:32, Yves Parès wrote:
I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when "cabal install rsa"
Apparently it's an instance being declared twice. However RSA hackage page states that it compiles under GHC 7.2: http://hackage.haskell.org/package/RSA
The instance in the rsa package is guarded by a Cabal MIN_VERSION macro: #if !MIN_VERSION_random(1,0,1) instance Random Word8 where randomR (a,b) g = let aI::Int = fromIntegral a bI::Int = fromIntegral b (x, g') = randomR (aI, bI) g in (fromIntegral x, g') random = randomR (minBound, maxBound) #endif Unfortunately, that macro was broken in some Cabal versions, among them 1.8.0.2, so the negated check goes wrong (#if !(MIN_...) would work). [As a quickfix for this package, you could edit the source, but you'll probably come across more macro problems later.] Build yourself a new cabal-install. If you use 7.2.1 for that, the recipe at https://gist.github.com/1169332 tells you what you have to change. If you have an older ghc still available, the vanilla procedure should work with that (if you're using the old 6.12.* with the Cabal-1.8.0.2, first install a later Cabal version, 1.8.0.6 works).

Okay, so the problem is with cabal-install.
I'd don't verily need ghc 7.2, I think I'll just stick to 7.0.4 unti
cabal-install is updated, it will be simpler.
2011/10/24 Daniel Fischer
On Monday 24 October 2011, 23:13:32, Yves Parès wrote:
I'm using GHC 7.2.1 and cabal-install 0.8 (Cabal 1.8.0.2), and when "cabal install rsa"
Apparently it's an instance being declared twice. However RSA hackage page states that it compiles under GHC 7.2: http://hackage.haskell.org/package/RSA
The instance in the rsa package is guarded by a Cabal MIN_VERSION macro:
#if !MIN_VERSION_random(1,0,1) instance Random Word8 where randomR (a,b) g = let aI::Int = fromIntegral a bI::Int = fromIntegral b (x, g') = randomR (aI, bI) g in (fromIntegral x, g') random = randomR (minBound, maxBound) #endif
Unfortunately, that macro was broken in some Cabal versions, among them 1.8.0.2, so the negated check goes wrong (#if !(MIN_...) would work). [As a quickfix for this package, you could edit the source, but you'll probably come across more macro problems later.]
Build yourself a new cabal-install. If you use 7.2.1 for that, the recipe at https://gist.github.com/1169332 tells you what you have to change. If you have an older ghc still available, the vanilla procedure should work with that (if you're using the old 6.12.* with the Cabal-1.8.0.2, first install a later Cabal version, 1.8.0.6 works).
participants (3)
-
Daniel Fischer
-
Thomas DuBuisson
-
Yves Parès