Skip to content

Attempt to update library to 2024#36

Draft
flip111 wants to merge 4 commits intomyuon:masterfrom
flip111:2024
Draft

Attempt to update library to 2024#36
flip111 wants to merge 4 commits intomyuon:masterfrom
flip111:2024

Conversation

@flip111
Copy link

@flip111 flip111 commented Nov 24, 2024

I'm giving up working on this for the moment. I wanted to post it in case somebody else likes to continue. These errors are left

ghc-compiler-notes/src/GHC/Compiler/Notes/App.hs:98:1: error: [GHC-39999]
    • Could not deduce ‘Capability.Source.Internal.Class.HasSource
                          "AppContext" AppContext (AppT m)’
        arising from the superclasses of an instance declaration
      from the context: Monad m
        bound by the instance declaration
        at src/GHC/Compiler/Notes/App.hs:(98,1)-(100,64)
    • In the instance declaration for
        ‘HasReader "AppContext" AppContext (AppT m)’
   |
98 | deriving
   | ^^^^^^^^...

ghc-compiler-notes/src/GHC/Compiler/Notes/App.hs:102:1: error: [GHC-39999]
    • Could not deduce ‘Capability.Source.Internal.Class.HasSource
                          "envSession" Session.DynFlags (AppT m)’
        arising from the superclasses of an instance declaration
      from the context: Monad m
        bound by the instance declaration
        at src/GHC/Compiler/Notes/App.hs:(102,1)-(104,70)
    • In the instance declaration for
        ‘HasReader "envSession" Session.DynFlags (AppT m)’
    |
102 | deriving
    | ^^^^^^^^...
[ 6 of 10] Compiling GHC.Compiler.Utils.Lexer

ghc-compiler-notes/src/GHC/Compiler/Utils/Lexer.hs:34:25: error:
    • The constructor ‘PFailed’ should have 1 argument, but has been given 3
    • In the pattern: PFailed _ s d
      In an equation for ‘fromParseResult’:
          fromParseResult dflags (PFailed _ s d)
            = Left $ ParseFailed [(s, Outputable.runSDoc d ctx)]
            where
                ctx
                  = Session.initSDocContext dflags
                      $ Outputable.defaultErrStyle dflags
   |
34 | fromParseResult dflags (PFailed _ s d) = Left $ ParseFailed [(s, Outputable.runSDoc d ctx)]
   |                         ^^^^^^^^^^^^^

ghc-compiler-notes/src/GHC/Compiler/Utils/Lexer.hs:44:30: error: [GHC-83865]
    • Couldn't match a lifted type with an unlifted type
      Expected kind ‘*’,
        but ‘ParseResult a0’ has kind ‘TYPE
                                         (ghc-prim-0.10.0:GHC.Types.SumRep
                                            [ghc-prim-0.10.0:GHC.Types.TupleRep
                                               [ghc-prim-0.10.0:GHC.Types.LiftedRep,
                                                ghc-prim-0.10.0:GHC.Types.LiftedRep],
                                             ghc-prim-0.10.0:GHC.Types.LiftedRep])’
    • In the first argument of ‘($)’, namely ‘fromPR’
      In the expression:
        fromPR $ Lexer.unP p $ Lexer.initParserState opts buf loc
      In an equation for ‘runParser’:
          runParser p dflags buf loc
            = fromPR $ Lexer.unP p $ Lexer.initParserState opts buf loc
            where
                opts
                  = initParserOpts (dflags `Session.gopt_set` Session.Opt_Haddock)
                fromPR = fromParseResult dflags
   |
44 | runParser p dflags buf loc = fromPR $ Lexer.unP p $ Lexer.initParserState opts buf loc
   |                              ^^^^^^

@hellwolf
Copy link

it looks to me that you need to define instances of HasSource , perhaps due to capability package is updated.

@hellwolf
Copy link

@flip111
Copy link
Author

flip111 commented Nov 24, 2024

it looks to me that you need to define instances of HasSource , perhaps due to capability package is updated.

yes it's right that package has been updated
before: https://hackage.haskell.org/package/capability-0.1.0.0/docs/Capability-Reader.html#t:HasReader
after: https://hackage.haskell.org/package/capability-0.5.0.1/docs/Capability-Reader.html#t:HasReader

also PFailed also need to be updated

yes it needs to be updated. You are linking to the wrong docs though. The upgrade goes from this https://hackage.haskell.org/package/ghc-8.6.4/docs/Lexer.html#t:ParseResult to this https://hackage.haskell.org/package/ghc-9.6.6/docs/GHC-Parser-Lexer.html#v:PFailed By changing that other types and functions in the program need to be adjusted as well

@flip111
Copy link
Author

flip111 commented Nov 24, 2024

ghc-compiler-notes/src/GHC/Compiler/Utils/Lexer.hs:64:30: error: [GHC-83865]
    • Couldn't match a lifted type with an unlifted type
      Expected kind ‘*’,
        but ‘ParseResult a0’ has kind ‘TYPE
                                         (ghc-prim-0.10.0:GHC.Types.SumRep
                                            [ghc-prim-0.10.0:GHC.Types.TupleRep
                                               [ghc-prim-0.10.0:GHC.Types.LiftedRep,
                                                ghc-prim-0.10.0:GHC.Types.LiftedRep],
                                             ghc-prim-0.10.0:GHC.Types.LiftedRep])’
    • In the first argument of ‘($)’, namely ‘fromParseResult’
      In the expression:
        fromParseResult $ Lexer.unP p $ Lexer.initParserState opts buf loc
      In an equation for ‘runParser’:
          runParser p dflags buf loc
            = fromParseResult
                $ Lexer.unP p $ Lexer.initParserState opts buf loc
            where
                opts
                  = initParserOpts (dflags `Session.gopt_set` Session.Opt_Haddock)
   |
64 | runParser p dflags buf loc = fromParseResult $ Lexer.unP p $ Lexer.initParserState opts buf loc
   |                              ^^^^^^^^^^^^^^^

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants