2

我正在尝试使用 Travis-CI 构建我的 Hakyll 站点。但是,在我还没走到那一步之前,我在尝试将 Hakyll 安装为依赖项时遇到了依赖项错误。

我可以毫无问题地在我的机器上本地构建 Hakyll。什么可能导致依赖错误,如何解决?有没有办法在不实际对每个依赖版本进行硬编码的情况下解决它?

这是来自 TravisCI 的输出。

travis_fold:end:git.5
$ export PATH=/usr/local/ghc/$(ghc_find 7.6)/bin/:$PATH
travis_fold:start:cabal
$ cabal update
Config file path source is default config file.
Config file /home/travis/.cabal/config not found.
Writing default configuration to /home/travis/.cabal/config
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
travis_fold:end:cabal
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.18.0.2
using version 1.18.1 of the Cabal library 
travis_fold:start:before_install.1
$ cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install
travis_fold:end:before_install.1
travis_fold:start:before_install.2
$ cabal install hakyll pandoc
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: hakyll-4.5.3.0 (user goal)
trying: base-4.6.0.1/installed-8aa... (dependency of hakyll-4.5.3.0)
trying: hakyll-4.5.3.0:+checkexternal
trying: http-conduit-2.1.2.3 (dependency of hakyll-4.5.3.0:+checkexternal)
trying: http-client-0.3.3.2 (dependency of http-conduit-2.1.2.3)
trying: exceptions-0.6.1 (dependency of http-client-0.3.3.2)
trying: transformers-0.4.1.0 (dependency of http-conduit-2.1.2.3)
next goal: mtl (dependency of hakyll-4.5.3.0)
rejecting: mtl-2.2.1, 2.2.0.1, 2.2 (conflict: hakyll => mtl>=1 && <2.2)
rejecting: mtl-2.1.3.1, 2.1.2 (conflict: transformers==0.4.1.0, mtl =>
transformers==0.3.*)
rejecting: mtl-2.1.1, 2.1 (conflict: base==4.6.0.1/installed-8aa..., mtl =>
base<4.6)
rejecting: mtl-2.0.1.1 (conflict: transformers==0.4.1.0, mtl =>
transformers==0.2.*)
rejecting: mtl-2.0.1.0, 2.0.0.0 (conflict: base==4.6.0.1/installed-8aa..., mtl
=> base<4.6)
rejecting: mtl-1.1.1.1, 1.1.1.0, 1.1.0.2, 1.1.0.1, 1.1.0.0, 1.0 (conflict:
exceptions => mtl>=2.0 && <2.3)
Backjump limit reached (change with --max-backjumps).

[31;1mThe command "cabal install hakyll pandoc" failed and exited with 1 during .[0m

Your build has been stopped.

如果有任何其他有用的输出,请告诉我,我可以提供。

4

1 回答 1

5

如果您Backjump limit reached从 cabal-install 获得,首先要尝试使用--max-backjumps=-1“彻底搜索”的选项再次尝试,但如果它最终需要数十分钟,您需要中断它或依赖 Travis-CI暂停。对于大型但有限的搜索,您还可以使用 500 或 1000 而不是 -1 - 默认值为 200。

如果这不起作用,请尝试选择特定项目以使用选项限制到特定版本--constraint 'foo==0.1.0.0,最好是您真正知道应该可以使用相同 GHC 版本安装的项目。

在这种特殊情况下,以下两行表明它hakyll本身就是问题的根源:

rejecting: mtl-2.2.1, 2.2.0.1, 2.2 (conflict: hakyll => mtl>=1 && <2.2)
rejecting: mtl-2.1.1, 2.1 (conflict: base==4.6.0.1/installed..., mtl => base<4.6)

换句话说,base与 GHC 版本相关的 似乎需要mtl>=2.2(或者可能少于2.1但我怀疑这也行不通)。hakyll是需要mtl<2.2的,所以似乎存在根本冲突,暗示hakyll这个版本的base.

于 2014-07-02T21:41:58.683 回答