mgsloan / store

Fast binary serialization in Haskell
MIT License
109 stars 35 forks source link

Build failure in store-0.7.2 with GHC 8.10.1 #149

Closed sjakobi closed 4 years ago

sjakobi commented 4 years ago
src/Data/Store/Internal.hs:851:3: error:
    • Expecting one more argument to ‘IO’
      Expected a type, but ‘IO’ has kind ‘* -> *’
    • In the first argument of ‘Store’, namely ‘IO’
      In the instance declaration for ‘Store IO’
    |
851 | $(reifyManyWithoutInstances ''Store [''Info] (const True) >>=
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Data/Store/Internal.hs:851:3: error:
    • Expecting two more arguments to ‘GHC.STRef.STRef’
      Expected a type, but ‘GHC.STRef.STRef’ has kind ‘* -> * -> *’
    • In the first argument of ‘Store’, namely ‘GHC.STRef.STRef’
      In the instance declaration for ‘Store GHC.STRef.STRef’
    |
851 | $(reifyManyWithoutInstances ''Store [''Info] (const True) >>=
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Data/Store/Internal.hs:851:3: error:
    • Expecting one more argument to ‘GHC.IORef.IORef’
      Expected a type, but ‘GHC.IORef.IORef’ has kind ‘* -> *’
    • In the first argument of ‘Store’, namely ‘GHC.IORef.IORef’
      In the instance declaration for ‘Store GHC.IORef.IORef’
    |
851 | $(reifyManyWithoutInstances ''Store [''Info] (const True) >>=
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Data/Store/Internal.hs:851:3: error:
    • Expecting one more argument to ‘GHC.ForeignPtr.ForeignPtr’
      Expected a type, but ‘GHC.ForeignPtr.ForeignPtr’ has kind ‘* -> *’
    • In the first argument of ‘Store’, namely
        ‘GHC.ForeignPtr.ForeignPtr’
      In the instance declaration for ‘Store GHC.ForeignPtr.ForeignPtr’
    |
851 | $(reifyManyWithoutInstances ''Store [''Info] (const True) >>=
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
RyanGlScott commented 4 years ago

This is most likely due to template-haskell-2.16.0.0 introducing the Bytes data type to Lit, whose constructor uses ForeignPtr. Since there is no Store instance for Bytes, reifyManyWithoutInstances attempts to recursively define Store instances for Bytes and everything mentioned in its constructor. This includes ForeignPtr, IO, and friends.

mgsloan commented 4 years ago

Yep, that's exactly what's happening @RyanGlScott - I'm working on fixing it.

mgsloan commented 4 years ago

I've written the instances, the thing I'm encountering right now is that Bytes uses derived instances of Eq / Ord / etc which are comparing pointers and such rather than the contents of the bytes. Which sucks, because it breaks the roundtrip properties.

mgsloan commented 4 years ago

Fixed in store-0.7.3!

mgsloan commented 4 years ago

Oops, didn't use enough CPP. This time I will wait until travis is green before pushing to hackage

mgsloan commented 4 years ago

Properly fixed in store-0.7.4

sjakobi commented 4 years ago

Thank you! :)