简体   繁体   English

错误解决Travis-CI上的集团依赖关系

[英]Error resolving cabal dependencies on Travis-CI

I'm trying to build my Hakyll site using Travis-CI. 我正在尝试使用Travis-CI建立我的Hakyll网站。 However, before I even get that far, I have a dependencies error when trying to install Hakyll as a dependency. 但是,在实现这一目标之前,尝试将Hakyll安装为依赖项时出现了依赖项错误。

I can build Hakyll locally on my machine with no problems. 我可以在我的机器上本地构建Hakyll,没有任何问题。 What might be causing the dependency error, and how can it be resolved? 是什么导致依赖性错误,如何解决? Is there a way to resolve it without actually hard-coding each dependency version? 有没有解决方法,而无需实际对每个依赖版本进行硬编码?

Here's the output that comes from TravisCI. 这是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.

If there's any other output that would be useful, let me know and I can provide it. 如果还有其他有用的输出,请告诉我,我可以提供。

The first thing to try if you get Backjump limit reached from cabal-install is to try again with the option --max-backjumps=-1 which means "search exhaustively", though if it then ends up taking tens of minutes you'd need to interrupt it or rely on the Travis-CI timeout. 如果从cabal-install Backjump limit reached ,首先要尝试的是使用--max-backjumps=-1选项重试,这意味着“进行详尽搜索”,尽管如果这样做最终会花费数十分钟,需要中断它或依靠Travis-CI超时。 You can also use 500 or 1000 rather than -1 for a large but limited search - the default is 200. 对于大型但受限的搜索,您还可以使用500或1000而不是-1-默认值为200。

If that doesn't work then try to pick out specific projects to constrain to a specific version with the option --constraint 'foo==0.1.0.0 , preferably one that you actually know should be installable with the same GHC version. 如果这不起作用,则尝试使用--constraint 'foo==0.1.0.0选项来挑选特定项目以约束到特定版本,最好是您实际上知道的项目应该可以使用相同的GHC版本安装。

In this particular case, the following two lines suggest that hakyll itself was at the root of the problem: 在此特定情况下,以下两行表明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)

In other words, base , which is tied to the GHC version, seems to require mtl>=2.2 (or perhaps less than 2.1 but I suspect that wouldn't have worked either). 换句话说,与GHC版本绑定的base似乎需要mtl>=2.2 (或者可能小于2.1但我怀疑这也不起作用)。 hakyll was requiring mtl<2.2 , so there seemed to be a fundamental conflict implying that this version of hakyll wouldn't work this version of base . hakyll要求mtl<2.2 ,因此似乎存在根本冲突,这意味着此版本的hakyll无法在此版本的base

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM