4

我有两台 Arch(64) 机器,我正在尝试安装 yesod。首先,一个简单的“cabal install yesod”进展顺利。其次,在构建 aesod-native 依赖项时出现以下错误:

配置 aeson-native-0.3.3...
预处理库 aeson-native-0.3.3...
构建 aeson-native-0.3.3...
[1 of 6] 编译 Data.Aeson.Functions ( Data/Aeson/ Functions.hs, dist/build/Data/Aeson/Functions.o )
[2 of 6] 编译 Data.Aeson.Types ( Data/Aeson/Types.hs, dist/build/Data/Aeson/Types.o)

Data/ Aeson/Types.hs:196:22: 因使用rnf' 导致
(NFData Object) 没有实例:rnf (Object o) = rnf o 在“NFData Value”的实例声明中 :错误:某些包未能安装: aeson-native-0.3.3 在构建阶段失败。例外是: ExitFailure 1
rnf'<br> Possible fix: add an instance declaration for (NFData Object)<br> In the expression: rnf o<br> In an equation for




在上述失败之后,我重新安装了 ghc,并删除了 ghc-pkg 和 .cabal 目录。再次,同样的错误。aeson-native 似乎没有什么问题,因为它在其他地方工作得很好,所以我的环境一定是罪魁祸首。在出现故障的机器上,我过去曾尝试过使用 pacman 偶尔管理 hackage 库(主要用于 xmonad)。不确定这是否重要,但我从来不确定阴谋集团和 pacman 如何/是否知道彼此在做什么。

GHC 为 7.0.3。我在所有安装之前进行了 cabal 更新。任何想法这个环境可能有什么问题?

谢谢/O

4

2 回答 2

5

你不是一个人。这应该可以通过以下方式解决:

> cabal install deepseq-1.1.0.2
> ghc-pkg unregister deepseq-1.2.0.1 --force

然后你可以安装任何aeson包。deepseq-1.2.0.1请通过键入来验证您确实已安装ghc-pkg list deepseq


I had this bug too a few days ago, but for aeson not aeson-native. I pull requested a fix on github then and it's already on hackage, though unfortunately only for aeson not aeson-native. May I suggest you try pull-requesting a fix to the aeson-native package. It really feels good to give something back to the community, try it! :)

于 2011-09-20T17:02:50.300 回答
3

Object只是 a 的类型同义词Data.Map,并且它的NFData实例似乎Data.Map最近deepseq包移动到containers.

但是,这个新版本的containers显然尚未在 Hackage 上发布,因此由于您使用的是最新版本的deepseq,因此在任何一个包中都找不到该实例。

我预计这将很快得到纠正。同时,您应该能够降级deepseq到 version 1.1.0.2,这是移动实例之前的最新版本。

于 2011-09-20T14:50:10.110 回答