idontgetoutmuch / binary-low-level

A strict version of the Get monad from the binary package.
Other
3 stars 6 forks source link

Make compatible with GHC 9.2 #17

Open FPtje opened 2 years ago

FPtje commented 2 years ago

When attempting to compile with GHC 9.2.2, the first encountered error is a version bound set by the cabal file:

base >=4.12 && <4.16, bytestring >=0.10 && <0.11

When ignoring those version bounds (e.g. by using Nix' pkgs.haskell.lib.doJailbreak function, the following errors pop up on compile:

src/Data/Binary/Strict/BitGet.hs:179:14: error:
    Not in scope: ‘BI.inlinePerformIO’
    Module ‘Data.ByteString.Internal’ does not export ‘inlinePerformIO’.
    |
179 |     return . BI.inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
    |              ^^^^^^^^^^^^^^^^^^
[3 of 9] Compiling Data.Binary.BitBuilder ( src/Data/Binary/BitBuilder.hs, dist/build/Data/Binary/BitBuilder.o, dist/build/Data/Binary/BitBuilder.dyn_o )
src/Data/Binary/BitBuilder.hs:48:34: error:
    Module ‘Data.ByteString.Internal’ does not export ‘inlinePerformIO’
   |
48 | import Data.ByteString.Internal (inlinePerformIO)
   |                                  ^^^^^^^^^^^^^^^
[5 of 9] Compiling Data.Binary.Strict.ByteSet ( src/Data/Binary/Strict/ByteSet.hs, dist/build/Data/Binary/Strict/ByteSet.o, dist/build/Data/Binary/Strict/ByteSet.dyn_o )
[6 of 9] Compiling Data.Binary.Strict.Class ( src/Data/Binary/Strict/Class.hs, dist/build/Data/Binary/Strict/Class.o, dist/build/Data/Binary/Strict/Class.dyn_o )
[7 of 9] Compiling Data.Binary.Strict.Get ( src/Data/Binary/Strict/Get.hs, dist/build/Data/Binary/Strict/Get.o, dist/build/Data/Binary/Strict/Get.dyn_o )
src/Data/Binary/Strict/Get.hs:283:14: error:
    Not in scope: ‘B.inlinePerformIO’
    Neither ‘Data.ByteString’ nor ‘Data.ByteString.Internal’ exports ‘inlinePerformIO’.
    |
283 |     return . B.inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
    |              ^^^^^^^^^^^^^^^^^
[8 of 9] Compiling Data.Binary.Strict.IncrementalGet ( src/Data/Binary/Strict/IncrementalGet.hs, dist/build/Data/Binary/Strict/IncrementalGet.o, dist/build/Data/Binary/Strict/IncrementalGet.dyn_o )
src/Data/Binary/Strict/IncrementalGet.hs:310:14: error:
    Not in scope: ‘B.inlinePerformIO’
    Neither ‘Data.ByteString’ nor ‘Data.ByteString.Internal’ exports ‘inlinePerformIO’.
    |
310 |     return . B.inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
    |              ^^^^^^^^^^^^^^^^^

Some work is required to make this package compatible with GHC 9.2.x+.

idontgetoutmuch commented 2 years ago

Thanks for reporting this :-) You are right that some work is required to make this package compatible. I've just spent an hour on it to get it to compile but the tests fail. Given I no longer use this package, I am not going to do any more but I will leave what I have done as a draft PR in case it helps anyone who might care to fix things.

idontgetoutmuch commented 2 years ago

https://github.com/idontgetoutmuch/binary-low-level/pull/18