gpt4 book ai didi

haskell - 如何重置 Haskell 包缓存

转载 作者:行者123 更新时间:2023-12-02 14:34:27 25 4
gpt4 key购买 nike

决定学习 Haskell,通过 Homebrew 在 OS X 上安装了 ghc(当时没有下载网络二进制文件)。

一切都很好,跟随Learn You a Haskell ,但后来决定安装一些软件包并看看运行情况如何。

cabal install clckwrks-cli 运行良好,直到...

公共(public)互联网在几个项目的安装/构建中途崩溃了。

现在,这些程序都不会重新安装,对于 clckwrks-cli,我收到以下错误:

$ cabal install clckwrks-cli --reinstall --force-reinstalls
Resolving dependencies...
Failed to install cipher-aes-0.2.6
Failed to install cipher-rc4-0.1.4
Failed to install cookie-0.4.0.1
Failed to install crypto-numbers-0.2.3
Configuring happstack-hsp-7.2.4...
Building happstack-hsp-7.2.4...
Preprocessing library happstack-hsp-7.2.4...
ghc: could not execute: hsx2hs
Failed to install happstack-hsp-7.2.4
Failed to install lifted-base-0.2.2.0
Failed to install publicsuffixlist-0.1
Failed to install pwstore-purehaskell-2.1.1
Configuring reform-hsp-0.2.4...
Building reform-hsp-0.2.4...
Preprocessing library reform-hsp-0.2.4...
ghc: could not execute: hsx2hs
Failed to install reform-hsp-0.2.4
Failed to install web-plugins-0.2.5
Failed to install wl-pprint-text-1.1.0.2
Failed to install xml-types-0.3.4
cabal: Error: some packages failed to install:
attoparsec-conduit-1.0.1.2 depends on lifted-base-0.2.2.0 which failed to
install.
authenticate-1.3.2.6 depends on xml-types-0.3.4 which failed to install.
blaze-builder-conduit-1.0.0 depends on lifted-base-0.2.2.0 which failed to
install.
cipher-aes-0.2.6 failed while unpacking the package. The exception was:
user error (data is not in tar format)
cipher-rc4-0.1.4 failed while unpacking the package. The exception was:
user error (data is not in tar format)
clckwrks-0.21.1 depends on xml-types-0.3.4 which failed to install.
clckwrks-cli-0.2.10 depends on xml-types-0.3.4 which failed to install.
conduit-1.0.14 depends on lifted-base-0.2.2.0 which failed to install.
cookie-0.4.0.1 failed while unpacking the package. The exception was:
user error (data is not in tar format)
cprng-aes-0.5.2 depends on cipher-aes-0.2.6 which failed to install.
crypto-numbers-0.2.3 failed while unpacking the package. The exception was:
user error (data is not in tar format)
crypto-pubkey-0.2.4 depends on crypto-numbers-0.2.3 which failed to install.
fb-0.14.11 depends on publicsuffixlist-0.1 which failed to install.
happstack-authenticate-0.10.10 depends on xml-types-0.3.4 which failed to
install.
happstack-hsp-7.2.4 failed during the building phase. The exception was:
ExitFailure 1
hsx-jmacro-7.3.4 depends on wl-pprint-text-1.1.0.2 which failed to install.
http-conduit-1.9.6 depends on publicsuffixlist-0.1 which failed to install.
jmacro-0.6.8 depends on wl-pprint-text-1.1.0.2 which failed to install.
lifted-base-0.2.2.0 failed while unpacking the package. The exception was:
user error (data is not in tar format)
monad-logger-0.3.4.0 depends on lifted-base-0.2.2.0 which failed to install.
publicsuffixlist-0.1 failed while unpacking the package. The exception was:
user error (data is not in tar format)
pwstore-purehaskell-2.1.1 failed while unpacking the package. The exception
was:
user error (data is not in tar format)
reform-hsp-0.2.4 failed during the building phase. The exception was:
ExitFailure 1
resourcet-0.4.10 depends on lifted-base-0.2.2.0 which failed to install.
tls-1.1.5 depends on crypto-numbers-0.2.3 which failed to install.
tls-extra-0.6.6 depends on crypto-numbers-0.2.3 which failed to install.
web-plugins-0.2.5 failed while unpacking the package. The exception was:
user error (data is not in tar format)
wl-pprint-text-1.1.0.2 failed while unpacking the package. The exception was:
user error (data is not in tar format)
xml-conduit-1.1.0.9 depends on xml-types-0.3.4 which failed to install.
xml-types-0.3.4 failed while unpacking the package. The exception was:
user error (data is not in tar format)
zlib-conduit-1.0.0 depends on lifted-base-0.2.2.0 which failed to install.

与其他一些在安装过程中遭受相同网络中断的项目存在同样的问题。

到目前为止,我喜欢这门语言,而不是包管理:(

最佳答案

Cabal sandboxes经常推荐用于开发,但非常适合快速尝试某些包。如果出现任何问题,它们很容易被丢弃,并且不会影响您已经安装的任何其他软件包。这是我尝试 clckwrks-cli 时要做的事情(顺便说一句,如果您想尝试任何软件包,您可能会选择另一个依赖项较少的软件包)。

$ cd /path/to/sandboxes
$ cabal get clckwrks-cli
$ cd clckwrks-cli-<version>
$ cabal sandbox init
$ cabal install --only-dependencies -j<N> # N is the number of CPU cores

此时,您可以输入 cabal run 来运行包安装的可执行文件(它可能位于 ./dist/build/bin/) 、cabal test 用于运行测试,或 cabal repl 以便使用可用的沙箱包运行 ghci session 。

如果出现任何问题,您可以通过输入 cabal sandbox deletecabal clean 来恢复沙箱。完成后,您可以安全地删除沙箱,而不会影响其他包。

关于haskell - 如何重置 Haskell 包缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21792441/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com