diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 106b8adc8..7f670039c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: versions: - - ghc: '8.6.5' + - ghc: '8.10.7' cabal: '3.4' steps: - uses: actions/checkout@v2 diff --git a/cabal.project b/cabal.project index 9466eccf8..91d2e63b0 100644 --- a/cabal.project +++ b/cabal.project @@ -10,3 +10,6 @@ packages: codeworld-server/ codeworld-base/ funblocks-client/ + +constraints: + ghcjs-dom ==0.9.* diff --git a/codeworld-api/codeworld-api.cabal b/codeworld-api/codeworld-api.cabal index a7f731030..658c38730 100644 --- a/codeworld-api/codeworld-api.cabal +++ b/codeworld-api/codeworld-api.cabal @@ -61,7 +61,7 @@ Library mtl >= 2.2.1 && < 2.3, random >= 1.1 && < 1.2, ref-tf >= 0.4 && < 0.5, - reflex >= 0.6.3 && < 0.7, + reflex >= 0.6.3, template-haskell >= 2.8 && < 2.18, text >= 1.2.2 && < 1.3, time >= 1.8 && < 2.0, @@ -73,7 +73,7 @@ Library ghcjs-prim, codeworld-game-api, codeworld-prediction, - ghcjs-dom >= 0.9 && < 0.9.4, + ghcjs-dom >= 0.9, transformers else Build-depends: blank-canvas >= 0.6 && < 0.8, @@ -122,7 +122,7 @@ Test-suite unit-tests mtl >= 2.2.1 && < 2.3, random >= 1.1 && < 1.2, ref-tf >= 0.4 && < 0.5, - reflex >= 0.6.3 && < 0.7, + reflex >= 0.6.3, template-haskell >= 2.8 && < 2.18, text >= 1.2.2 && < 1.3, time >= 1.8 && < 2.0, @@ -134,7 +134,7 @@ Test-suite unit-tests ghcjs-prim, codeworld-game-api, codeworld-prediction, - ghcjs-dom >= 0.9 && < 0.9.4, + ghcjs-dom >= 0.9, transformers else Build-depends: blank-canvas >= 0.6 && < 0.8, diff --git a/codeworld-base/src/Parameter.hs b/codeworld-base/src/Parameter.hs index cf5e0ae4e..e69d4279e 100644 --- a/codeworld-base/src/Parameter.hs +++ b/codeworld-base/src/Parameter.hs @@ -44,7 +44,7 @@ import qualified CodeWorld.Parameter as CW import Internal.Picture import Internal.Text import Prelude -import "base" Prelude ((.), map) +import "base" Prelude (map, (.)) -- | A drawing that depends on parameters. The first argument is a -- list of parameters. The second is a picture, which depends on the diff --git a/codeworld-compiler/codeworld-compiler.cabal b/codeworld-compiler/codeworld-compiler.cabal index 75ed47614..1868ff44d 100644 --- a/codeworld-compiler/codeworld-compiler.cabal +++ b/codeworld-compiler/codeworld-compiler.cabal @@ -54,16 +54,18 @@ Library directory, exceptions, filepath, - ghc == 8.6.5, - ghc-boot-th == 8.6.5, + ghc == 8.10.*, + ghc-boot, + ghc-boot-th == 8.10.*, + ghc-lib-parser, hashable, haskell-src-exts >= 1.20, megaparsec >= 7.0.0 && < 8.0.0, memory, mtl, process, + regex-base, regex-tdfa, - regex-tdfa-text, split, syb, temporary, diff --git a/codeworld-compiler/src/CodeWorld/Compile/Framework.hs b/codeworld-compiler/src/CodeWorld/Compile/Framework.hs index d7e4d417b..5d1c7bc7c 100644 --- a/codeworld-compiler/src/CodeWorld/Compile/Framework.hs +++ b/codeworld-compiler/src/CodeWorld/Compile/Framework.hs @@ -56,16 +56,22 @@ import qualified "ghc" FastString as GHC import qualified "ghc" Fingerprint as GHC import qualified "ghc-boot-th" GHC.LanguageExtensions.Type as GHC import qualified "ghc" HeaderInfo as GHC -import qualified "ghc" HsExtension as GHC -import qualified "ghc" HsSyn as GHC +import qualified "ghc" GHC.Hs.Extension as GHC +import qualified "ghc" GHC.Hs as GHC +import qualified "ghc" RdrHsSyn as GHC +import qualified "ghc" TcHsSyn as GHC import qualified "ghc" HscTypes as GHC import Language.Haskell.Exts import qualified "ghc" Lexer as GHC +import qualified "ghc" Fingerprint as GHC import qualified "ghc" Module as GHC import qualified "ghc" Outputable as GHC import qualified "ghc" Panic as GHC import qualified "ghc" Parser as GHC -import qualified "ghc" Platform as GHC +import qualified "ghc" GhcNameVersion as GHC +import qualified "ghc" FileSettings as GHC +import qualified "ghc" ToolSettings as GHC +import qualified "ghc-boot" GHC.Platform as GHC import qualified "ghc" SrcLoc as GHC import qualified "ghc" StringBuffer as GHC import System.Directory @@ -305,32 +311,95 @@ ghcParseCode extraExts src = do state = GHC.mkPState dflagsWithPragmas buffer location return $ case GHC.unP GHC.parseModule state of GHC.POk _ (GHC.L _ mod) -> GHCParsed mod - GHC.PFailed _ _ _ -> GHCNoParse + GHC.PFailed _ -> GHCNoParse fakeDynFlags :: GHC.DynFlags fakeDynFlags = GHC.defaultDynFlags fakeSettings fakeLlvmConfig +fakePlatformMisc :: GHC.PlatformMisc +fakePlatformMisc = GHC.PlatformMisc + mempty + mempty + GHC.IntegerSimple + False + False + False + mempty + False + False + False + False + False + False + mempty + +fakeToolSettings :: GHC.ToolSettings +fakeToolSettings = GHC.ToolSettings + True + True + True + True + True + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + (GHC.Fingerprint (read mempty) (read mempty)) + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + mempty + fakeSettings :: GHC.Settings fakeSettings = GHC.Settings - { GHC.sProgramName = "ghcjs", - GHC.sProjectVersion = GHC.cProjectVersion, + { GHC.sGhcNameVersion = GHC.GhcNameVersion "foo" "foo", + GHC.sFileSettings = GHC.FileSettings mempty mempty Nothing mempty mempty mempty, + GHC.sToolSettings = fakeToolSettings, GHC.sTargetPlatform = GHC.Platform - { GHC.platformWordSize = 8, - GHC.platformOS = GHC.OSUnknown, - GHC.platformUnregisterised = True + { GHC.platformWordSize = GHC.PW8, + GHC.platformMini = GHC.PlatformMini GHC.ArchX86_64 GHC.OSUnknown, + GHC.platformUnregisterised = True, + GHC.platformHasGnuNonexecStack = True, + GHC.platformIsCrossCompiling = True, + GHC.platformHasSubsectionsViaSymbols = True }, GHC.sPlatformConstants = GHC.PlatformConstants { GHC.pc_DYNAMIC_BY_DEFAULT = False, GHC.pc_WORD_SIZE = 8 }, - GHC.sOpt_P_fingerprint = GHC.fingerprint0 + GHC.sPlatformMisc = fakePlatformMisc } -fakeLlvmConfig :: (GHC.LlvmTargets, GHC.LlvmPasses) -fakeLlvmConfig = ([], []) +fakeLlvmConfig :: GHC.LlvmConfig +fakeLlvmConfig = GHC.LlvmConfig mempty mempty parsePragmasIntoDynFlags :: GHC.DynFlags -> diff --git a/codeworld-compiler/src/CodeWorld/Compile/Requirements/Eval.hs b/codeworld-compiler/src/CodeWorld/Compile/Requirements/Eval.hs index 4c5ece3db..489c1acd9 100644 --- a/codeworld-compiler/src/CodeWorld/Compile/Requirements/Eval.hs +++ b/codeworld-compiler/src/CodeWorld/Compile/Requirements/Eval.hs @@ -40,7 +40,27 @@ import Data.Hashable import Data.List import qualified Data.Text as T import Data.Void -import "ghc" HsSyn +import "ghc" GHC.Hs + ( GRHS (..), + GRHSs (..), + GhcPs, + GhciLStmt, + HsBind, + HsBindLR (..), + HsExpr (HsApp, HsLet, HsPar, HsVar), + HsModule (..), + ImportDecl, + LHsDecl, + LHsExpr, + LMatch, + Match (..), + MatchGroup (..), + Sig (TypeSig), + pprFunBind, + pprPatBind, + ) +import "ghc" GHC.Hs.Decls +import "ghc" GHC.Hs.Pat import qualified Language.Haskell.Exts as Exts import "ghc" Outputable import "ghc" SrcLoc @@ -192,8 +212,9 @@ checkRule (AllOf rules) = do return (concat <$> results) checkRule (AnyOf rules) = do results <- sequence <$> mapM checkRule rules - return $ (<$> results) $ \errs -> - if any null errs then [] else ["No alternatives succeeded."] + return $ + (<$> results) $ \errs -> + if any null errs then [] else ["No alternatives succeeded."] checkRule (NotThis rule) = do result <- checkRule rule case result of diff --git a/codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs b/codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs index c159b3bab..a3725150b 100644 --- a/codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs +++ b/codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs @@ -26,7 +26,8 @@ import Data.Generics import Data.Generics.Twins import Data.List import Data.Maybe -import "ghc" HsSyn +import "ghc" RdrHsSyn +import "ghc" GHC.Hs import "ghc" OccName import "ghc" RdrName import "ghc" SrcLoc diff --git a/codeworld-compiler/src/CodeWorld/Compile/Stages.hs b/codeworld-compiler/src/CodeWorld/Compile/Stages.hs index 30f3464d7..805d5afde 100644 --- a/codeworld-compiler/src/CodeWorld/Compile/Stages.hs +++ b/codeworld-compiler/src/CodeWorld/Compile/Stages.hs @@ -47,7 +47,7 @@ import Data.Monoid import Data.Text (Text, unpack) import Data.Text.Encoding (decodeUtf8) import qualified "ghc" FastString as GHC -import qualified "ghc" HsSyn as GHC +import qualified "ghc" GHC.Hs as GHC import Language.Haskell.Exts import qualified "ghc" Module as GHC import qualified "ghc" OccName as GHC diff --git a/codeworld-error-sanitizer/codeworld-error-sanitizer.cabal b/codeworld-error-sanitizer/codeworld-error-sanitizer.cabal index 95ad875b1..8940b32f7 100644 --- a/codeworld-error-sanitizer/codeworld-error-sanitizer.cabal +++ b/codeworld-error-sanitizer/codeworld-error-sanitizer.cabal @@ -25,8 +25,7 @@ Library else Build-depends: array, regex-base, - regex-tdfa, - regex-tdfa-text + regex-tdfa Default-language: Haskell2010 Exposed: True @@ -49,7 +48,6 @@ Test-suite unit-tests else Build-depends: array, regex-base, - regex-tdfa, - regex-tdfa-text + regex-tdfa Default-language: Haskell2010 diff --git a/codeworld-requirements/codeworld-requirements.cabal b/codeworld-requirements/codeworld-requirements.cabal index 3337ab1ed..f2c09c324 100644 --- a/codeworld-requirements/codeworld-requirements.cabal +++ b/codeworld-requirements/codeworld-requirements.cabal @@ -36,8 +36,8 @@ library haskell-src-exts >= 1.20, mtl, process, + regex-base, regex-tdfa, - regex-tdfa-text, syb, temporary, text, diff --git a/codeworld-server/codeworld-server.cabal b/codeworld-server/codeworld-server.cabal index 035e6a683..d9cb09fd9 100644 --- a/codeworld-server/codeworld-server.cabal +++ b/codeworld-server/codeworld-server.cabal @@ -39,7 +39,7 @@ Executable codeworld-server fast-logger, filelock, filepath, - haskell-src-exts < 1.21, + haskell-src-exts, http-conduit, lifted-base, memory,