10

与 Cabal 合作太累了,我拿着我最新的工作 .cabal 文件的副本,这样当其他一些包(尤其是像 hakyll 这样的可执行文件,它需要永远重新安装)被破坏时,我可以从最新的保存点重新加载。

但它仍然不能让一些事情变得更容易,因为如果不以不同的顺序完全安装我的包,我就无法安装一些包(即破坏其他包的包应该在其他包之前安装等)

例如,当我尝试安装时会发生以下情况cabal-dev(这对我来说是一个非常重要的包):

➜  ~  cabal install cabal-dev
Resolving dependencies...
In order, the following would be installed:
bytestring-0.9.2.1 (new version)
containers-0.4.2.1 (new version)
template-haskell-2.8.0.0 (reinstall) changes: containers-0.5.0.0 -> 0.4.2.1
text-0.11.2.3 (reinstall) changes: bytestring-0.10.0.0 -> 0.9.2.1
transformers-0.2.2.0 (new version)
mtl-2.0.1.0 (new version)
parsec-3.1.3 (reinstall) changes: bytestring-0.10.0.0 -> 0.9.2.1, mtl-2.1.2 ->
2.0.1.0
unix-2.3.2.0 (new version)
directory-1.0.0.3 (new version)
network-2.3.2.0 (new version)
HTTP-4000.2.6 (reinstall) changes: bytestring-0.10.0.0 -> 0.9.2.1, mtl-2.1.2
-> 2.0.1.0, network-2.4.0.1 -> 2.3.2.0
process-1.1.0.2 (reinstall) changes: directory-1.2.0.0 -> 1.0.0.3,
unix-2.6.0.0 -> 2.3.2.0
Cabal-1.14.0 (new version)
tar-0.3.2.0 (new package)
zlib-0.5.4.0 (reinstall) changes: bytestring-0.10.0.0 -> 0.9.2.1
cabal-dev-0.9.1 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
shakespeare-1.0.2
hamlet-1.1.2
hakyll-3.5.2.0
lens-3.7.1.2
ghc-7.6.1
haddock-2.13.1
data-lens-template-2.1.7
cmdargs-0.10.1
hoogle-4.2.14
QuickCheck-2.5.1.1
Extra-1.46
ipprint-0.4.2
xml-1.3.12
texmath-0.6.1.1
pandoc-1.9.4.5
wai-1.3.0.1
warp-1.3.6
tagsoup-0.12.8
snap-server-0.9.2.4
snap-core-0.9.2.2
regex-tdfa-1.1.8
Unixutils-1.52
network-2.4.0.1
simple-sendfile-0.2.10
network-conduit-0.6.2.1
citeproc-hs-0.3.6
language-lua-0.1.4
json-0.7
highlighting-kate-0.5.3.3
ddc-base-0.3.1.1
ddc-driver-0.3.1.3
ddc-core-simpl-0.3.1.1
ddc-core-llvm-0.3.1.1
ddc-build-0.3.1.3
ddc-core-salt-0.3.1.1
ddc-core-eval-0.3.1.1
ddc-core-0.3.1.1
http-types-0.7.3.0.1
hexpat-0.20.3
hashable-1.2.0.2
vault-0.2.0.3
unordered-containers-0.2.3.0
uniplate-1.6.10
case-insensitive-0.4.0.4
enumerator-0.4.19
zlib-enum-0.2.3
blaze-builder-enumerator-0.2.0.5
attoparsec-enumerator-0.3.1
conduit-0.5.5
blaze-builder-conduit-0.5.0.3
blaze-markup-0.5.1.4
blaze-html-0.5.1.3
blaze-builder-0.3.1.0
attoparsec-0.10.3.0
haskell98-2.0.0.2
Cabal-1.16.0
bin-package-db-0.0.0.0
zlib-bindings-0.1.1.2
zip-archive-0.1.2.1
Use --force-reinstalls if you want to install anyway.

唯一的解决方法是在该列表中的其他一些软件包之前安装 cabal-dev。但我认为即使我这样做,也不能保证其他一些包不会发生冲突。

现在我想知道您如何处理 cabal 安装中的冲突,以及是否有解决此问题的方法。我只是无法使用 Cabal 安装我需要的所有库。任何帮助将不胜感激。

4

1 回答 1

7

这种情况下的问题不是 Cabal 或 cabal-install (1)而是 cabal-dev

if impl(ghc >= 6.12)
  Build-depends:
    containers >= 0.3 && < 0.5

所以对于 ghc-7.6.1,它拒绝使用containers它附带的包:非常糟糕。

-- Require this specific version that came with GHC 6.10 because
-- of packaging problems with containers-0.2
if impl(ghc == 6.10)
  Build-depends:
    containers == 0.2.0.1

if impl(ghc == 6.8)
  Build-depends:
    containers == 0.1.0.2

Build-depends:
  bytestring >= 0.9 && < 0.10,

它也不接受bytestring版本

  directory >= 1.0 && < 1.3,
  filepath >= 1.1 && < 1.4,
  Cabal >= 1.10.0.0 && < 1.15,

也不是Cabal版本

  HTTP >= 4000.0.9 && < 4000.3,
  mtl >= 1.1 && < 2.1,

mtl它可能对您拥有的版本不满意

  network >= 2.2 && < 2.4,

或者network

  pretty >= 1.0 && < 1.2,
  process >= 1.0 && < 1.2,
  tar >= 0.3 && < 0.4,
  zlib >= 0.5 && < 0.6,
  transformers >= 0.2 && < 0.3,

或者transformers

  -- Template haskell is special: the compiler will die if a
  -- version other than the one that is shipped with the compiler
  -- is used. Here, we don't constrain the version and hope that
  -- there will be only one.
  template-haskell

据此 ghc-7.6.1 应该对 github 版本感到满意,所以克隆并构建它。

(1)好吧,部分混乱是因为hackage 页面没有显示 的​​所有依赖项cabal-dev,仅显示 的依赖项ghc-pkg-6_8-compat,即basecabal,因此显然cabal-dev-0.9.1不适用于 ghc-7.6。

于 2013-01-05T12:34:08.517 回答