被宣传为 Haskell 工具的突破,我尝试从 Cabal 切换到 Stack。但是,我仍然无法让项目使用与 cabal 一起运行的堆栈来运行。我认为问题在于解析器设置的全局约束(例如堆栈中的长期支持包)不符合本地包依赖关系。
举个具体的例子,我在 0.14.0.6 版本中使用了 snap 框架 ( http://snapframework.com/ )。使用 . 创建完整的 snap 项目后snap init
,我尝试使用stack init
. 但是,堆栈没有找到满足约束的构建计划。另一方面,acabal install
成功构建了项目。
我对堆栈的理解有误吗?如何解决这个问题?
完整的错误日志如下所示,项目名称为 SnapFull:
Checking against build plan lts-3.7
* Build plan did not match your requirements:
base version 4.8.1.0 found
- SnapFull requires >=4 && <4.4
lens version 4.12.3 found
- SnapFull requires >=3.7.6 && <3.8
snap-loader-dynamic not found
- SnapFull requires ==0.10.*
snap-loader-static not found
- SnapFull requires >=0.9 && <0.10
Checking against build plan lts-2.22
* Build plan did not match your requirements:
base version 4.7.0.2 found
- SnapFull requires >=4 && <4.4
lens version 4.7.0.1 found
- SnapFull requires >=3.7.6 && <3.8
snap-loader-dynamic not found
- SnapFull requires ==0.10.*
snap-loader-static not found
- SnapFull requires >=0.9 && <0.10
Checking against build plan lts-3.8
* Build plan did not match your requirements:
base version 4.8.1.0 found
- SnapFull requires >=4 && <4.4
lens version 4.12.3 found
- SnapFull requires >=3.7.6 && <3.8
snap-loader-dynamic not found
- SnapFull requires ==0.10.*
snap-loader-static not found
- SnapFull requires >=0.9 && <0.10
Checking against build plan nightly-2015-10-09
* Build plan did not match your requirements:
base version 4.8.1.0 found
- SnapFull requires >=4 && <4.4
lens version 4.12.3 found
- SnapFull requires >=3.7.6 && <3.8
snap-loader-dynamic not found
- SnapFull requires ==0.10.*
snap-loader-static not found
- SnapFull requires >=0.9 && <0.10
There was no snapshot found that matched the package bounds in your .cabal files.
Please choose one of the following commands to get started.
stack init --resolver lts-3.7
stack init --resolver lts-2.22
stack init --resolver lts-3.8
stack init --resolver nightly-2015-10-09
You'll then need to add some extra-deps. See:
https://github.com/commercialhaskell/stack/blob/master/doc/yaml_configuration.md#extra-deps
You can also try falling back to a dependency solver with:
stack init --solver