on master help sign in
now able to build with GHC 8.2.1 using:

cabal new-build -w /opt/ghc/8.2.1/bin/ghc --allow-newer=distributed-process distributed-process-async is now the only module holding us back

commit6d89443c67f6b9d7da510274da432e25fab4745f authorAgentM <agentm@themactionfaction.com> dateMon 16 Oct 2017, 22:57 (9 years ago) parent038a30e
9 files changed+41−13
project-m36.cabal+3−2 src/bin/ProjectM36/Server/WebSocket/websocket-server.hs+1−1 src/lib/ProjectM36/Atomable.hs+1−1 src/lib/ProjectM36/Client.hs+5−4 src/lib/ProjectM36/ScriptSession.hs+26−1 src/lib/ProjectM36/Server.hs+1−1 src/lib/ProjectM36/Sessions.hs+2−1 test/Server/Main.hs+1−1 test/Server/WebSocket.hs+1−1
project-m36.cabal+3−2
@@ -71,10 +71,10 @@ Library
7171 ,http-api-data
7272--needed for remote access
7373 ,distributed-process-client-server >= 0.2.3
74− ,distributed-process >= 0.6.6
74+ ,distributed-process >= 0.7.3
7575 ,distributed-process-extras >= 0.3.2
7676 ,distributed-process-async >= 0.2.4
77− ,network-transport-tcp
77+ ,network-transport-tcp >= 0.6.0
7878 ,network-transport
7979 ,list-t
8080 ,stm-containers >= 0.2.15
@@ -484,6 +484,7 @@ Test-Suite test-transactiongraph-automerge
484484 type: exitcode-stdio-1.0
485485 main-is: test/TransactionGraph/Automerge.hs
486486 Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, megaparsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, websockets, optparse-applicative, network, aeson, project-m36, random, MonadRandom, semigroups
487+ Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.SchemaOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
487488 Default-Extensions: OverloadedStrings
488489 GHC-Options: -Wall
489490 Hs-Source-Dirs: ./src/bin, ., test/
src/bin/ProjectM36/Server/WebSocket/websocket-server.hs+1−1
@@ -4,7 +4,7 @@ import ProjectM36.Server.ParseArgs
44import ProjectM36.Server
55import Control.Concurrent
66import qualified Network.WebSockets as WS
7−import Network.Transport.TCP (decodeEndPointAddress)
7+import Network.Transport.TCP.Internal (decodeEndPointAddress)
88import Control.Exception
99
1010main :: IO ()
src/lib/ProjectM36/Atomable.hs+1−1
@@ -52,7 +52,7 @@ class (Eq a, NFData a, Binary a, Show a) => Atomable a where
5252 toAtomType _ = toAtomTypeG (from (undefined :: a))
5353
5454 -- | Creates DatabaseContextExpr necessary to load the type constructor and data constructor into the database.
55− toAddTypeExpr :: Proxy a -> DatabaseContextExpr
55+ toAddTypeExpr :: proxy a -> DatabaseContextExpr
5656 default toAddTypeExpr :: (Generic a, AtomableG (Rep a)) => proxy a -> DatabaseContextExpr
5757 toAddTypeExpr _ = toAddTypeExprG (from (undefined :: a)) (toAtomType (Proxy :: Proxy a))
5858
src/lib/ProjectM36/Client.hs+5−4
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveAnyClass, DeriveGeneric, ScopedTypeVariables, BangPatterns #-}
1+{-# LANGUAGE DeriveAnyClass, DeriveGeneric, ScopedTypeVariables, BangPatterns, PackageImports #-}
22{-|
33Module: ProjectM36.Client
44
@@ -125,7 +125,8 @@ import Control.Exception.Base
125125import GHC.Conc.Sync
126126
127127import Network.Transport (Transport(closeTransport))
128−import Network.Transport.TCP (createTransport, defaultTCPParameters, encodeEndPointAddress)
128+import Network.Transport.TCP.Internal (encodeEndPointAddress)
129+import Network.Transport.TCP (createTransport, defaultTCPParameters)
129130import Control.Distributed.Process.Node (newLocalNode, initRemoteTable, runProcess, LocalNode, forkProcess, closeLocalNode)
130131import Control.Distributed.Process.Extras.Internal.Types (whereisRemote)
131132import Control.Distributed.Process.ManagedProcess.Client (call, safeCall)
@@ -142,7 +143,7 @@ import qualified STMContainers.Set as STMSet
142143import qualified ProjectM36.Session as Sess
143144import ProjectM36.Session
144145import ProjectM36.Sessions
145−import ListT
146+import "list-t" ListT
146147import Data.Binary (Binary)
147148import GHC.Generics (Generic)
148149import Control.DeepSeq (force)
@@ -249,7 +250,7 @@ remoteDBLookupName = (++) "db-"
249250
250251createLocalNode :: IO (LocalNode, Transport)
251252createLocalNode = do
252− eLocalTransport <- createTransport "127.0.0.1" "0" defaultTCPParameters
253+ eLocalTransport <- createTransport "127.0.0.1" "0" (\sn -> ("127.0.0.1",sn)) defaultTCPParameters
253254 case eLocalTransport of
254255 Left err -> error ("failed to create transport: " ++ show err)
255256 Right localTransport -> do
src/lib/ProjectM36/ScriptSession.hs+26−1
@@ -17,12 +17,19 @@ import GHC.Paths (libdir)
1717#if __GLASGOW_HASKELL__ >= 800
1818import GHC.LanguageExtensions
1919#endif
20+#if __GLASGOW_HASKELL__ >= 802
21+import BasicTypes
22+#endif
2023import DynFlags
2124import Panic
2225import Outputable --hiding ((<>))
2326import PprTyThing
2427import Unsafe.Coerce
28+#if __GLASGOW_HASKELL__ >= 802
29+import Type
30+#else
2531import Type hiding (pprTyThing)
32+#endif
2633
2734data ScriptSession = ScriptSession {
2835 hscEnv :: HscEnv,
@@ -62,7 +69,12 @@ initScriptSession ghcPkgPaths = do
6269 trustFlags = map TrustPackage required_packages,
6370#endif
6471 packageFlags = packageFlags dflags ++ packages,
72+#if __GLASGOW_HASKELL__ >= 802
73+ packageDBFlags = map PackageDB localPkgPaths
74+#else
6575 extraPkgConfs = const (localPkgPaths ++ [UserPkgConf, GlobalPkgConf])
76+#endif
77+
6678 }
6779 applyGopts flags = foldl gopt_set flags gopts
6880 applyXopts flags = foldl xopt_set flags xopts
@@ -94,7 +106,11 @@ initScriptSession ghcPkgPaths = do
94106 --liftIO $ traceShowM (showSDoc dflags' (ppr packages))
95107 _ <- setSessionDynFlags dflags'
96108 let safeImportDecl mn mQual = ImportDecl {
109+#if __GLASGOW_HASKELL__ >= 802
110+ ideclSourceSrc = NoSourceText,
111+#else
97112 ideclSourceSrc = Nothing,
113+#endif
98114 ideclName = noLoc mn,
99115 ideclPkgQual = Nothing,
100116 ideclSource = False,
@@ -116,7 +132,12 @@ initScriptSession ghcPkgPaths = do
116132 "ProjectM36.DatabaseContextFunctionError",
117133 "ProjectM36.DatabaseContextFunctionUtils",
118134 "ProjectM36.RelationalExpression"]
119− qualifiedModules = map (\(modn, qualNam) -> IIDecl $ safeImportDecl (mkModuleName modn) (Just (mkModuleName qualNam))) [
135+#if __GLASGOW_HASKELL__ >= 802
136+ mkModName = noLoc . mkModuleName
137+#else
138+ mkModName = mkModuleName
139+#endif
140+ qualifiedModules = map (\(modn, qualNam) -> IIDecl $ safeImportDecl (mkModuleName modn) (Just (mkModName qualNam))) [
120141 ("Data.Text", "T")
121142 ]
122143 setContext (unqualifiedModules ++ qualifiedModules)
@@ -165,7 +186,11 @@ typeCheckScript :: Type -> Text -> Ghc (Maybe ScriptCompilationError)
165186typeCheckScript expectedType inp = do
166187 dflags <- getSessionDynFlags
167188 --catch exception for SyntaxError
189+#if __GLASGOW_HASKELL__ >= 802
190+ funcType <- GHC.exprType TM_Inst (unpack inp)
191+#else
168192 funcType <- GHC.exprType (unpack inp)
193+#endif
169194 --liftIO $ putStrLn $ showType dflags expectedType ++ ":::" ++ showType dflags funcType
170195 if eqType funcType expectedType then
171196 pure Nothing
src/lib/ProjectM36/Server.hs+1−1
@@ -86,7 +86,7 @@ launchServer daemonConfig mAddressMVar = do
8686 Right conn -> do
8787 let hostname = bindHost daemonConfig
8888 port = bindPort daemonConfig
89− etransport <- createTransport hostname (show port) defaultTCPParameters
89+ etransport <- createTransport hostname (show port) (\sn -> (hostname, sn)) defaultTCPParameters
9090 case etransport of
9191 Left err -> error ("failed to create transport: " ++ show err)
9292 Right transport -> do
src/lib/ProjectM36/Sessions.hs+2−1
@@ -1,7 +1,8 @@
1+{-# LANGUAGE PackageImports #-}
12module ProjectM36.Sessions where
23import Control.Concurrent.STM
34import qualified STMContainers.Map as STMMap
4−import ListT
5+import "list-t" ListT
56import ProjectM36.Attribute
67import ProjectM36.Base
78import ProjectM36.Session
test/Server/Main.hs+1−1
@@ -17,7 +17,7 @@ import System.Exit
1717
1818import Control.Concurrent
1919import Network.Transport (EndPointAddress)
20−import Network.Transport.TCP (encodeEndPointAddress, decodeEndPointAddress)
20+import Network.Transport.TCP.Internal (encodeEndPointAddress, decodeEndPointAddress)
2121import Data.Either (isRight)
2222import Control.Exception
2323--import Control.Monad.IO.Class
test/Server/WebSocket.hs+1−1
@@ -16,7 +16,7 @@ import ProjectM36.Base
1616import qualified Data.Map as M
1717import qualified Data.ByteString.Lazy as BS
1818import ProjectM36.Relation
19−import Network.Transport.TCP (decodeEndPointAddress)
19+import Network.Transport.TCP.Internal (decodeEndPointAddress)
2020
2121--start the websocket server
2222-- run some tutoriald against it