hint icon indicating copy to clipboard operation
hint copied to clipboard

GHC 9.5 compatibility

Open Zalastax opened this issue 3 years ago • 0 comments

hint isn't building on GHC master (9.5) which is not yet released. ~~There might be issues on 9.2.3, which is released, but I have not tried yet. I am reporting this already now as https://github.com/tidalcycles/Tidal/pull/898 needs https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8295 which will arrive in 9.2.4.~~ That pull request was merged to 9.5 but has been backported to 9.4.1 and might be backported to 9.2.4. The issues I am seeing are on 9.5.

The error printouts on ghc-9.5.20220623-x86_64-unknown-mingw32 (artifacts) are:

Building library for hint-0.9.0.6..
[ 1 of 19] Compiling Control.Monad.Ghc ( src\Control\Monad\Ghc.hs, dist\build\Control\Monad\Ghc.o )

src\Control\Monad\Ghc.hs:22:1: warning: [-Wunused-imports]
    The qualified import of ‘GHC.Utils.Exception’ is redundant
      except perhaps to import instances from ‘GHC.Utils.Exception’
    To import instances alone, use: import GHC.Utils.Exception()
   |
22 | import qualified GHC.Utils.Exception as GHC
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\Control\Monad\Ghc.hs:38:3: warning: [-Wnoncanonical-monad-instances]
    Noncanonical ‘pure = return’ definition detected
    in the instance declaration for ‘Applicative (GhcT m)’.
    Move definition from ‘return’ to ‘pure’
    See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return
   |
38 |   pure  = return
   |   ^^^^^^^^^^^^^^
[ 2 of 19] Compiling Hint.CompatPlatform ( src\Hint\CompatPlatform.hs, dist\build\Hint\CompatPlatform.o )

src\Hint\CompatPlatform.hs:25:1: warning: [-Wunsupported-calling-conventions]
    • the 'stdcall' calling convention is unsupported on this platform,
      treating as ccall
    • When checking declaration:
        foreign import stdcall unsafe "winbase.h GetCurrentProcessId" c_GetCurrentProcessId
          :: IO Word32
   |
25 | foreign import stdcall unsafe "winbase.h GetCurrentProcessId"
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
[ 3 of 19] Compiling Hint.GHC         ( src\Hint\GHC.hs, dist\build\Hint\GHC.o )

src\Hint\GHC.hs:47:36: error:
    Module ‘GHC.Types.TyThing.Ppr’ does not export ‘pprTypeForUser’
   |
47 | import GHC.Types.TyThing.Ppr as X (pprTypeForUser)
   |                                    ^^^^^^^^^^^^^^

src\Hint\GHC.hs:83:61: error:
    Module ‘GHC.Driver.Session’ does not export ‘WarnReason’
   |
83 | import GHC.Driver.Session as X (xFlags, xopt, FlagSpec(..), WarnReason(NoReason))
   |                                                             ^^^^^^^^^^^^^^^^^^^^

src\Hint\GHC.hs:133:48: error:
    Module ‘GHC.Parser.Errors.Ppr’ does not export ‘pprError’
    |
133 | import qualified GHC.Parser.Errors.Ppr as GHC (pprError)
    |                                                ^^^^^^^^

src\Hint\GHC.hs:134:43: error:
    Module ‘GHC.Parser.Lexer’ does not export ‘getErrorMessages’
    |
134 | import qualified GHC.Parser.Lexer as GHC (getErrorMessages)
    |                                           ^^^^^^^^^^^^^^^^

src\Hint\GHC.hs:135:42: error:
    Module ‘GHC.Types.Error’ does not export ‘ErrorMessages’
    |
135 | import qualified GHC.Types.Error as GHC (ErrorMessages, errMsgDiagnostic, unDecorated)
    |                                          ^^^^^^^^^^^^^
[12 of 19] Compiling Hint.Util        ( src\Hint\Util.hs, dist\build\Hint\Util.o )

I can try to have a go myself, but it might be difficult for me to make the correct changes.

Zalastax avatar Jun 26 '22 20:06 Zalastax