Stack Build 错误消息:退出并出现 ExitFailure 128

Stack Build error message: exited with ExitFailure 128

我正在关注 "Haskell Programming from First Principles" 的第 13.3 章 并处理 stack build 但失败并显示以下错误消息,如下所示。我正在我的 MBP 终端上安装 current Stack version: 1.3.2,.有出路的解决方案吗? (我目前在非常慢的 wifi 环境中工作。我不确定堆栈构建是否因为连接不良而失败。)

$ stack build
Updating package index Hackage (mirrored at 
https://github.com/commercialhaskell/all-cabal-hashes.git) ...  

长时间停顿...将近 10 分钟。

Running /usr/bin/git clone https://github.com/commercialhaskell/all-cabal-hashes.git all-cabal-hashes/ -b display in directory /Users/Sleepyleo/.stack/indices/Hackage/git-update/ exited with ExitFailure 128

Cloning into 'all-cabal-hashes'...  
error: RPC failed; curl 56 SSLRead() return error -9806  
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

错误代码 -9806 是一般 SSL 连接失败的 Mac OS X 错误代码。其他人报告这是旧版本 git 连接到某些具有不兼容 SSL 配置的站点的问题。参见 this Whosebug question, for example. However, it's also been reported as a result of a connection being interrupted on a flaky Internet connection (e.g., this github issue)。

很遗憾,由于您是在 10 分钟超时后看到的,这很可能是您的 Internet 连接问题,而不是 SSL 兼容性问题。

您可能想试试 运行:

/usr/bin/git clone https://github.com/commercialhaskell/all-cabal-hashes.git
    all-cabal-hashes/ -b display

手动在某个目录中。下载大约 200 兆字节。这将向您显示它是否取得任何进展以及下载速度有多快 运行。