sjshuck / hs-pcre2

Complete Haskell binding to PCRE2
Apache License 2.0
12 stars 2 forks source link

Build failures with mtl-2.3 #30

Closed sjakobi closed 2 years ago

sjakobi commented 2 years ago
Building library for pcre2-2.1.1..
[1 of 7] Compiling Paths_pcre2      ( dist/build/autogen/Paths_pcre2.hs, dist/build/Paths_pcre2.o, dist/build/Paths_pcre2.dyn_o )
[2 of 7] Compiling Text.Regex.Pcre2.Foreign.TH ( src/hs/Text/Regex/Pcre2/Foreign/TH.hs, dist/build/Text/Regex/Pcre2/Foreign/TH.o, dist/build/Text/Regex/Pcre2/Foreign/TH.dyn_o )
[3 of 7] Compiling Text.Regex.Pcre2.Foreign ( src/hs/Text/Regex/Pcre2/Foreign.hs, dist/build/Text/Regex/Pcre2/Foreign.o, dist/build/Text/Regex/Pcre2/Foreign.dyn_o )
[4 of 7] Compiling Text.Regex.Pcre2.Internal ( src/hs/Text/Regex/Pcre2/Internal.hs, dist/build/Text/Regex/Pcre2/Internal.o, dist/build/Text/Regex/Pcre2/Internal.dyn_o )

src/hs/Text/Regex/Pcre2/Internal.hs:76:12: error:
    • Variable not in scope: fix :: ((a -> b) -> a -> b) -> a -> b
    • Perhaps you meant one of these:
        ‘fix1’ (line 76), ‘fix2’ (line 80), ‘fix3’ (line 84)
   |
76 | fix1 x f = fix f x
   |            ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:80:14: error:
    • Variable not in scope:
        fix :: ((a -> b -> c) -> a -> b -> c) -> a -> b -> c
    • Perhaps you meant one of these:
        ‘fix1’ (line 76), ‘fix2’ (line 80), ‘fix3’ (line 84)
   |
80 | fix2 x y f = fix f x y
   |              ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:84:16: error:
    • Variable not in scope:
        fix :: ((a -> b -> c -> d) -> a -> b -> c -> d) -> a -> b -> c -> d
    • Perhaps you meant one of these:
        ‘fix1’ (line 76), ‘fix2’ (line 80), ‘fix3’ (line 84)
   |
84 | fix3 x y z f = fix f x y z
   |                ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:113:32: error:
    • Variable not in scope:
        (<$!>) :: (Text -> Text) -> Maybe Text -> Maybe Text
    • Perhaps you meant ‘<$>’ (imported from Prelude)
    |
113 | maybeSmartSlice text slice = f <$!> maybeThinSlice text slice where
    |                                ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:169:11: error:
    • Variable not in scope:
        fix
          :: ((Stream b m a1 -> Stream c m a1)
              -> Stream b m a1 -> Stream c m a1)
             -> Stream b m a -> Stream c m a
    • Perhaps you meant one of these:
        ‘fix1’ (line 76), ‘fix2’ (line 80), ‘fix3’ (line 84)
    |
169 | mapMS f = fix $ \go -> \case
    |           ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:179:26: error:
    • Variable not in scope:
        fix
          :: ((Stream a0 IO Void -> [a0]) -> Stream a0 IO Void -> [a0])
             -> Stream b IO Void -> [b]
    • Perhaps you meant one of these:
        ‘fix1’ (line 76), ‘fix2’ (line 80), ‘fix3’ (line 84)
    |
179 | unsafeLazyStreamToList = fix $ \continue -> \case
    |                          ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:603:13: error:
    • Variable not in scope:
        forM_
          :: [CompileContext -> IO ()]
             -> ((ForeignPtr Pcre2_compile_context -> t4) -> t4) -> IO a13
    • Perhaps you want to add ‘forM_’ to the import list
      in the import of ‘Data.Foldable’
      (src/hs/Text/Regex/Pcre2/Internal.hs:14:1-60).
    |
603 |             forM_ ctxUpds $ \update -> update ctx
    |             ^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:605:13: error:
    Variable not in scope: when :: Bool -> IO () -> IO a12
    |
605 |             when (xtraOpts /= 0) $ withForeignPtr ctx $ \ctxPtr ->
    |             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:608:31: error:
    Variable not in scope:
      forM
        :: Maybe (Int -> IO Bool)
           -> ((t3 -> IO Bool) -> IO (IORef (Maybe a11)))
           -> IO (Maybe (IORef (Maybe SomeException)))
    |
608 |             compileEnvERef <- forM recGuard $ \f -> do
    |                               ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:646:13: error:
    Variable not in scope: when :: Bool -> IO b5 -> IO a20
    |
646 |             when (codePtr == nullPtr) $ do
    |             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:648:17: error:
    • Variable not in scope:
        forM_
          :: Maybe (IORef (Maybe SomeException))
             -> (IORef a17 -> IO a17) -> t6
    • Perhaps you want to add ‘forM_’ to the import list
      in the import of ‘Data.Foldable’
      (src/hs/Text/Regex/Pcre2/Internal.hs:14:1-60).
    |
648 |                 forM_ compileEnvERef $ readIORef >=> mapM_ throwIO
    |                 ^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:648:50: error:
    • Variable not in scope: (>=>) :: t6 -> (t7 a18 -> IO ()) -> IO a19
    • Perhaps you meant one of these:
        ‘>>’ (imported from Prelude), ‘>>=’ (imported from Prelude),
        ‘>=’ (imported from Prelude)
    |
648 |                 forM_ compileEnvERef $ readIORef >=> mapM_ throwIO
    |                                                  ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:676:13: error:
    • Variable not in scope:
        forM_
          :: [MatchContext -> IO ()]
             -> ((ForeignPtr Pcre2_match_context -> t5) -> t5) -> IO a14
    • Perhaps you want to add ‘forM_’ to the import list
      in the import of ‘Data.Foldable’
      (src/hs/Text/Regex/Pcre2/Internal.hs:14:1-60).
    |
676 |             forM_ ctxUpds $ \update -> update ctx
    |             ^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:714:13: error:
    Variable not in scope:
      when
        :: Bool -> Stream b7 m2 a24 -> Stream (Ptr Pcre2_match_data) IO a25
    |
714 |             when (result == pcre2_ERROR_NOMATCH) StreamStop
    |             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:715:13: error:
    Variable not in scope:
      when :: Bool -> m1 () -> Stream (Ptr Pcre2_match_data) IO a23
    |
715 |             when (result == pcre2_ERROR_CALLOUT) $
    |             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:729:13: error:
    Variable not in scope:
      when
        :: Bool -> Stream b6 m0 a21 -> Stream (Ptr Pcre2_match_data) IO a22
    |
729 |             when (nextOff > fromIntegral subjCUs) StreamStop
    |             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:861:9: error:
    • Variable not in scope:
        forM_
          :: Maybe (CalloutInfo -> IO CalloutResult)
             -> ((CalloutInfo -> IO CalloutResult) -> IO ()) -> IO a16
    • Perhaps you want to add ‘forM_’ to the import list
      in the import of ‘Data.Foldable’
      (src/hs/Text/Regex/Pcre2/Internal.hs:14:1-60).
    |
861 |         forM_ matchEnvCallout $ \f -> do
    |         ^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:877:9: error:
    • Variable not in scope:
        forM_
          :: Maybe (SubCalloutInfo -> IO SubCalloutResult)
             -> ((SubCalloutInfo -> IO SubCalloutResult) -> IO ()) -> IO a15
    • Perhaps you want to add ‘forM_’ to the import list
      in the import of ‘Data.Foldable’
      (src/hs/Text/Regex/Pcre2/Internal.hs:14:1-60).
    |
877 |         forM_ matchEnvSubCallout $ \f -> do
    |         ^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:932:24: error:
    • Variable not in scope:
        liftM2
          :: (Int -> Int -> CalloutIndex)
             -> IO b3 -> IO b4 -> IO CalloutIndex
    • Perhaps you meant one of these:
        ‘liftIO’ (imported from Control.Monad.State.Strict),
        ‘lift’ (imported from Control.Monad.State.Strict)
    |
932 |                 255 -> liftM2 CalloutAuto pattPos itemLen where
    |                        ^^^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:946:9: error:
    Variable not in scope:
      forM
        :: NonEmpty a10
           -> (Int -> IO (Maybe Text)) -> IO (NonEmpty (Maybe Text))
    |
946 |         forM (0 :| [1 .. fromIntegral top - 1]) $ \n -> do
    |         ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:947:29: error:
    Variable not in scope:
      forM :: [a8] -> (Int -> IO PCRE2_SIZE) -> IO [a9]
    |
947 |             [start, end] <- forM [0, 1] $ \i -> peekElemOff ovecPtr $ n * 2 + i
    |                             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:983:9: error:
    Variable not in scope:
      forM
        :: NonEmpty a7
           -> (Int -> IO (Maybe Text)) -> IO (NonEmpty (Maybe Text))
    |
983 |         forM (0 :| [1 .. fromIntegral ovecCount - 1]) $ \n -> do
    |         ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:984:29: error:
    Variable not in scope:
      forM :: [a5] -> (Int -> IO PCRE2_SIZE) -> IO [a6]
    |
984 |             [start, end] <- forM [0, 1] $ \i -> peekElemOff ovecPtr $ n * 2 + i
    |                             ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:992:25: error:
    Variable not in scope:
      forM :: [a3] -> (Int -> IO PCRE2_SIZE) -> IO [a4]
    |
992 |         [start, end] <- forM [0, 1] $ peekElemOff offsetsPtr
    |                         ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1001:34: error:
    • Variable not in scope:
        (>=>)
          :: (t2 (IORef b2) -> IO ())
             -> (CalloutState -> IO ()) -> Maybe (IORef CalloutState) -> IO ()
    • Perhaps you meant one of these:
        ‘>>’ (imported from Prelude), ‘>>=’ (imported from Prelude),
        ‘>=’ (imported from Prelude)
     |
1001 | maybeRethrow = mapM_ $ readIORef >=> mapM_ throwIO . calloutStateException
     |                                  ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1019:26: error:
    • Variable not in scope:
        (>=>)
          :: FromMatch t
             -> (t0 Slice -> IO (t0 (Slice, Text)))
             -> Ptr Pcre2_match_data
             -> IO b
    • Perhaps you meant one of these:
        ‘>>’ (imported from Prelude), ‘>>=’ (imported from Prelude),
        ‘>=’ (imported from Prelude)
     |
1019 |         mapMS (fromMatch >=> mapM enrichWithCapture) $ matcher subject
     |                          ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1066:5: error:
    Variable not in scope:
      forM :: t Int -> (Int -> IO Slice) -> IO (t Slice)
     |
1066 |     forM whitelist $ \i -> Slice
     |     ^^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1225:35: error:
    • Variable not in scope:
        (>=>)
          :: (SomeException -> Maybe e1)
             -> (SomePcre2Exception -> Maybe b1)
             -> SomeException
             -> Maybe Pcre2Exception
    • Perhaps you meant one of these:
        ‘>>’ (imported from Prelude), ‘>>=’ (imported from Prelude),
        ‘>=’ (imported from Prelude)
     |
1225 |     fromException = fromException >=> \(SomePcre2Exception e) -> cast e
     |                                   ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1254:35: error:
    • Variable not in scope:
        (>=>)
          :: (SomeException -> Maybe e0)
             -> (SomePcre2Exception -> Maybe b0)
             -> SomeException
             -> Maybe Pcre2CompileException
    • Perhaps you meant one of these:
        ‘>>’ (imported from Prelude), ‘>>=’ (imported from Prelude),
        ‘>=’ (imported from Prelude)
     |
1254 |     fromException = fromException >=> \(SomePcre2Exception e) -> cast e
     |                                   ^^^

src/hs/Text/Regex/Pcre2/Internal.hs:1267:11: error:
    Variable not in scope: unless :: Bool -> IO a2 -> IO ()
     |
1267 | check p = unless . p <*> throwIO . Pcre2Exception
     |           ^^^^^^
sjshuck commented 2 years ago

Thanks @sjakobi . I created this issue in microlens which will block us from being able to run tests. But I can certainly work on future-proofing now.

sjshuck commented 2 years ago

Okay, microlens is not actually a blocker (thanks for the clarification @sjakobi). But now this is blocking benchmarks from building: https://github.com/simonmar/monad-par/issues/74 I would say the actual build failures above are resolved now, but this issue can stay open until all targets (library, tests, benchmarks) can be built against mtl-2.3.

sjshuck commented 2 years ago

pcre2-2.1.1.1 is released.

sjakobi commented 2 years ago

But now this is blocking benchmarks from building: simonmar/monad-par#74

The latest version of statistics doesn't use monad-par anymore. With that version you get a valid build plan for criterion with mtl-2.3.

sjshuck commented 2 years ago

LOL alright, thanks for the assistance and sorry if I'm making this more trouble than it needs to be. I'll continue to work on this as soon as I can.

sjakobi commented 2 years ago

No worries, @sjshuck. There's no need to hurry. And FYI, for discovering build plans, cabal's dependency solver is pretty useful. stack doesn't have such a feature.