byteverse/contiguous

contiguous 0.6.4.1 built failed on ghc-9.4.8

Closed this issue · 5 comments

Hi, contiguous 0.6.4.1 seems to fail on ghc-9.4.8

Failed to build contiguous-0.6.4.1.
Build log (
/home/runner/.cabal/logs/ghc-9.4.8/contiguous-0.6.4.1-ca3a43ca8a234f4b071d3d51e2785e2c4b87336d2e3eaac2ef3f0b231bdcd215.log
):
Configuring library for contiguous-0.6.4.1..
Preprocessing library for contiguous-0.6.4.1..
Error: cabal: Failed to build contiguous-0.6.4.1 (which is required by
opendal-0.1.0.0). See the build log above for details.
Building library for contiguous-0.6.4.1..

[1 of 3] Compiling Data.Primitive.Contiguous.Shim ( src/Data/Primitive/Contiguous/Shim.hs, dist/build/Data/Primitive/Contiguous/Shim.o, dist/build/Data/Primitive/Contiguous/Shim.dyn_o )

src/Data/Primitive/Contiguous/Shim.hs:18:1: warning: [-Wdodgy-imports]
    Module ‘Data.Primitive’ does not export ‘fromListN’
   |
18 | import Data.Primitive hiding (fromList, fromListN)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Primitive/Contiguous/Shim.hs:18:1: warning: [-Wdodgy-imports]
    Module ‘Data.Primitive’ does not export ‘fromList’
   |
18 | import Data.Primitive hiding (fromList, fromListN)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Primitive/Contiguous/Shim.hs:39:46: warning: [-Wdeprecations]
    In the use of ‘sizeofSmallMutableArray’
    (imported from Data.Primitive, but defined in Data.Primitive.SmallArray):
    Deprecated: "use getSizeofSmallMutableArray instead"
   |
39 |   copySmallMutableArray dst 0 src 0 (min sz (sizeofSmallMutableArray src))
   |                                              ^^^^^^^^^^^^^^^^^^^^^^^
[2 of 3] Compiling Data.Primitive.Contiguous.Class ( src/Data/Primitive/Contiguous/Class.hs, dist/build/Data/Primitive/Contiguous/Class.o, dist/build/Data/Primitive/Contiguous/Class.dyn_o )

src/Data/Primitive/Contiguous/Class.hs:30:1: warning: [-Wdodgy-imports]
    Module ‘Data.Primitive’ does not export ‘fromListN’
   |
30 | import Data.Primitive hiding (fromList, fromListN)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Primitive/Contiguous/Class.hs:30:1: warning: [-Wdodgy-imports]
    Module ‘Data.Primitive’ does not export ‘fromList’
   |
30 | import Data.Primitive hiding (fromList, fromListN)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Primitive/Contiguous/Class.hs:[81](https://github.com/apache/opendal/actions/runs/7797770542/job/21265090471#step:6:82)0:28: warning: [-Wdeprecations]
    In the use of ‘sizeofSmallMutableArray’
    (imported from Data.Primitive, but defined in Data.Primitive.SmallArray):
    Deprecated: "use getSizeofSmallMutableArray instead"
    |
810 |   sizeMut = (\x -> pure $! sizeofSmallMutableArray x)
    |                            ^^^^^^^^^^^^^^^^^^^^^^^
[3 of 3] Compiling Data.Primitive.Contiguous ( src/Data/Primitive/Contiguous.hs, dist/build/Data/Primitive/Contiguous.o, dist/build/Data/Primitive/Contiguous.dyn_o )

src/Data/Primitive/Contiguous.hs:10[85](https://github.com/apache/opendal/actions/runs/7797770542/job/21265090471#step:6:86):15: error:
    Variable not in scope:
      liftA2
        :: (a0 -> STA v0 a0 -> STA v0 a0)
           -> f b -> f (STA arr2 b) -> f (STA arr2 b)
    Suggested fixes:
      • Perhaps use one of these:
          ‘A.liftA2’ (imported from Control.Applicative),
          ‘A.liftA’ (imported from Control.Applicative),
          ‘A.liftA3’ (imported from Control.Applicative)
      • Perhaps you want to add ‘liftA2’ to the import list
        in the import of ‘GHC.Base’
        (src/Data/Primitive/Contiguous.hs:2[88](https://github.com/apache/opendal/actions/runs/7797770542/job/21265090471#step:6:89):1-23).
     |
1085 |               liftA2
     |               ^^^^^^

src/Data/Primitive/Contiguous.hs:1333:13: error:
    Variable not in scope:
      liftA2
        :: (a1 -> STA v1 a1 -> STA v1 a1)
           -> m a -> m (STA arr a) -> m (STA arr a)
    Suggested fixes:
      • Perhaps use one of these:
          ‘A.liftA2’ (imported from Control.Applicative),
          ‘A.liftA’ (imported from Control.Applicative),
          ‘A.liftA3’ (imported from Control.Applicative)
      • Perhaps you want to add ‘liftA2’ to the import list
        in the import of ‘GHC.Base’
        (src/Data/Primitive/Contiguous.hs:288:1-23).
     |
[133](https://github.com/apache/opendal/actions/runs/7797770542/job/21265090471#step:6:134)3 |             liftA2

The full workflow: https://github.com/apache/opendal/actions/runs/7797770531/job/21265083658

I see what happened. In 0caa736 an automated refactor removed the import of liftA2, which is correct for GHC 9.6 but not for 9.4. If we replace liftA2 with A.liftA2, it should fix this problem.

I'm going to go ahead and do a metadata revision on hackage to prevent GHC 9.4 from being used with contiguous 0.6.4.1. And then I'll fix this later today.

Thanks!

I have released contiguous-0.6.4.2. This should resolve the issue.

Thank you, @andrewthad, for your efforts! Our CI is now up and running again.