我尝试在 Mac OS 10.5.8 上安装 json-0.4.4 包,并收到此错误:
$ sudo cabal install "json-0.4.4"
Building json-0.4.4...
[1 of 7] Compiling Text.JSON.Types ( Text/JSON/Types.hs,
dist/build/Text/JSON/Types.o )
[2 of 7] Compiling Text.JSON.Pretty ( Text/JSON/Pretty.hs,
dist/build/Text/JSON/Pretty.o )
[3 of 7] Compiling Text.JSON.ReadP ( Text/JSON/ReadP.hs,
dist/build/Text/JSON/ReadP.o )
Text/JSON/ReadP.hs:104:21:
Warning: A do-notation statement discarded a result of type b.
Suppress this warning by saying "_ <- n",
or by using the flag -fno-warn-unused-do-bind
[4 of 7] Compiling Text.JSON.Parsec ( Text/JSON/Parsec.hs,
dist/build/Text/JSON/Parsec.o )
ghc: memory allocation failed (requested 2097152 bytes)
cabal: Error: some packages failed to install:
json-0.4.4 failed during the building phase. The exception was:
ExitFailure 1
这是在具有 16GB RAM 的机器上。
我认为 http://www.haskell.org/cabal/FAQ.html#cabal-goes-into-an-infinite-loop--runs-out-of-memory不 适用,因为我使用的版本高于那里提到:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3
$ cabal --version
cabal-install version 0.8.2
using version 1.8.0.6 of the Cabal library
为什么我没有安装最新版本的 JSON 包?
$ sudo cabal install json
Resolving dependencies...
cabal: dependencies conflict: base-3.0.3.2 requires syb ==0.1.0.2 however
syb-0.1.0.2 was excluded because json-0.7 requires syb >=0.3.3
更新基础 IIUC 将意味着更新我的整个 Haskell 平台安装,并且我已经拥有最新版本的 Mac OS 10.5 二进制文件可用。我可以从源代码构建,或者使用端口或 brew,但我宁愿只构建 json 包。
我知道 Mac OS 10.5.8 是旧的,但不幸的是升级这台特定的机器不是一个选项。