on master help sign in
more GHC 8 munging

support cabal new-build support cabal.project to flag distributed-process-* time,binary allow-newer

commitf5ed8631e6e3c0342570c5d21e9bda714e4bb8f4 authorAgentM <agentm@themactionfaction.com> dateSat 7 Jan 2017, 17:09 (10 years ago) parent7f6d242
6 files changed+31−17
.gitignore+2−1 cabal.project+3 project-m36.cabal+11−10 src/bin/TutorialD/Interpreter/Base.hs+2−1 src/lib/ProjectM36/AtomFunctionBody.hs+12−4 stack.yaml+1−1
.gitignore+2−1
@@ -4,4 +4,5 @@
44dist/
55.cabal-sandbox/
66cabal.sandbox.config
7−.stack-work
7+.stack-work
8+dist-newstyle/
cabal.projectnew file+3
@@ -0,0 +1,3 @@
1+-- this is needed for GHC8 until distributed-process-extras is updated on Hackage with increased upper bounds
2+packages: project-m36.cabal
3+allow-newer: distributed-process-extras:time,distributed-process-extras:binary,distributed-process-client-server:binary,distributed-process-client-server:time,distributed-process-async:time,distributed-process-async:binary
project-m36.cabal+11−10
@@ -148,7 +148,7 @@ Executable tutd
148148 mtl,
149149 uuid,
150150 deepseq-generics,
151− MonadRandom,
151+ MonadRandom, MonadRandom,
152152 vector,
153153 text,
154154 vector-binary-instances,
@@ -168,6 +168,7 @@ Executable tutd
168168--stack is still stuck on megaparsec 4, error-handling has changed in megaparsec 5
169169 megaparsec >= 4.4.0 && < 5.0,
170170 haskeline,
171+ random, MonadRandom,
171172 base64-bytestring,
172173 optparse-applicative,
173174 attoparsec,
@@ -246,7 +247,7 @@ Executable project-m36-server
246247Executable bigrel
247248 Default-Language: Haskell2010
248249 Default-Extensions: OverloadedStrings
249− 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, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36 == 0.1, MonadRandom
250+ 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, optparse-applicative, stm-containers, list-t, ghc, ghc-paths, transformers, project-m36 == 0.1, random, MonadRandom
250251 Other-Modules: TutorialD.Interpreter.Base,
251252 TutorialD.Interpreter.DatabaseContextExpr,
252253 TutorialD.Interpreter.RelationalExpr,
@@ -262,7 +263,7 @@ Test-Suite test-tutoriald
262263 Default-Extensions: OverloadedStrings
263264 type: exitcode-stdio-1.0
264265 main-is: test/TutorialD/Interpreter.hs
265− 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, stm-containers, list-t, project-m36 == 0.1, MonadRandom
266+ 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, stm-containers, list-t, project-m36 == 0.1, random, MonadRandom
266267 Other-Modules: TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator
267268 GHC-Options: -Wall
268269 Hs-Source-Dirs: ./src/bin, ., test
@@ -274,7 +275,7 @@ Test-Suite test-tutoriald-atomfunctionscript
274275 type: exitcode-stdio-1.0
275276 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.TestBase, TutorialD.Interpreter.TransGraphRelationalOperator, TutorialD.Interpreter.TransactionGraphOperator, TutorialD.Interpreter.Types
276277 main-is: test/TutorialD/Interpreter/AtomFunctionScript.hs
277− Build-Depends: base, HUnit, project-m36 == 0.1, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, MonadRandom
278+ Build-Depends: base, HUnit, project-m36 == 0.1, uuid, containers, megaparsec, text, vector, directory, bytestring, mtl, haskeline, random, MonadRandom
278279 GHC-Options: -Wall
279280 Hs-Source-Dirs: ./src/bin, ./test, .
280281 CPP-Options: -DPROJECTM36_VERSION="v0.1"
@@ -301,7 +302,7 @@ Test-Suite test-transactiongraph-persist
301302 Default-Extensions: OverloadedStrings
302303 type: exitcode-stdio-1.0
303304 main-is: test/TransactionGraph/Persist.hs
304− 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, stm-containers, project-m36 == 0.1, MonadRandom
305+ 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, stm-containers, project-m36 == 0.1, random, MonadRandom
305306 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
306307 Hs-Source-Dirs: ., ./src/bin
307308 GHC-Options: -Wall
@@ -320,7 +321,7 @@ Test-Suite test-tutoriald-import-tutoriald
320321 Default-Extensions: OverloadedStrings
321322 type: exitcode-stdio-1.0
322323 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
323− 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, stm-containers, project-m36 == 0.1, MonadRandom
324+ 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, stm-containers, project-m36 == 0.1, random, MonadRandom
324325 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.BasicExamples
325326 GHC-Options: -Wall
326327 Hs-Source-Dirs: ., ./src/bin
@@ -372,7 +373,7 @@ Test-Suite test-server
372373Executable Example-SimpleClient
373374 Default-Language: Haskell2010
374375 Default-Extensions: OverloadedStrings
375− 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, ghc, ghc-paths, project-m36 == 0.1, MonadRandom
376+ 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, ghc, ghc-paths, project-m36 == 0.1, random, MonadRandom
376377 Main-Is: examples/SimpleClient.hs
377378 GHC-Options: -Wall
378379
@@ -391,14 +392,14 @@ Test-Suite test-scripts
391392 Default-Extensions: OverloadedStrings
392393 type: exitcode-stdio-1.0
393394 main-is: test/scripts.hs
394− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, 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, project-m36 == 0.1, MonadRandom
395+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, 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, project-m36 == 0.1, random, MonadRandom
395396 Other-Modules: TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.Import.BasicExamples
396397 GHC-Options: -Wall
397398 Hs-Source-Dirs: ., ./src/bin
398399
399400Executable project-m36-websocket-server
400401 Default-Language: Haskell2010
401− Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, MonadRandom
402+ Build-Depends: base, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template, websockets, aeson, uuid-aeson, optparse-applicative, project-m36 == 0.1, containers, bytestring, text, vector, uuid, megaparsec, haskeline, mtl, directory, base64-bytestring, random, MonadRandom
402403 Main-Is: ProjectM36/Server/WebSocket/websocket-server.hs
403404 Other-Modules: ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, 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.TransactionGraphOperator, TutorialD.Interpreter.Types, TutorialD.Interpreter.TransGraphRelationalOperator
404405 GHC-Options: -Wall
@@ -410,7 +411,7 @@ Test-Suite test-websocket-server
410411 Default-Language: Haskell2010
411412 type: exitcode-stdio-1.0
412413 main-is: test/Server/WebSocket.hs
413− 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, uuid-aeson, project-m36 == 0.1, MonadRandom
414+ 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, uuid-aeson, project-m36 == 0.1, random, MonadRandom
414415 Other-Modules: TutorialD.Interpreter.Export.Base, TutorialD.Interpreter.Export.CSV, TutorialD.Interpreter.Import.BasicExamples, TutorialD.Interpreter.Import.CSV, TutorialD.Interpreter.InformationOperator, TutorialD.Interpreter.RODatabaseContextOperator, TutorialD.Interpreter.TransactionGraphOperator, ProjectM36.Client.Json, ProjectM36.Server.RemoteCallTypes.Json, ProjectM36.Server.WebSocket, TutorialD.Interpreter, TutorialD.Interpreter.Base, TutorialD.Interpreter.DatabaseContextExpr, TutorialD.Interpreter.Import.Base, TutorialD.Interpreter.Import.TutorialD, TutorialD.Interpreter.RelationalExpr, TutorialD.Interpreter.Types, TutorialD.Interpreter.DatabaseContextIOOperator, TutorialD.Interpreter.TransGraphRelationalOperator
415416 Default-Extensions: OverloadedStrings
416417 GHC-Options: -Wall
src/bin/TutorialD/Interpreter/Base.hs+2−1
@@ -6,6 +6,7 @@ import qualified Text.Megaparsec.Lexer as Lex
66import ProjectM36.Base
77import ProjectM36.AtomType
88import Data.Text hiding (count)
9+import System.Random
910import qualified Data.Text as T
1011import qualified Data.List as L
1112import qualified Data.Vector as V
@@ -16,8 +17,8 @@ import GHC.Generics
1617import Data.Monoid
1718import Control.Monad (void)
1819import qualified Data.UUID as U
19−import Control.Monad.Random
2020import ProjectM36.Relation
21+import Control.Monad.Random
2122
2223displayOpResult :: TutorialDOperatorResult -> IO ()
2324displayOpResult QuitResult = return ()
src/lib/ProjectM36/AtomFunctionBody.hs+12−4
@@ -6,7 +6,11 @@ import ProjectM36.Error
66
77import Control.Monad.IO.Class
88import Control.Exception
9−import Data.Text hiding (map, foldl)
9+import Data.Text hiding (map, concat, foldl)
10+import System.FilePath.Glob
11+import System.Directory
12+import System.FilePath
13+import Control.Monad
1014
1115import Unsafe.Coerce
1216import GHC
@@ -19,7 +23,6 @@ import Panic
1923import Outputable --hiding ((<>))
2024import PprTyThing
2125import Type hiding (pprTyThing)
22−import System.FilePath.Glob
2326
2427data ScriptSession = ScriptSession {
2528 hscEnv :: HscEnv,
@@ -32,8 +35,13 @@ data ScriptSessionError = ScriptSessionLoadError GhcException
3235-- | Configure a GHC environment/session which we will use for all script compilation.
3336initScriptSession :: [String] -> IO (Either ScriptSessionError ScriptSession)
3437initScriptSession ghcPkgPaths = do
35− --for the sake of convenience, for developers' builds, include the local cabal sandbox pacakge database
36− sandboxPkgPaths <- liftIO (glob ".cabal-sandbox/*packages.conf.d")
38+ --for the sake of convenience, for developers' builds, include the local cabal sandbox package database and the cabal new-build package database
39+ homeDir <- getHomeDirectory
40+ sandboxPkgPaths <- liftM concat $ mapM glob [
41+ "./dist-newstyle/packagedb/ghc-*",
42+ ".cabal-sandbox/*packages.conf.d",
43+ homeDir </> ".cabal/store/ghc-*/package.db"
44+ ]
3745 let excHandler exc = pure $ Left (ScriptSessionLoadError exc)
3846 handleGhcException excHandler $ runGhc (Just libdir) $ do
3947 dflags <- getSessionDynFlags
stack.yaml+1−1
@@ -2,7 +2,7 @@
22# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/
33
44# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
5−resolver: nightly-2016-04-10
5+resolver: lts-6.27
66
77# Local packages, usually specified by relative directory name
88packages: