I'm trying to setup a new project using the nightly-2017-08-17
snapshot
stack new test --resolver nightly-2017-08-17
However this gives the following error:
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
Cabal is in its latest version:
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
Is this not the correct way of selecting this nightly snapshot with stack
or is this a bug in the tool?
Cabal's file format has changed in the 2.0 release of it (likely because of backpack). You have to use Stack version >= 1.5.1
which bypasses this error. A proper fix for this will be likely released in the next version of Stack. IIRC, the fix is already in the master brach of the stack - so the upgrade via --source-only
willl also work for you.
You can read the changelog here to know more information about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With