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 で新しいインスタンスのエクスポートを開始しました。random1 つの解決策は、パッケージがそのバージョン以降の場合にのみ 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 に答える