stack resolver lts-10.0 error: AesonException

Created on 21 Dec 2017  路  6Comments  路  Source: commercialhaskell/stack

When I start a new project, I get an AesonException:

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

Selecting the best among 12 snapshots...

Downloaded lts-10.0 build plan.
AesonException "Error in $.packages.cassava.constraints.flags: failed to parse field packages: failed to parse field constraints: failed to parse field flags: Invalid flag name: \"bytestring--lt-0_10_4\""

I'm using:

  • stack Version 1.2.0 x86_64 hpack-0.14.0
  • stack installed using Mac's homebrew
  • ghc version 8.2.2
  • macOS High Sierra 10.13.2 (17C88)

Cheers!

Most helpful comment

Thanks for the report.

This is actually due to using an old version of stack. 1.2.0 is a few versions back. You'll have to upgrade unfortunately. stack upgrade is usually the easiest way.

All 6 comments

Thanks for the report.

This is actually due to using an old version of stack. 1.2.0 is a few versions back. You'll have to upgrade unfortunately. stack upgrade is usually the easiest way.

Should we add a warning for this issue? A lot of tickets are being raised. A warning for < 1.6?

Great! Upgrading stack fixed the problem. I'm now running Version 1.6.1.1 x86_64 hpack-0.20.0 and the AesonException is gone.

However, I should point out that, before opening the current issue (#3686), I tried first stack update, with no change. Then, I uninstalled stack (and related files) and installed stack back, with no change either:

$ brew uninstall stack
$ trash ~/.stack ~/.cabal ~/.ghc
$ brew update && brew upgrade && brew cleanup && brew prune
$ brew install stack
$ stack new hello
Downloading template "new-template" to create project "hello" in hello/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- hello/hello.cabal

Selecting the best among 12 snapshots...

Downloaded lts-10.0 build plan.
AesonException "Error in $.packages.cassava.constraints.flags: failed to parse field packages: failed to parse field constraints: failed to parse field flags: Invalid flag name: \"bytestring--lt-0_10_4\""

Maybe, the problem is due to an old version being of stack served by homebrew.

Yep - brew probably puts it in /usr/bin and stack puts executables in ~/.local/bin. A stack upgrade should have warned about not having ~/.local/bin on your $PATH if that was the case - otherwise, I think the original executable would take precedence?

I think you're right. Homebrew puts stuff in /usr/local/bin (https://docs.brew.sh/FAQ.html). In my $PATH, that dir is before stack's ~/.local/bin. So the original executable was being called. However, stack upgrade, and not a path change, fixed the AesonException. Maybe upgrading also solves other related issues?

Sounds like the overall issue here is resolved, so closing.

I'm not sure if 1.2.0 was recent enough, but at some point a warning was added to upgrade in the case that the destination location is not on your PATH.

Was this page helpful?
0 / 5 - 0 ratings