Cabal破坏重新安装是否有解决方法?

sin*_*nan 9 haskell cabal

和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.
Run Code Online (Sandbox Code Playgroud)

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

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

Dan*_*her 7

在这种情况下的问题不是Cabal或cabal-install (1),它是cabal-dev:

if impl(ghc >= 6.12)
  Build-depends:
    containers >= 0.3 && < 0.5
Run Code Online (Sandbox Code Playgroud)

所以使用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,
Run Code Online (Sandbox Code Playgroud)

它也不接受该bytestring版本

  directory >= 1.0 && < 1.3,
  filepath >= 1.1 && < 1.4,
  Cabal >= 1.10.0.0 && < 1.15,
Run Code Online (Sandbox Code Playgroud)

也不是Cabal版本

  HTTP >= 4000.0.9 && < 4000.3,
  mtl >= 1.1 && < 2.1,
Run Code Online (Sandbox Code Playgroud)

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

  network >= 2.2 && < 2.4,
Run Code Online (Sandbox Code Playgroud)

要么 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,
Run Code Online (Sandbox Code Playgroud)

要么 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
Run Code Online (Sandbox Code Playgroud)

根据,GHC-7.6.1应该是快乐与GitHub的版本,所以克隆和构建.

(1)嗯,部分混乱是因为hackage页面没有显示所有依赖关系cabal-dev,只有那些ghc-pkg-6_8-compat,即basecabal,因此不明显cabal-dev-0.9.1不适用于ghc-7.6.