Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] LTS 21.10 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[DRAFT] LTS 21.10 #4

wants to merge 1 commit into from

Conversation

flip111
Copy link

@flip111 flip111 commented Sep 8, 2023

Try to upgrade to the latest versions of ghc, stack etc. It doesn't compile, but useful to see what is still missing to do the upgrade. Addresses #3

Building all executables for fix-imports once. After a successful build of all of them, only specified executables will be rebuilt.
fix-imports> build (exe)
Preprocessing executable 'fix-imports' for fix-imports-3.0.0..
Building executable 'fix-imports' for fix-imports-3.0.0..
[ 4 of 10] Compiling FixImports.Parse

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:73:9: error:
    • Expecting a lifted type, but
      ‘Lexer.ParseResult (SrcLoc.GenLocated l0 Module)’ is unlifted
    • In the first argument of ‘($)’, namely
        ‘extractParseResult dynFlags’
      In the second argument of ‘($)’, namely
        ‘extractParseResult dynFlags
           $ Parser.parseFile filename dynFlags src’
      In the expression:
        return
          $ extractParseResult dynFlags
              $ Parser.parseFile filename dynFlags src
   |
73 |         extractParseResult dynFlags $ Parser.parseFile filename dynFlags src
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:98:47: error:
    • Couldn't match expected type: Maybe [Annotation.LEpaComment]
                  with actual type: GHC.Data.Strict.Maybe [Annotation.LEpaComment]
      NB: ‘Maybe’ is defined in ‘GHC.Maybe’ in package ‘base-4.17.2.0’
          ‘GHC.Data.Strict.Maybe’
            is defined in ‘GHC.Data.Strict’
                in package ‘ghc-lib-parser-9.4.7.20230826’
    • In the third argument of ‘maybe’, namely
        ‘(Lexer.header_comments state)’
      In the first argument of ‘(++)’, namely
        ‘maybe [] (map extractComment) (Lexer.header_comments state)’
      In the second argument of ‘(++)’, namely
        ‘maybe [] (map extractComment) (Lexer.header_comments state)
           ++ importComments (SrcLoc.unLoc val)’
   |
98 |             ++ maybe [] (map extractComment) (Lexer.header_comments state)
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:110:15: error:
    • Couldn't match expected type: Bag.Bag (Error.MsgEnvelope e0)
                  with actual type: (a, b)
    • In the pattern: (warns, errors)
      In a pattern binding: (warns, errors) = Error.getMessages state
      In a \case alternative:
          Lexer.PFailed state
            -> Left
                 $ unlines
                     $ concat
                         [map (("warn: " <>) . show . Warnings.pprWarningTxtForMsg)
                            $ Bag.bagToList warns,
                          map (("error: " <>) . show . Warnings.pprWarningTxtForMsg)
                            $ Bag.bagToList errors]
            where
                (warns, errors) = Error.getMessages state
    |
110 |         where (warns, errors) = Error.getMessages state
    |               ^^^^^^^^^^^^^^^

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:110:51: error:
    • Couldn't match expected type ‘Error.Messages e0’
                  with actual type ‘Lexer.PState’
    • In the first argument of ‘Error.getMessages’, namely ‘state’
      In the expression: Error.getMessages state
      In a pattern binding: (warns, errors) = Error.getMessages state
    |
110 |         where (warns, errors) = Error.getMessages state
    |                                                   ^^^^^

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:116:43: error:
    • Couldn't match type ‘Hs.HsDocString’ with ‘[Char]’
      Expected: String
        Actual: Hs.HsDocString
    • In the expression: s
      In a case alternative: Annotation.EpaDocComment s -> s
      In the second argument of ‘($)’, namely
        ‘case Annotation.ac_tok (SrcLoc.unLoc cmt) of
           Annotation.EpaDocComment s -> s
           Annotation.EpaDocOptions s -> s
           Annotation.EpaLineComment s -> s
           Annotation.EpaBlockComment s -> s
           Annotation.EpaEofComment -> ""’
    |
116 |             Annotation.EpaDocComment s -> s
    |                                           ^

/home/flip111/fix-imports_flip111-2/src/FixImports/Parse.hs:206:9: error:
    • Couldn't match type ‘GHC.Types.PkgQual.RawPkgQual’
                     with ‘Maybe SourceText.StringLiteral’
      Expected: Maybe SourceText.StringLiteral
        Actual: Hs.ImportDeclPkgQual Hs.GhcPs
    • In the second argument of ‘(<$>)’, namely ‘Hs.ideclPkgQual decl’
      In the ‘_importPkgQualifier’ field of a record
      In the expression:
        Types.Import
          {_importName = Types.ModuleName
                           $ Name.moduleNameString $ SrcLoc.unLoc $ Hs.ideclName decl,
           _importPkgQualifier = FastString.unpackFS . SourceText.sl_fs
                                   <$> Hs.ideclPkgQual decl,
           _importIsBoot = Hs.ideclSource decl == Unit.Types.IsBoot,
           _importSafe = Hs.ideclSafe decl,
           _importQualified = Hs.ideclQualified decl /= Hs.NotQualified,
           _importAs = Types.Qualification
                         . Name.moduleNameString . SrcLoc.unLoc
                         <$> Hs.ideclAs decl,
           _importHiding = maybe False fst $ Hs.ideclHiding decl,
           _importEntities = map (extractEntity . SrcLoc.unLoc)
                               . SrcLoc.unLoc . snd
                               <$> Hs.ideclHiding decl,
           _importSpan = extractSrcSpan
                           $ Annotation.locA $ SrcLoc.getLoc locDecl}
    |
206 |         Hs.ideclPkgQual decl
    |         ^^^^^^^^^^^^^^^^^^^^

Error: [S-7282]
       Stack failed to execute the build plan.
       
       While executing the build plan, Stack encountered the error:
       
       [S-7011]
       While building package fix-imports-3.0.0 (scroll up to its section to see the error) using:
       /home/philippe/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.6 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.8.1.0 build exe:fix-imports --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1 

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.

1 participant