使用堆栈的夜间快照时需要使用Cabal 2.0

Dam*_*les 5 haskell cabal haskell-stack

我正在尝试使用nightly-2017-08-17快照设置一个新项目

stack new test --resolver nightly-2017-08-17
Run Code Online (Sandbox Code Playgroud)

但是,这会产生以下错误:

Downloading template "new-template" to create project "test" in test/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- test/test.cabal

Selected resolver: nightly-2017-08-17
Unable to parse cabal file: FromString "This package requires at least Cabal version 2.0" Nothing
Run Code Online (Sandbox Code Playgroud)

Cabal的最新版本:

stack setup --upgrade-cabal
Currently installed Cabal is 2.0.0.2, newest is 2.0.0.2. I'm not upgrading Cabal.
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
Run Code Online (Sandbox Code Playgroud)

这不是选择此夜间快照的正确方法,stack或者这是工具中的错误吗?

Sib*_*ibi 7

Cabal的文件格式在2.0版本中发生了变化(可能是因为背包).您必须使用堆栈版本> = 1.5.1绕过此错误.在下一版本的Stack中可能会发布适当的修复方法.IIRC,修复已经在堆栈的主要部分 - 所以通过--source-onlywilll 升级也适合你.

您可以在此处阅读更改日志以了解有关它的更多信息.