gpt4 book ai didi

haskell - cabal 沙箱安装仍然失败,错误为 "packages are likely to be broken by the reinstalls"

转载 作者:行者123 更新时间:2023-12-02 10:32:09 25 4
gpt4 key购买 nike

我正在尝试构建 Elm Platform使用 cabal 沙箱。但是安装失败,并显示消息“软件包可能会因重新安装而损坏”。在我看来,这似乎与沙箱的整个目的相矛盾,我曾相信沙箱应该避免这种错误。

任何人都可以为我解释这个错误,甚至更好地帮助我继续 Elm 安装吗?添加 --force-reinstalls 是否安全?

以下是我执行的命令序列:

cabal sandbox init
cabal update
cabal install -j elm-compiler-0.14 elm-package-0.2 elm-make-0.1 elm-reactor-0.2 elm-repl-0.4

我在 Mac OS 10.10 上使用 cabal 1.22.0.0 和 GHC 7.8.2。完整输出如下:

Resolving dependencies...
In order, the following would be installed:
Diff-0.3.0 (new package)
HUnit-1.2.5.2 (new package)
ansi-terminal-0.6.2.1 (new package)
ansi-wl-pprint-0.6.7.1 (new package)
async-2.0.2 (new package)
blaze-markup-0.6.2.0 (new package)
blaze-html-0.7.0.3 (new package)
byteable-0.1.1 (new package)
bytestring-mmap-0.2.2 (new package)
bytestring-trie-0.2.4 (new package)
cereal-0.4.1.1 (new package)
cmdargs-0.10.12 (new package)
concatenative-1.0.1 (new package)
cookie-0.4.1.4 (new package)
cryptohash-0.11.6 (new package)
enumerator-0.4.20 (new package)
attoparsec-enumerator-0.3.3 (new package)
blaze-builder-enumerator-0.2.0.6 (new package)
exceptions-0.6.1 (reinstall) changes: mtl-2.1.3.1 -> 2.2.1,
transformers-0.3.0.0 -> 0.4.1.0
extensible-exceptions-0.1.1.4 (new package)
hfsevents-0.1.5 (new package)
fsnotify-0.1.0.3 (new package)
hourglass-0.2.8 (new package)
asn1-types-0.3.0 (new package)
asn1-encoding-0.9.0 (new package)
asn1-parse-0.9.0 (new package)
crypto-pubkey-types-0.4.2.3 (new package)
http-types-0.8.5 (new package)
mime-types-0.1.0.5 (new package)
monads-tf-0.1.0.2 (reinstall) changes: transformers-0.3.0.0 -> 0.4.1.0
MonadCatchIO-transformers-0.3.1.3 (new package)
network-2.6.0.2 (new version)
parsec-3.1.7 (new version)
indents-0.3.3 (new package)
network-uri-2.6.0.1 (new package)
HTTP-4000.2.19 (new version)
pem-0.2.2 (new package)
prettyclass-1.0.0.0 (new package)
language-glsl-0.1.1 (new package)
publicsuffixlist-0.1 (new package)
regex-base-0.93.2 (new package)
regex-posix-0.95.2 (new package)
securemem-0.1.4 (new package)
crypto-cipher-types-0.0.9 (new package)
cipher-aes-0.2.9 (new package)
cipher-des-0.0.6 (new package)
cipher-rc4-0.1.4 (new package)
crypto-random-0.0.8 (new package)
cprng-aes-0.6.1 (new package)
crypto-numbers-0.2.7 (new package)
crypto-pubkey-0.2.7 (new package)
socks-0.5.4 (new package)
streaming-commons-0.1.8 (new package)
http-client-0.3.8.2 (latest: 0.4.6.2) (new package)
syb-0.4.4 (new package)
tagshare-0.0 (new package)
terminfo-0.4.0.0 (new package)
haskeline-0.7.1.3 (new package)
tf-random-0.5 (new package)
QuickCheck-2.7.6 (new package)
testing-feat-0.4.0.2 (new package)
transformers-compat-0.3.3.4 (new package)
optparse-applicative-0.10.0 (latest: 0.11.0.1) (new package)
union-find-0.2 (new package)
unix-compat-0.4.1.4 (new package)
unordered-containers-0.2.5.1 (new package)
aeson-0.8.0.2 +old-locale (new package)
aeson-pretty-0.7.2 (new package)
uniplate-1.6.12 (new package)
websockets-0.9.2.2 (new version)
wl-pprint-1.1 (new package)
language-ecmascript-0.16.2 (latest: 0.17) (new package)
elm-compiler-0.14 (new package)
x509-1.5.0.1 (new package)
x509-store-1.5.0 (new package)
x509-system-1.5.0 (new package)
x509-validation-1.5.1 (new package)
tls-1.2.13 (new package)
connection-0.2.3 (new package)
http-client-tls-0.2.2 (new package)
zip-archive-0.2.3.5 (new version)
elm-package-0.2 (latest: 0.2.2) (new package)
elm-make-0.1 (new package)
elm-repl-0.4 (new package)
zlib-enum-0.2.3.1 (new package)
snap-core-0.9.6.4 (new package)
snap-server-0.9.4.6 (new package)
websockets-snap-0.9.0.0 (new package)
elm-reactor-0.2 (latest: 0.2.0.1) (new package)
cabal: The following packages are likely to be broken by the reinstalls:
temporary-1.2.0.3
shellmate-0.1.6
Use --force-reinstalls if you want to install anyway.

更新:

根据要求,cabal exec ghc-pkg list temporal 的输出:

$ cabal exec ghc-pkg list temporary
/Applications/ghc-7.8.2.app/Contents/lib/ghc-7.8.2/package.conf.d
temporary-1.2.0.3
/Users/nbartlett/Development/Elm-Platform/tmp/.cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d

最佳答案

您已将 shellmatetemporary(以及可能的其他一些软件包 - 尤其是这些软件包的依赖项)安装到全局软件包数据库中,该数据库在沙箱中也可见。错误是这样的:

  1. 您即将安装已安装软件包(称为现有版本 A-1)的新版本(称为 A-2),并且
  2. 您即将重新安装软件包的现有版本(称为 B),并将其依赖项之一从 A-1 更新为 A-2,并且
  3. 新的 B 将影响旧的 B,并且
  4. 有一个包(称为 C)依赖于 B。

所有这一切的结果是,在重新安装 B 后,C 可能会被破坏,因为它会链接到 B,期望这会拖入 A-1,但 A-2 反而会被吸毒。在您的特定情况下,shellmatetemporary 都扮演着 C 的角色,并且对于它们中的每一个,至少有一个 exceptions-0.6.1 > 或 monads-tf-0.1.0.2 扮演 B 的角色。

你有很多选择;最吸引我的是:

  1. 从全局包数据库中删除 shellmatetemporary。这些将不再可用,但这种方式肯定可以防止很多问题。

    ghc-pkg unregister --global shellmate
    ghc-pkg unregister --global temporary
  2. 在全局包数据库中重新安装 shellmatetemporary 并更新依赖项。这可能有效,也可能无效。

    cabal install --reinstall --global shellmate-0.1.6 temporary-1.2.0.3 mtl-2.2.1 transformers-0.4.1.0
  3. 忽略警告并强制重新安装。 shellmatetemporary 可能无法在沙箱中使用。

    cabal install elm --force-reinstalls # from within the sandbox
  4. 将 elm、shellmate 和临时文件全部安装到沙箱中。这可能仍然会向您发出警告,但可以安全地忽略它们:在沙箱内,您希望使用沙箱版本(因此“损坏的”全局包无关紧要),而在沙箱外则使用全局包不会被破坏。

    cabal install elm temporary shellmate # possibly with --force-reinstalls

关于haskell - cabal 沙箱安装仍然失败,错误为 "packages are likely to be broken by the reinstalls",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27839021/

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