morpheus-graphql icon indicating copy to clipboard operation
morpheus-graphql copied to clipboard

Not compatible with aeson 2.2.0.0

Open thosakwe opened this issue 2 years ago • 2 comments

In https://github.com/morpheusgraphql/morpheus-graphql/issues/824#issuecomment-1519180163, there's a deprecation warning that module Data.Aeson.Internal is deprecated.

When trying to build an empty Cabal project with Cabal 3.10.1.0, GHC 9.6.2, and this build-depends:

build-depends:
    base ^>=4.18.0.0,
    morpheus-graphql ^>=0.27.3

I get these errors:

src/Data/Morpheus/App/MapAPI.hs:14:1: error:                                                                                                         
    Could not find module ‘Data.Aeson.Internal’                                                                                                      
    Perhaps you meant                                                                                                                                
      Data.Aeson.Internal.TH                                                                                                                         
      Data.Aeson.Internal.TH                                                                                                                         
      Data.Set.Internal (from containers-0.6.7)                                                                                                      
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.                                                                           
   |                                                                                                                                                 
14 | import Data.Aeson.Internal                                                                                                                      
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^...                                                                                                                   
                                                                                                                                                     
src/Data/Morpheus/App/MapAPI.hs:18:1: error:                                                                                                         
    Could not load module ‘Data.Aeson.Parser’                                                                                                        
    It is a member of the hidden package ‘attoparsec-aeson-2.2.0.0’.                                                                                 
    Perhaps you need to add ‘attoparsec-aeson’ to the build-depends in your .cabal file.                                                             
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.                                                                           
   |                                                                                                                                                 
18 | import Data.Aeson.Parser                                                                                                                        
   | ^^^^^^^^^^^^^^^^^^^^^^^^...     

It seems like aeson-2.2.0.0 has removed the deprecated modules.

I wouldn't mind sending in a PR to fix this; however, I'm new to Haskell ecosystem, so I'm not sure if me modifying this library to be compatible with the latest version of Aeson will break previous versions of morpheus-graphql.

Thanks for your work on this library. I'd be happy to contribute this fix if necessary.

thosakwe avatar Aug 29 '23 05:08 thosakwe

In the meantime, I was able to build the project by adding aeson == 2.1.2.1 to my build-depends.

Based on the aeson changelog, Data.Aeson.Internal was removed in 2.2.0.0..

I think the PR would be pretty trivial - just replacing Data.Aeson.Internal with Data.Aeson.Types in morpheus-graphql-app.

thosakwe avatar Aug 29 '23 05:08 thosakwe

@thosakwe I'm not a maintainer of morpheus, but I think you should create a PR for it. If accepted, they can make a new release with an updated version number with the change. Users can depend on the current version to avoid any breaking changes.

seanhess avatar Sep 06 '23 18:09 seanhess

now it should be

nalchevanidze avatar Jun 06 '24 19:06 nalchevanidze