cabal sandbox安装仍然失败,因为“重新安装可能会破坏软件包”

时间:2015-01-08 11:26:36

标签: haskell cabal elm

我尝试使用cabal沙箱构建Elm Platform。然而,安装失败并且消息"重新安装"可能会破坏软件包。在我看来,这与沙盒的整个目的相矛盾,我认为沙盒应该避免这种错误。

有人可以为我解释这个错误,甚至更好地帮我继续安装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 temporary的输出:

$ 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

2 个答案:

答案 0 :(得分:5)

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

  1. 您即将安装已安装的软件包的新版本(称之为A-2)(调用现有的A-1),
  2. 您即将重新安装一个软件包的现有版本(称之为B),该软件包会将其中一个依赖项从A-1更新为A-2,并且
  3. 新B将影响旧B,
  4. 有一个包(称之为C),它取决于B。
  5. 所有这一切的结果是在重新安装B之后C可能会被打破,因为它会链接到B,期望这会拖累到A-1,但是A-2将会被吸毒。在您的特定情况下,shellmatetemporary都扮演C的角色,对于每个{C}},至少有exceptions-0.6.1monads-tf-0.1.0.2中的一个扮演{ {1}}。

    你有很多选择;对我来说最吸引人的是:

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

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

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

      shellmate
    4. 将elm,shellmate和temporary全部安装到沙箱中。这可能仍然会给你警告,但是可以安全地忽略它们:在沙箱中,你希望使用沙箱版本(因此“破坏的”全局包无关紧要),并且在沙箱之外的全局包不会被打破。

      temporary

答案 1 :(得分:1)

在尝试同时安装多个软件包时,我遇到了同样的问题。一个包A取决于包B和A和B取决于包C的不同版本。(这是我对情况的心理模型)。

通过单独安装软件包而不是一次性安装软件包清除了我的特定安装阻塞[*]。我没有一个包含N个包的命令,而是一次只有一个包的N个命令。

[*]由于我不确定问题的原因,我也无法确定究竟解决了什么问题。