Skip to content

Build failures in lsp with mtl-2.3 #430

Closed

Description

@sjakobi
src/Language/LSP/Server/Processing.hs:47:3: error:
    Variable not in scope:
      join :: m3 (LspT config1 IO ()) -> LspT config IO ()
   |
47 |   join $ liftIO $ atomically $ fmap handleErrors $ runExceptT $ do
   |   ^^^^

src/Language/LSP/Server/Processing.hs:84:100: error:
    • Variable not in scope:
        (<=<)
          :: IO (Maybe a1)
             -> (ExceptT e0 m2 a2 -> m2 (Either e0 a2))
             -> ExceptT ResponseError IO (LanguageContextEnv config)
             -> IO (Maybe (LanguageContextEnv config))
    • Perhaps you meant one of these:
        ‘=<<’ (imported from Prelude), ‘<=’ (imported from Prelude)
   |
84 |   flip E.catch (initializeErrorHandler $ sendResp . makeResponseError (req ^. LSP.id)) $ handleErr <=< runExceptT $ mdo
   |                                                                                                    ^^^

src/Language/LSP/Server/Processing.hs:389:3: error:
    Variable not in scope: join :: m0 (m1 ()) -> LspM config ()
    |
389 |   join $ stateState resVFS $ \(VFSData vfs rm) ->
    |   ^^^^

I've used lens's mtl-2.3 branch for this build:

source-repository-package
    type: git
    location: https://github.com/ekmett/lens.git
    tag: 371a9410cb2876af14b9ac5864b1da420101136c

Since the affected code is already present in v1.0.0.0, I've used my Hackage trustee powers to add bounds mtl < 2.3 to all versions of lsp on Hackage. See e.g. https://hackage.haskell.org/package/lsp-1.4.0.0/revisions/.

Activity

  1. sjakobi commented on May 10, 2022

    @sjakobi
    MemberAuthor
  2. michaelpj commented on May 11, 2022

    @michaelpj
    Collaborator

    Thank you!

  3. sjakobi commented on May 11, 2022

    @sjakobi
    MemberAuthor

    Now that https://github.com/k0ral/conduit-parse/issues/4 is fixed, lsp-test is showing build failures:

    src/Language/LSP/Test/Session.hs:154:19: error:
        • Variable not in scope:
            lift
              :: t0
                 -> ConduitParser
                      FromServerMessage
                      (StateT SessionState (ReaderT SessionContext IO))
                      SessionContext
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    154 |   ask  = Session (lift $ lift Reader.ask)
        |                   ^^^^
    
    src/Language/LSP/Test/Session.hs:154:26: error:
        • Variable not in scope: lift :: ReaderT r0 m6 r0 -> t0
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    154 |   ask  = Session (lift $ lift Reader.ask)
        |                          ^^^^
    
    src/Language/LSP/Test/Session.hs:157:9: error:
        • Variable not in scope:
            lift :: t1 -> ConduitM a b (StateT s (ReaderT r m)) r
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    157 |   ask = lift $ lift Reader.ask
        |         ^^^^
    
    src/Language/LSP/Test/Session.hs:157:16: error:
        • Variable not in scope: lift :: ReaderT r1 m7 r1 -> t1
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    157 |   ask = lift $ lift Reader.ask
        |                ^^^^
    
    src/Language/LSP/Test/Session.hs:197:18: error:
        • Variable not in scope:
            lift
              :: StateT s2 m4 s2
                 -> ConduitParser
                      FromServerMessage
                      (StateT SessionState (ReaderT SessionContext IO))
                      SessionState
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    197 |   get = Session (lift State.get)
        |                  ^^^^
    
    src/Language/LSP/Test/Session.hs:198:19: error:
        • Variable not in scope:
            lift
              :: StateT SessionState m5 ()
                 -> ConduitParser
                      FromServerMessage
                      (StateT SessionState (ReaderT SessionContext IO))
                      ()
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    198 |   put = Session . lift . State.put
        |                   ^^^^
    
    src/Language/LSP/Test/Session.hs:206:9: error:
        • Variable not in scope: lift :: m2 s1 -> ConduitM a b m s
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    206 |   get = lift get
        |         ^^^^
    
    src/Language/LSP/Test/Session.hs:207:9: error:
        • Variable not in scope: lift :: m3 () -> ConduitM a b m ()
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    207 |   put = lift . put
        |         ^^^^
    
    src/Language/LSP/Test/Session.hs:211:9: error:
        • Variable not in scope: lift :: m0 s0 -> ConduitParser a m s
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    211 |   get = lift get
        |         ^^^^
    
    src/Language/LSP/Test/Session.hs:212:9: error:
        • Variable not in scope: lift :: m1 () -> ConduitParser a m ()
        • Perhaps you meant one of these:
            ‘liftM’ (imported from Control.Monad),
            ‘liftA’ (imported from Control.Applicative)
        |
    212 |   put = lift . put
        |         ^^^^
    

    Since this code is already present in the earliest releases of lsp-test, I've revised them all. See e.g. https://hackage.haskell.org/package/lsp-test-0.14.0.2/revisions/.

  4. michaelpj commented on May 17, 2022

    @michaelpj
    Collaborator

    I've merged a fix that builds with both versions of mtl, so we should be good. I'll try and do a release shortly.

  5. sjakobi commented on May 17, 2022

    @sjakobi
    MemberAuthor

    If possible, it would be nice if the new releases were compatible with transformers-0.6 too.

  6. michaelpj commented on May 17, 2022

    @michaelpj
    Collaborator

    Thanks, for some reason I thought mtl >= 2.3 would force the new transformers too. I'll look into that.

  7. sjakobi commented on May 17, 2022

    @sjakobi
    MemberAuthor

    Thanks, for some reason I thought mtl >= 2.3 would force the new transformers too.

    It's the other way round: transformers >= 0.6 will force mtl >= 2.3.

  8. michaelpj commented on May 17, 2022

    @michaelpj
    Collaborator

    No build failures with transformers >= 0.6, although I needed allow-newer: safe-exceptions:transformers if you're chasing these things.

  9. sjakobi commented on May 20, 2022

    @sjakobi
    MemberAuthor

    FYI: I just tried building dhall-lsp-server with lsp master, and encountered a build error for which I found no explanation in the changelogs:

    src/Dhall/LSP/Handlers.hs:94:60: error:
        • Couldn't match expected type ‘Rope.Rope’
                      with actual type ‘text-rope-0.1:Data.Text.Utf16.Rope.Rope’
          NB: ‘text-rope-0.1:Data.Text.Utf16.Rope.Rope’
                is defined in ‘Data.Text.Utf16.Rope’ in package ‘text-rope-0.1’
              ‘Rope.Rope’
                is defined in ‘Data.Rope.UTF16.Internal’
                    in package ‘rope-utf16-splay-0.3.2.0’
        • In the first argument of ‘Rope.toText’, namely ‘rope’
          In the first argument of ‘return’, namely ‘(Rope.toText rope)’
          In the expression: return (Rope.toText rope)
       |
    94 |     Just (LSP.VirtualFile _ _ rope) -> return (Rope.toText rope)
       |                                                            ^^^^
    
  10. michaelpj commented on May 20, 2022

    @michaelpj
    Collaborator

    Yes, there are breaking changes on master. I will create a changelog when I do the release.

  11. sjakobi commented on Jun 5, 2022

    @sjakobi
    MemberAuthor

    Ping! A release would be nice! :)

  12. michaelpj commented on Jun 20, 2022

    @michaelpj
    Collaborator

    Released! Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions