5

我想安装yesod以了解一些关于网络的知识并在业余时间玩一下 Haskell,但是当我这样做时:

> cabal install yesod
Resolving dependencies...
cabal: cannot configure cprng-aes-0.2.2. It requires crypto-api >=0.8
For the dependency on crypto-api >=0.8 there are these packages:
crypto-api-0.8. However none of them are available.
crypto-api-0.8 was excluded because skein-0.1.0.1 requires crypto-api ==0.6.*
crypto-api-0.8 was excluded because crypto-api-0.6.4 was selected instead
crypto-api-0.8 was excluded because clientsession-0.7.3.1 requires crypto-api
>=0.6.4 && <0.7

但我认为我安装了正确的软件包

cabal list cprng-aes skein crypto-api clientsession
* clientsession
    Synopsis: Securely store session data in a client-side cookie.
    Default available version: 0.7.3.1
    Installed versions: 0.7.3.1
    Homepage: http://github.com/snoyberg/clientsession/tree/master
    License:  BSD3

* cprng-aes
    Synopsis: Crypto Pseudo Random Number Generator using AES in counter mode.
    Default available version: 0.2.2
    Installed versions: 0.2.2
    Homepage: http://github.com/vincenthz/hs-cprng-aes
    License:  BSD3

* crypto-api
    Synopsis: A generic interface for cryptographic operations
    Default available version: 0.8
    Installed versions: 0.6.4, 0.8
    Homepage: http://trac.haskell.org/crypto-api/wiki
    License:  BSD3

* crypto-api-tests
    Synopsis: A test framework and KATs for cryptographic operations.
    Default available version: 0.1
    Installed versions: [ Not installed ]
    Homepage: http://trac.haskell.org/crypto-api/wiki
    License:  BSD3

* hack-middleware-clientsession
    Synopsis: Middleware for easily keeping session data in client cookies.
    Default available version: 0.0.1
    Installed versions: [ Not installed ]
    Homepage: http://github.com/snoyberg/hack-middleware-clientsession/tree/master
    License:  BSD3

* skein
    Synopsis: Skein, a family of cryptographic hash functions. Includes
              Skein-MAC as well.
    Default available version: 0.1.0.1
    Installed versions: 0.1.0.1
    License:  BSD3

我不太了解,cabal install但似乎两者crypto-api >=0.8都是<7必需的,这似乎是不可能的。

4

1 回答 1

8

Crypto-API 维护者在这里。

问题

问题是这些包是互斥的。最新的 cprng-aes 需要 crypto-api 版本>= 0.8。最新的绞纱需要 crypto-api 0.6.*。所以我们希望发生的是 skein 开发人员(我将通过电子邮件发送给他)来更新软件包。

目前

到那时,您需要安装相关软件包的旧版本。尝试类似:

cabal install yesod 'crypto-api == 0.6.4' 'cprng == 0.2.1'

我认为语法是正确的。如果没有,你总是可以这样做:

cabal install yesod crypto-api-0.6.4 cprng-0.2.1

社区如何避免这种情况

从长远来看,我希望 cabal 会变得更好并自动找到兼容的版本,就像我在上面所做的那样。缺少这样的阴谋集团改进,每个人都提到但没有人实施,包维护者最好尝试在他们的构建deps上保持一致的下限。如果 cprng-aes 仍然被接受crypto-api >= 0.5,那么我认为这将是由 cabal 安装的。这对包维护者来说有点多,但他们可以使用 CPP 和{MAX,MIN}_VERSIONcabal 提供的宏来做到这一点。

编辑:更新 Felipe 已更新绞纱并上传到 hackage。Michael 已经更新了 clientsession,鉴于他是 Yesod 的维护者并且已经参与了电子邮件对话,我相信他很快就会将它上传到 hackage。在您阅读此消息时,事情应该已经解决了,只需运行:

 cabal update ; cabal install yesod

回想起来,我看到 crypto-api 中主要版本的流量颠簸导致了社区的其他成员。我不确定如何处理这个问题。我本可以观察到“如果我做出这个改变,任何人都不会受到影响”,然后就与 PVP 决裂。OTOH,如果我在没有遵循 PVP 的情况下确实破坏了某人的代码,那么他们就有正当的理由感到不安。有社区评论吗?

于 2011-10-22T15:03:50.623 回答