frasertweedale / hs-jose

Haskell JOSE and JWT library
http://hackage.haskell.org/package/jose
Apache License 2.0
122 stars 46 forks source link

build fails with aeson-2.0 #105

Closed juhp closed 2 years ago

juhp commented 2 years ago
jose                      > /tmp/stack-e31187e918bb22b3/jose-0.8.5.1/src/Crypto/JOSE/Types/Internal.hs:58:35: error:
jose                      >     • Couldn't match type: Data.Aeson.KeyMap.KeyMap Value
jose                      >                      with: M.HashMap Key Value
jose                      >       Expected: M.HashMap Key Value
jose                      >         Actual: Object
jose                      >     • In the first argument of ‘M.toList’, namely ‘o’
jose                      >       In the expression: M.toList o
jose                      >       In an equation for ‘objectPairs’:
jose                      >           objectPairs (Object o) = M.toList o
jose                      >    |
jose                      > 58 | objectPairs (Object o) = M.toList o
jose                      >    |                                   ^
frasertweedale commented 2 years ago

jose-0.8.5.1 constraint aeson to < 2.0: https://hackage.haskell.org/package/jose-0.8.5.1/src/jose.cabal

jose-0.9 supports aeson >= 2.0.1.0 && < 3: https://hackage.haskell.org/package/jose-0.9/src/jose.cabal

How is it that jose-0.8.5.1 is being built against aeson 2.x, contrary to the specified bounds? I assume this is a stack thing? In any case, the fix should be to bump to jose-0.9. This might cause downstream breakage as there was unavoidable (but minor) API breakage to update jose to use aeson-2.0 (hence the major version bump to v0.9).

juhp commented 2 years ago

Okay thanks - ya I was testing with current Stackage Nightly versions