4

当我尝试使用命令“cabal install yesod”安装 yesod 时,出现以下错误:

cabal install rsa
Resolving dependencies...
Configuring RSA-1.0.6.1...
Preprocessing library RSA-1.0.6.1...
Preprocessing executables for RSA-1.0.6.1...
Building RSA-1.0.6.1...
[1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o )

Codec/Crypto/RSA.hs:577:10:
    Duplicate instance declarations:
      instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:577:10-21
      instance Random Word8 -- Defined in System.Random
cabal: Error: some packages failed to install:

似乎 RSA lib 与另一个库发生冲突。

任何的想法?

我的环境:Mac OS X 10.7 GHC 7.0.3

提前致谢。

4

1 回答 1

5

random软件包开始在版本 1.0.1.0 中导出新实例。一种解决方案是仅在random包为该版本或更高版本时有条件地编译 RSA 库的实例;像这样的一些变化应该起作用:

{-# LANGUAGE CPP #-}
#if MIN_VERSION_random(1,0,1)
#else
instance Random Word8 where
    ...
#endif

如果您将补丁发送给 RSA 库的维护者,则会获得奖励积分。

或者,您可以要求 cabal 使用旧版本的random.

于 2011-09-12T16:38:06.547 回答