haskell / primitive

This package provides various primitive memory-related operations.
Other
114 stars 58 forks source link

Support GHC 9.2 #303

Closed andreabedini closed 3 years ago

andreabedini commented 3 years ago

Hi there,

I gave it a shot at fixing #302. This is all pretty naive as I am still not very familiar with GHC primitives. It compiles and passes tests on GHC 8.8, GHC 8.10, GHC 9.0. For GHC 9.2 I haven't managed to run the tests yet because the bifunctor doesn't compile on GHC 9.2 (due to some changes to template-haskell). I might do some manual testing.

andrewthad commented 3 years ago

I've confirmed that GHC 8.10.4 can build this PR, and the test-qc test suite still passes. Note that the test suite actually checks that setByteArray works on integral types of all standard sizes:

    , testGroup "ByteArray"
      [ testGroup "Ordering"
        [ TQC.testProperty "equality" byteArrayEqProp
        , TQC.testProperty "compare" byteArrayCompareProp
      , testGroup "Filling"
        [ TQC.testProperty "Int8" (setByteArrayProp (Proxy :: Proxy Int8))
        , TQC.testProperty "Int16" (setByteArrayProp (Proxy :: Proxy Int16))
        , TQC.testProperty "Int32" (setByteArrayProp (Proxy :: Proxy Int32))
        , TQC.testProperty "Int64" (setByteArrayProp (Proxy :: Proxy Int64))
        , TQC.testProperty "Int" (setByteArrayProp (Proxy :: Proxy Int))
        , TQC.testProperty "Word8" (setByteArrayProp (Proxy :: Proxy Word8))
        , TQC.testProperty "Word16" (setByteArrayProp (Proxy :: Proxy Word16))
        , TQC.testProperty "Word32" (setByteArrayProp (Proxy :: Proxy Word32))
        , TQC.testProperty "Word64" (setByteArrayProp (Proxy :: Proxy Word64))
        , TQC.testProperty "Word" (setByteArrayProp (Proxy :: Proxy Word))
        ]
      ]

Can you confirm that the test suite passes with GHC 9.2? The invocation would be:

cabal build -w my-custom-ghc --builddir dist-head test-qc
/home/amartin/Development/primitive/dist-head/build/{... suppressed path ...}/test-qc/test-qc
andrewthad commented 3 years ago

I'm sorry. I didn't fully read your original post. If the tests are passing with all of those GHCs, I'm fine with merging this. I'm going to check 7.10 and 7.8, but I expect those to pass.

andrewthad commented 3 years ago

This works with GHC 7.8.4 and GHC 7.10.3. Merging.

andrewthad commented 3 years ago

Also, thanks for doing this!

andreabedini commented 3 years ago

That was quick @andrewthad <3 I could not run tests with GHC 9.2 because the test suite depends on bifunctor which does not compile on 9.2. I will try again though.

andreabedini commented 3 years ago

@andrewthad after having mutilated quickcheck-classes-base to not depend on bifunctor, I have managed to compile it with GHC 9.2 and therefore to compile the tests. Lo and behold, the tests pass on GHC 9.2 💥

andrewthad commented 3 years ago

Excellent. That's good news.