1
votes

I have a Homebrew-installed Haskell platform version 2013.2.0.0 with GHC 7.6.3 and an up-to-date cabal install. I try to install yesod-core - it grabs version 1.2.6.4, and I get this compilation error:

[11 of 20] Compiling Yesod.Core.Class.Yesod ( Yesod/Core/Class/Yesod.hs, dist/dist-sandbox-74f8d9fc/build/Yesod/Core/Class/Yesod.o )

Yesod/Core/Class/Yesod.hs:519:81:
    Could not deduce (aeson-0.7.0.0:Data.Aeson.Types.Class.ToJSON
                        Network.HTTP.Types.Method.Method)
      arising from a use of `.='
    from the context (Yesod site)
      bound by the type signature for
                 defaultErrorHandler :: Yesod site =>
                                        ErrorResponse -> HandlerT site IO TypedContent
      at Yesod/Core/Class/Yesod.hs:439:24-83
    Possible fix:
      add an instance declaration for
      (aeson-0.7.0.0:Data.Aeson.Types.Class.ToJSON
         Network.HTTP.Types.Method.Method)
    In the expression: "method" .= m
    In the first argument of `object', namely
      `["message" .= ("Bad method" :: Text), "method" .= m]'
    In the second argument of `($)', namely
      `object ["message" .= ("Bad method" :: Text), "method" .= m]'

... which looks like an actual bug in the Yesod code. Any suggestions on how to proceed?

1
Note that it's highly recommended to use the yesod-platform to install versions of dependencies which are known to work correctly together.Michael Snoyman
@MichaelSnoyman: I did. When it failed, I tracked the specific failure down to yesod-core.Mark Reed
But there's no version of yesod-platform which uses aeson-0.7.0.0. Why was it trying to build yesod-core against that version of aeson?Michael Snoyman
@MichaelSnoyman OK, I tried starting over on a different Mac. I successfully installed yesod-platform 1.2.5.3 with aeson-0.6.2.1. I had no 'yesod' executable, so I installed yesod-bin as well. That worked fine. But when I created a cabal sandbox for a new yesod app and ran a plain cabal install in it, it installed aeson-0.7.0.0. Then yesod test complained that yesod-test and hspec weren't installed, and when I tried to install them it recompiled yesod-core with the 0.7 aeson and boom. So I had to do cabal install aeson-0.6.2.1 yesod-test.Mark Reed
The problem was that you did cabal install yesod in the sandbox instead of cabal install yesod-platform.Michael Snoyman

1 Answers

3
votes

Looks like this is a build dependency issue in yesod-core, The developers on the irc channel are aware of the issue. To work around this trying installing yesod-core with this command

cabal install aeson-0.6.2.1 yesod-core

This will force the use of the previous version of aeson which works on my system in a fresh cabal sandbox.