on master help sign in
Merge branch 'master' into merge_transactions
commit3b67141b0736b24dfd3b59b3633a32974b7ccb0e authorAgentM <agentm@themactionfaction.com> dateWed 20 Jul 2016, 19:16 (10 years ago) parenta1eb91378add9d
7 files changed+268−42
ProjectM36/DirectoryFsync.c+5−1 ProjectM36/Persist.hs+38−10 ProjectM36/Win32Handle.hs+57 TutorialD/Interpreter.hs+8 TutorialD/Interpreter/InformationOperator.hs+57 TutorialD/tutd.hs+13−2 project-m36.cabal+90−29
ProjectM36/DirectoryFsync.c+5−1
@@ -33,12 +33,16 @@ int cDirectoryFsync(char *path)
3333 }
3434
3535 /* execute the fsync */
36+
37+#if defined(__APPLE__) && defined(__MACH__) && defined(F_FULLFSYNC)
38+ ret = fcntl(fd, F_FULLFSYNC);
39+#else
3640 ret = fsync(fd);
41+#endif
3742 if(ret < 0)
3843 {
3944 return errno;
4045 }
41−
4246 return 0;
4347}
4448#endif
ProjectM36/Persist.hs+38−10
@@ -1,18 +1,28 @@
1−{-# LANGUAGE ForeignFunctionInterface #-}
1+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
22--this module is related to persisting Project:M36 structures to disk and not related to the persistent library
33module ProjectM36.Persist (writeFileSync,
44 writeBSFileSync,
55 renameSync,
66 DiskSync(..)) where
7−--import ProjectM36.DirectoryFsync (directoryFsync)
8−import System.Posix.Files (rename)
7+-- on Windows, use FlushFileBuffers and MoveFileEx
8+
9+#if defined(mingw32_HOST_OS)
10+import qualified System.Win32 as Win32
11+#else
12+import qualified System.Posix as Posix
913import System.Posix.Unistd (fileSynchroniseDataOnly)
1014import System.Posix.IO (handleToFd)
15+import Foreign.C
16+#endif
17+
1118import System.IO (withFile, IOMode(WriteMode), hPutStr, Handle)
1219import qualified Data.ByteString.Lazy as BS
13−import Foreign.C
1420
15−foreign import ccall unsafe "cDirectoryFsync" cHSDirectoryFsync :: CString -> IO (CInt)
21+#if defined(mingw32_HOST_OS)
22+import ProjectM36.Win32Handle
23+#else
24+foreign import ccall unsafe "cDirectoryFsync" cHSDirectoryFsync :: CString -> IO CInt
25+#endif
1626
1727data DiskSync = NoDiskSync | FsyncDiskSync
1828
@@ -25,11 +35,25 @@ writeFileSync sync path strOut = withFile path WriteMode handler
2535
2636renameSync :: DiskSync -> FilePath -> FilePath -> IO ()
2737renameSync sync srcPath dstPath = do
28− rename srcPath dstPath
38+ atomicRename srcPath dstPath
2939 syncDirectory sync dstPath
30−
31−syncHandle :: DiskSync -> Handle -> IO ()
32−syncHandle FsyncDiskSync handle = handleToFd handle >>= fileSynchroniseDataOnly
40+
41+-- System.Directory's renameFile/renameDirectory almost do exactly what we want except that it needlessly differentiates between directories and files
42+atomicRename :: FilePath -> FilePath -> IO ()
43+atomicRename srcPath dstPath = do
44+#if defined(mingw32_HOST_OS)
45+ Win32.moveFileEx srcPath dstPath Win32.mOVEFILE_REPLACE_EXISTING
46+#else
47+ Posix.rename srcPath dstPath
48+#endif
49+
50+syncHandle :: DiskSync -> Handle -> IO ()
51+syncHandle FsyncDiskSync handle = do
52+#if defined(mingw32_HOST_OS)
53+ withHandleToHANDLE handle (\h -> Win32.flushFileBuffers h)
54+#else
55+ handleToFd handle >>= fileSynchroniseDataOnly
56+#endif
3357syncHandle NoDiskSync _ = pure ()
3458
3559syncDirectory :: DiskSync -> FilePath -> IO ()
@@ -43,5 +67,9 @@ writeBSFileSync sync path bstring = do
4367 syncHandle sync handle
4468
4569directoryFsync :: FilePath -> IO ()
70+#if defined(mingw32_HOST_OS)
71+directoryFsync _ = pure () -- on Windows directory metadata cannot be synchronized- perhaps there is a workaround? resync a file in the directory?
72+#else
4673directoryFsync path = throwErrnoIfMinus1Retry_ "directoryFsync" (withCString path $ \cpath -> cHSDirectoryFsync cpath)
47−
74+#endif
75+
ProjectM36/Win32Handle.hsnew file+57
@@ -0,0 +1,57 @@
1+{-# LANGUAGE CPP #-}
2+module ProjectM36.Win32Handle where
3+import System.Win32.Types
4+import Control.Exception (bracket)
5+import Foreign.StablePtr
6+import Foreign.C.Types
7+import Control.Concurrent.MVar
8+
9+#if __GLASGOW_HASKELL__ >= 612
10+import GHC.IO.Handle.Types (Handle(..), Handle__(..))
11+import GHC.IO.FD (FD(..)) -- A wrapper around an Int32
12+import Data.Typeable
13+#else
14+import GHC.IOBase (Handle(..), Handle__(..))
15+import qualified GHC.IOBase as IOBase (FD) -- Just an Int32
16+#endif
17+
18+-- This essential function comes from the C runtime system. It is certainly provided by msvcrt, and also seems to be provided by the mingw C library - hurrah!
19+#if __GLASGOW_HASKELL__ >= 612
20+foreign import ccall unsafe "_get_osfhandle" cget_osfhandle :: CInt -> IO HANDLE
21+#else
22+foreign import ccall unsafe "_get_osfhandle" cget_osfhandle :: IOBase.FD -> IO HANDLE
23+#endif
24+
25+-- copied from ansi-terminal package
26+-- | This bit is all highly dubious. The problem is that we want to output ANSI to arbitrary Handles rather than forcing
27+-- people to use stdout. However, the Windows ANSI emulator needs a Windows HANDLE to work it's magic, so we need to be able
28+-- to extract one of those from the Haskell Handle.
29+--
30+-- This code accomplishes this, albeit at the cost of only being compatible with GHC.
31+withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a
32+withHandleToHANDLE haskell_handle action =
33+ -- Create a stable pointer to the Handle. This prevents the garbage collector
34+ -- getting to it while we are doing horrible manipulations with it, and hence
35+ -- stops it being finalized (and closed).
36+ withStablePtr haskell_handle $ const $ do
37+ -- Grab the write handle variable from the Handle
38+ let write_handle_mvar = case haskell_handle of
39+ FileHandle _ handle_mvar -> handle_mvar
40+ DuplexHandle _ _ handle_mvar -> handle_mvar -- This is "write" MVar, we could also take the "read" one
41+
42+ -- Get the FD from the algebraic data type
43+#if __GLASGOW_HASKELL__ < 612
44+ fd <- fmap haFD $ readMVar write_handle_mvar
45+#else
46+ --readMVar write_handle_mvar >>= \(Handle__ { haDevice = dev }) -> print (typeOf dev)
47+ Just fd <- fmap (\(Handle__ { haDevice = dev }) -> fmap fdFD (cast dev)) $ readMVar write_handle_mvar
48+#endif
49+
50+ -- Finally, turn that (C-land) FD into a HANDLE using msvcrt
51+ windows_handle <- cget_osfhandle fd
52+
53+ -- Do what the user originally wanted
54+ action windows_handle
55+
56+withStablePtr :: a -> (StablePtr a -> IO b) -> IO b
57+withStablePtr value = bracket (newStablePtr value) freeStablePtr
TutorialD/Interpreter.hs+8
@@ -4,6 +4,7 @@ import TutorialD.Interpreter.Base
44import TutorialD.Interpreter.RODatabaseContextOperator
55import TutorialD.Interpreter.DatabaseExpr
66import TutorialD.Interpreter.TransactionGraphOperator
7+import TutorialD.Interpreter.InformationOperator
78
89import TutorialD.Interpreter.Import.CSV
910import TutorialD.Interpreter.Import.TutorialD
@@ -34,6 +35,7 @@ graph ops are read-write operations which change the transaction graph
3435-}
3536data ParsedOperation = RODatabaseContextOp RODatabaseContextOperator |
3637 DatabaseExprOp DatabaseExpr |
38+ InfoOp InformationOperator |
3739 GraphOp TransactionGraphOperator |
3840 ROGraphOp ROTransactionGraphOperator |
3941 ImportRelVarOp RelVarDataImportOperator |
@@ -42,6 +44,7 @@ data ParsedOperation = RODatabaseContextOp RODatabaseContextOperator |
4244
4345interpreterParserP :: Parser ParsedOperation
4446interpreterParserP = liftM RODatabaseContextOp (roDatabaseContextOperatorP <* eof) <|>
47+ liftM InfoOp (infoOpP <* eof) <|>
4548 liftM GraphOp (transactionGraphOpP <* eof) <|>
4649 liftM ROGraphOp (roTransactionGraphOpP <* eof) <|>
4750 liftM DatabaseExprOp (databaseExprOpP <* eof) <|>
@@ -102,6 +105,11 @@ evalTutorialD sessionId conn expr = case expr of
102105 Left err -> barf err
103106 Right dbexprs -> evalTutorialD sessionId conn (DatabaseExprOp dbexprs)
104107
108+ (InfoOp execOp) -> do
109+ case evalInformationOperator execOp of
110+ Left err -> barf err
111+ Right info -> pure (DisplayResult info)
112+
105113 (RelVarExportOp execOp@(RelVarDataExportOperator relExpr _ _)) -> do
106114 --eval relexpr to relation and pass to export function
107115 eRel <- C.executeRelationalExpr sessionId conn relExpr
TutorialD/Interpreter/InformationOperator.hsnew file+57
@@ -0,0 +1,57 @@
1+{-# LANGUAGE CPP, OverloadedStrings #-}
2+module TutorialD.Interpreter.InformationOperator where
3+import Data.Text
4+import Text.Parsec
5+import Text.Parsec.String
6+import TutorialD.Interpreter.Base
7+
8+-- this module provides information about the current interpreter
9+
10+data InformationOperator = HelpOperator |
11+ GetVersionOperator
12+
13+infoOpP :: Parser InformationOperator
14+infoOpP = helpOpP <|> getVersionP
15+
16+helpOpP :: Parser InformationOperator
17+helpOpP = reserved ":help" >> pure HelpOperator
18+
19+getVersionP :: Parser InformationOperator
20+getVersionP = reserved ":version" >> pure GetVersionOperator
21+
22+evalInformationOperator :: InformationOperator -> Either Text Text
23+evalInformationOperator GetVersionOperator = Right ("tutd " `append` PROJECTM36_VERSION)
24+-- display generic help
25+evalInformationOperator HelpOperator = Right $ intercalate "\n" help
26+ where
27+ help = ["tutd Help",
28+ "Quick Examples:",
29+ ":showexpr true",
30+ ":showexpr relation{name Text, address Text}{tuple{name \"Steve\", address \"Main St.\"}}",
31+ "address := relation{tuple{name \"Steve\", address \"Main St.\"}}",
32+ ":showexpr true join false = false",
33+ "Relational Operators:",
34+ ":showexpr relation{a Int, b Text}{} -- relation creation",
35+ ":showexpr relation{tuple{c t}} -- relation creation",
36+ ":showexpr relation{tuple{a 4, b 4}}{a} -- projection",
37+ ":showexpr relation{tuple{a 5}} rename {a as num} -- rename",
38+ ":showexpr relation{tuple{d 10}} where d=10 or d=5 -- restriction",
39+ ":showexpr relation{tuple{d 10}} : {e:=add(@d,5)} -- extension",
40+ "Database Context Operators:",
41+ "animal := relation{tuple{name \"octopus\", legs_count 8}} -- assignment",
42+ "insert animal relation{tuple{name \"cat\", legs_count 4}} -- insertion",
43+ "car :: {model Text, make Text, year Int} -- definition",
44+ "undefine car -- undefine",
45+ "delete animal where legs_count=4 -- deletion",
46+ "update animal where name=\"octopus\" (name:=\"Mr. Octopus\") -- updating",
47+ "employee:=relation{id Int, name Text, age Int}{}; key emp_unique_id {id} employee --uniqueness constraint",
48+ "constraint age_gt_zero (employee{age} where ^lt(@age,0)){} equals false -- constraint",
49+ "notify teenager_added employee where ^lt(@age,20) and ^gte(@age,13) employee{age} where ^lt(@age,20) and ^gte(@age,13) -- change notification",
50+ "Graph Operators: ",
51+ ":jumphead <head_name> - change the current database context to point to a current head",
52+ ":jump <transaction_id> - change the current database context to that of a past transaction",
53+ ":commit - push the current context into the current head and make it immutable",
54+ ":rollback - discard any changes made in the current context",
55+ ":showgraph - display the transaction graph",
56+ "View more documentation at: https://github.com/agentm/project-m36/blob/master/docs/tutd_tutorial.markdown"
57+ ]
TutorialD/tutd.hs+13−2
@@ -1,4 +1,4 @@
1−{-# LANGUAGE OverloadedStrings #-}
1+{-# LANGUAGE OverloadedStrings, CPP #-}
22import TutorialD.Interpreter
33import ProjectM36.Base
44import ProjectM36.Client
@@ -59,6 +59,16 @@ headNameForConfig (RemoteInterpreterConfig _ _ headn) = headn
5959errDie :: String -> IO ()
6060errDie err = hPutStrLn stderr err >> exitFailure
6161
62+#ifndef PROJECTM36_VERSION
63+#error PROJECTM36_VERSION is not defined
64+#endif
65+printWelcome :: IO ()
66+printWelcome = do
67+ putStrLn $ "Project:M36 TutorialD Interpreter " ++ PROJECTM36_VERSION
68+ putStrLn "Type \":help\" for more information."
69+ putStrLn "A full tutorial is available at:"
70+ putStrLn "https://github.com/agentm/project-m36/blob/master/docs/tutd_tutorial.markdown"
71+
6272main :: IO ()
6373main = do
6474 interpreterConfig <- execParser opts
@@ -72,7 +82,8 @@ main = do
7282 eSessionId <- createSessionAtHead connHeadName conn
7383 case eSessionId of
7484 Left err -> errDie ("Failed to create database session at \"" ++ show connHeadName ++ "\": " ++ show err)
75− Right sessionId -> do
85+ Right sessionId -> do
86+ printWelcome
7687 _ <- reprLoop interpreterConfig sessionId conn
7788 pure ()
7889
project-m36.cabal+90−29
@@ -36,7 +36,6 @@ Library
3636 ,filepath
3737 ,directory
3838 ,vector-binary-instances
39− ,unix
4039 ,temporary
4140 ,stm
4241 ,time
@@ -49,7 +48,7 @@ Library
4948 ,extended-reals
5049 ,network-transport
5150--required for persistent db driver
52− ,persistent
51+ ,persistent >= 2.2 && < 2.3
5352 ,persistent-template
5453 ,aeson
5554 ,path-pieces
@@ -110,7 +109,12 @@ Library
110109 ProjectM36.TypeConstructorDef,
111110 Database.Persist.ProjectM36
112111 GHC-Options: -Wall -rtsopts
113− C-sources: ProjectM36/DirectoryFsync.c
112+ if os(windows)
113+ Build-Depends: Win32 >= 2.3 && < 2.4
114+ Other-Modules: ProjectM36.Win32Handle
115+ else
116+ C-sources: ProjectM36/DirectoryFsync.c
117+ Build-Depends: unix
114118 Default-Language: Haskell2010
115119
116120Executable tutd
@@ -138,7 +142,6 @@ Executable tutd
138142 deepseq,
139143 binary,
140144 data-interval,
141− unix,
142145 parallel,
143146 cassava,
144147 gnuplot,
@@ -207,9 +210,16 @@ Executable tutd
207210 TutorialD.Interpreter.RelationalExpr,
208211 TutorialD.Interpreter.Types
209212 main-is: TutorialD/tutd.hs
210− GHC-Options: -Wall
211− C-sources: ProjectM36/DirectoryFsync.c
213+ CPP-Options: -DPROJECTM36_VERSION="v0.1"
214+ GHC-Options: -Wall
212215 Default-Language: Haskell2010
216+ if os(windows)
217+ Build-Depends: Win32 >= 2.3 && < 2.4
218+ Other-Modules: ProjectM36.Win32Handle
219+ else
220+ C-sources: ProjectM36/DirectoryFsync.c
221+ Build-Depends: unix
222+
213223
214224Executable project-m36-server
215225 Build-Depends: base,
@@ -223,7 +233,6 @@ Executable project-m36-server
223233 binary,
224234 transformers,
225235 temporary,
226− unix,
227236 data-interval,
228237 deepseq,
229238 uuid,
@@ -250,7 +259,6 @@ Executable project-m36-server
250259 Main-Is: ProjectM36/Server/project-m36-server.hs
251260 GHC-Options: -Wall -threaded -rtsopts
252261 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
253− C-sources: ProjectM36/DirectoryFsync.c
254262 Default-Language: Haskell2010
255263 Other-Modules: ProjectM36.Atom,
256264 ProjectM36.AtomFunction,
@@ -291,10 +299,17 @@ Executable project-m36-server
291299 ProjectM36.TupleSet,
292300 ProjectM36.TypeConstructor,
293301 ProjectM36.TypeConstructorDef
302+ if os(windows)
303+ Build-Depends: Win32 >= 2.3 && < 2.4
304+ Other-Modules: ProjectM36.Win32Handle
305+ else
306+ C-sources: ProjectM36/DirectoryFsync.c
307+ Build-Depends: unix
308+
294309
295310Executable bigrel
296311 Default-Language: Haskell2010
297− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t
312+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, optparse-applicative, stm-containers, list-t
298313 Other-Modules: ProjectM36.Base,
299314 ProjectM36.Relation
300315 ProjectM36.Tuple,
@@ -331,66 +346,91 @@ Executable bigrel
331346 main-is: benchmark/bigrel.hs
332347 GHC-Options: -Wall -threaded -rtsopts
333348 GHC-Prof-Options: -fprof-auto -rtsopts -threaded -Wall
334− C-sources: ProjectM36/DirectoryFsync.c
349+ if os(windows)
350+ Build-Depends: Win32 >= 2.3 && < 2.4
351+ Other-Modules: ProjectM36.Win32Handle
352+ else
353+ C-sources: ProjectM36/DirectoryFsync.c
354+ Build-Depends: unix
355+
335356
336357Test-Suite test-tutoriald
337358 Default-Language: Haskell2010
338359 type: exitcode-stdio-1.0
339360 main-is: test/TutorialD/Interpreter.hs
340− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t
361+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers, list-t
341362 GHC-Options: -Wall
342− C-sources: ProjectM36/DirectoryFsync.c
363+ if os(windows)
364+ Build-Depends: Win32 >= 2.3 && < 2.4
365+ Other-Modules: ProjectM36.Win32Handle
366+ else
367+ C-sources: ProjectM36/DirectoryFsync.c
368+ Build-Depends: unix
369+
343370
344371Test-Suite test-relation
345372 Default-Language: Haskell2010
346373 type: exitcode-stdio-1.0
347374 main-is: test/Relation/Basic.hs
348− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
375+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
349376 GHC-Options: -Wall
350377
351378Test-Suite test-static-optimizer
352379 Default-Language: Haskell2010
353380 type: exitcode-stdio-1.0
354381 main-is: test/Relation/StaticOptimizer.hs
355− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
382+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
356383 GHC-Options: -Wall
357384
358385Test-Suite test-transactiongraph-persist
359386 Default-Language: Haskell2010
360387 type: exitcode-stdio-1.0
361388 main-is: test/TransactionGraph/Persist.hs
362− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
389+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
363390 GHC-Options: -Wall
364− C-sources: ProjectM36/DirectoryFsync.c
391+ if os(windows)
392+ Build-Depends: Win32 >= 2.3 && < 2.4
393+ Other-Modules: ProjectM36.Win32Handle
394+ else
395+ C-sources: ProjectM36/DirectoryFsync.c
396+ Build-Depends: unix
397+
365398
366399Test-Suite test-relation-import-csv
367400 Default-Language: Haskell2010
368401 type: exitcode-stdio-1.0
369402 main-is: test/Relation/Import/CSV.hs
370− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
403+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
371404 GHC-Options: -Wall
372405
373406Test-Suite test-tutoriald-import-tutoriald
374407 Default-Language: Haskell2010
375408 type: exitcode-stdio-1.0
376409 main-is: test/TutorialD/Interpreter/Import/TutorialD.hs
377− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
410+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
378411 GHC-Options: -Wall
379412
380413Test-Suite test-relation-export-csv
381414 Default-Language: Haskell2010
382415 type: exitcode-stdio-1.0
383416 main-is: test/Relation/Export/CSV.hs
384− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
417+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, stm-containers
385418 GHC-Options: -Wall
386419
387420Test-Suite test-persistent-driver
388421 Default-Language: Haskell2010
389422 type: exitcode-stdio-1.0
390423 main-is: test/persistent-driver/test.hs
391− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, template-haskell, transformers, aeson, persistent-template, conduit, persistent, either, path-pieces, http-api-data, stm-containers, list-t
424+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, template-haskell, transformers, aeson, persistent-template, conduit, persistent >= 2.2 && < 2.3, either, path-pieces, http-api-data, stm-containers, list-t
392425 GHC-Options: -Wall
393− C-sources: ProjectM36/DirectoryFsync.c
426+ if os(windows)
427+ Build-Depends: Win32 >= 2.3 && < 2.4
428+ Other-Modules: ProjectM36.Win32Handle
429+ else
430+ C-sources: ProjectM36/DirectoryFsync.c
431+ Build-Depends: unix
432+
433+
394434
395435Test-Suite test-transactiongraph-merge
396436 Default-Language: Haskell2010
@@ -404,23 +444,29 @@ benchmark bench
404444 Default-Language: Haskell2010
405445 type: exitcode-stdio-1.0
406446 main-is: benchmark/Relation.hs
407− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, criterion, stm-containers
447+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, criterion, stm-containers
408448 GHC-Options: -Wall -rtsopts
409449
410450Test-Suite test-server
411451 Default-Language: Haskell2010
412452 type: exitcode-stdio-1.0
413453 main-is: test/Server/Main.hs
414− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
454+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
415455 GHC-Options: -Wall
416− C-sources: ProjectM36/DirectoryFsync.c
456+ if os(windows)
457+ Build-Depends: Win32 >= 2.3 && < 2.4
458+ Other-Modules: ProjectM36.Win32Handle
459+ else
460+ C-sources: ProjectM36/DirectoryFsync.c
461+ Build-Depends: unix
462+
463+
417464
418465Executable Example-SimpleClient
419466 Default-Language: Haskell2010
420− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
467+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t
421468 Main-Is: examples/SimpleClient.hs
422469 GHC-Options: -Wall
423− C-sources: ProjectM36/DirectoryFsync.c
424470 Other-Modules: ProjectM36.Atom,
425471 ProjectM36.AtomFunction,
426472 ProjectM36.AtomFunctions.Basic,
@@ -457,13 +503,20 @@ Executable Example-SimpleClient
457503 ProjectM36.TupleSet,
458504 ProjectM36.TypeConstructor,
459505 ProjectM36.TypeConstructorDef
506+ if os(windows)
507+ Build-Depends: Win32 >= 2.3 && < 2.4
508+ Other-Modules: ProjectM36.Win32Handle
509+ else
510+ C-sources: ProjectM36/DirectoryFsync.c
511+ Build-Depends: unix
512+
513+
460514
461515Executable Example-PersistClient
462516 Default-Language: Haskell2010
463− Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, unix, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template
517+ Build-Depends: base, HUnit, Cabal, containers, hashable, unordered-containers, mtl, vector, vector-binary-instances, time, hashable-time, bytestring, network-transport-tcp, distributed-process, distributed-process-extras, distributed-process-client-server, uuid, stm, deepseq, deepseq-generics, binary, parallel, cassava, attoparsec, gnuplot, directory, temporary, haskeline, parsec, text, base64-bytestring, data-interval, filepath, transformers, stm-containers, list-t, persistent, aeson, path-pieces, either, conduit, http-api-data, template-haskell, persistent-template
464518 Main-Is: examples/PersistClient.hs
465519 GHC-Options: -Wall
466− C-sources: ProjectM36/DirectoryFsync.c
467520 Other-Modules: Database.Persist.ProjectM36,
468521 ProjectM36.Atom,
469522 ProjectM36.AtomFunction,
@@ -499,4 +552,12 @@ Executable Example-PersistClient
499552 ProjectM36.Tuple,
500553 ProjectM36.TupleSet,
501554 ProjectM36.TypeConstructor,
502− ProjectM36.TypeConstructorDef
555+ ProjectM36.TypeConstructorDef
556+ if os(windows)
557+ Build-Depends: Win32 >= 2.3 && < 2.4
558+ Other-Modules: ProjectM36.Win32Handle
559+ else
560+ C-sources: ProjectM36/DirectoryFsync.c
561+ Build-Depends: unix
562+
563+