Aeson 0.10 seems to somehow have changed the way it handles generics, and thus crashes ghc.
build-depends: base >=4.8 && <4.9, aeson >=0.10 && <0.11, iso3166-country-codes
iso3166-country-codes is a very simple module with a datatype which lists all countries. It derives Generic.
The source code (src/Test.hs):
instance ToJSON CountryCode
Crashes GHC (Killed) - memory consumption raises up to 4GB before crashing.
This did not happen with previous versions of Aeson.
PS: I'm using ghc 7.10.1
I managed to build it successfully, but with a hideous peak of ~7 GB of memory usage.
This is very likely caused by GHC bug #5642.
The only thing I can't explain is why you didn't experience the problem on older versions of aeson.
I'm having the same issue.
Text.Pandoc.Definition (in pandoc-types) is a simple module that just defines some types and derives instances (including generic ToJSON and FromJSON instances).
When I try to build it on a 64-bit ubuntu VM with 2 GB RAM, using stack lts-4.0 (and ghc 7.10.3), ghc fails on this module with an "out of memory" error.
Reverting the aeson version by adding aeson: 0.8.0.2 to stack.yaml solves the problem.
This is a serious issue for me. Suddenly users are complaining that cabal install pandoc fails with a mysterious ExitFailure 1 error. I could put an upper-bound on aeson in pandoc-types.cabal, but then pandoc will be excluded from stackage. Is there any way to work around this or fix it in aeson? (The GHC bug does seem relevant, but I can confirm that the problem does not arise for earlier versions of aeson.)
cabal install pandoc
Here's a couple of observations:
Pull request #335 addresses this.