Error with cabal update

流过昼夜 提交于 2020-01-05 12:34:23

问题


On a fresh install install of Haskell-Platform (64 bit OSX version from http://www.haskell.org/platform/mac.html) I get the following error:

Downloading the latest package list from hackage.haskell.org
Warning: http error: Network.Browser.request: Error raised ErrorParse "Invalid
cabal: Char.intToDigit: not a digit -1

After issuing the command cabal update. No luck with any searches and I have no idea where this error is coming from.


回答1:


I had the same problem. The only workaround I could find was to switch from hackage to stackage.

In your .cabal/config.cabal/config file, you specify something like the following:

-- remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive remote-repo: stackage:http://www.stackage.org/stackage/24e4d1b3bb101a80d3be1b146771c13df0827a82

Notice that hackage.haskell.org has to be commented out.

After that cabal update just worked.

I would be interested to here about other solutions though.




回答2:


Here's the relevant bug ticket on the HTTP tracker: https://github.com/haskell/HTTP/issues/98

It seems to be a (rare) issue with certain network configurations that result in (slightly) invalid results being returned and the HTTP library being overly strict.

Installing a recent version of the cabal executable (a binary is available for download from the cabal website) will provide a workaround, in that the default transport (and it is configurable) is https, not http, and that transport will call out to curl or wget, which are more lax in how they handle parsing http responses.



来源:https://stackoverflow.com/questions/24435856/error-with-cabal-update

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!