on master help sign in
Merge branch 'appveyor'
commit802f2ce74637346263ee0d64fa7bd941862c4737 authorAgentM <agentm@themactionfaction.com> dateSun 21 Jan 2018, 13:23 (9 years ago) parent64dfd80aa8645b
6 files changed+45−12
.appveyor.yml+36 README.markdown+2 src/lib/ProjectM36/FileLock.hs+2−10 src/lib/ProjectM36/Persist.hs+2−1 src/lib/ProjectM36/ScriptSession.hs+2 src/lib/ProjectM36/TransactionGraph.hs+1−1
.appveyor.ymlnew file+36
@@ -0,0 +1,36 @@
1+build: off
2+
3+version: 1.0.{build}-{branch}
4+
5+image: Visual Studio 2017
6+
7+before_test:
8+# http://help.appveyor.com/discussions/problems/6312-curl-command-not-found
9+- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%
10+
11+- curl -sS -ostack.zip -L --insecure http://www.stackage.org/stack/windows-x86_64
12+- 7z x stack.zip stack.exe
13+
14+clone_folder: "c:\\project-m36"
15+clone_depth: 2
16+environment:
17+ global:
18+ STACK_ROOT: "c:\\sr"
19+
20+platform:
21+ - x64
22+
23+cache:
24+ - "c:\\sr"
25+ - "%LocalAppData%\\Programs\\stack"
26+
27+test_script:
28+ - stack setup > nul
29+# The ugly echo "" hack is to avoid complaints about 0 being an invalid file
30+# descriptor
31+ - echo "" | stack --no-terminal test
32+# - 7z.exe a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on project-m36.7z .stack-work\install\*\bin\project-m36-server.exe .stack-work\install\*\bin\project-m36-websocket-server.exe .stack-work\install\*\bin\tutd.exe .stack-work\install\*\bin\project-m36-server.exe
33+
34+#artifacts:
35+# - path: project-m36.7z
36+# name: project-m36.7z
README.markdown+2
@@ -5,6 +5,8 @@
55[![Hackage](https://img.shields.io/hackage/v/project-m36.svg)](http://hackage.haskell.org/package/project-m36)
66[![Hackage dependency status](https://img.shields.io/hackage-deps/v/project-m36.svg)](http://packdeps.haskellers.com/feed?needle=project-m36)
77[![Build status](https://travis-ci.org/agentm/project-m36.svg?branch=master)](https://travis-ci.org/agentm/project-m36)
8+[![Windows Build status](https://ci.appveyor.com/api/projects/status/q7jyddd6dy1ibqdo/branch/master?svg=true)
9+
810
911*Software can always be made faster, but rarely can it be made more correct.*
1012
src/lib/ProjectM36/FileLock.hs+2−10
@@ -48,22 +48,14 @@ lockFile winHandle lock = do
4848
4949 allocaBytes sizeof_OVERLAPPED $ \op -> do
5050 zeroMemory op $ fromIntegral sizeof_OVERLAPPED
51− res <- c_lockFileEx winHandle (exFlag .|. blockFlag) 0 1 0 op
52− if res then
53− pure ()
54− else
55− error "failed to wait for database lock"
51+ failIfFalse_ "LockFileEx" $ c_lockFileEx winHandle (exFlag .|. blockFlag) 0 1 0 op
5652
5753unlockFile :: HANDLE -> IO ()
5854unlockFile winHandle = do
5955 let sizeof_OVERLAPPED = 32
6056 allocaBytes sizeof_OVERLAPPED $ \op -> do
6157 zeroMemory op $ fromIntegral sizeof_OVERLAPPED
62− res <- c_unlockFileEx winHandle 0 1 0 op
63− if res then
64− pure ()
65− else
66− error ("failed to unlock database lock: " ++ show res)
58+ failIfFalse_ "UnlockFileEx" $ c_unlockFileEx winHandle 0 1 0 op
6759
6860#else
6961--all of this complicated nonsense is fixed if we switch to GHC 8.2 which includes native flock support on handles
src/lib/ProjectM36/Persist.hs+2−1
@@ -79,12 +79,13 @@ syncHandle FsyncDiskSync handle =
7979 --fdatasync doesn't exist on macOS
8080 fd <- handleToFd handle
8181 fileSynchroniseDataOnly fd
82+ closeFd fd
8283#else
8384 do
8485 fd <- handleToFd handle
8586 fileSynchronise fd
86−#endif
8787 closeFd fd
88+#endif
8889
8990syncHandle NoDiskSync _ = pure ()
9091
src/lib/ProjectM36/ScriptSession.hs+2
@@ -48,6 +48,8 @@ initScriptSession ghcPkgPaths = do
4848 "./dist-newstyle/packagedb/ghc-" ++ ghcVersion,
4949 ".cabal-sandbox/*ghc-" ++ ghcVersion ++ "-packages.conf.d",
5050 ".stack-work/install/*/*/" ++ ghcVersion ++ "/pkgdb",
51+ ".stack-work/install/*/pkgdb/", --windows stack build
52+ "C:/sr/snapshots/b201cfe6/pkgdb", --windows stack build- ideally, we could run `stack path --snapshot-pkg-db, but this is sufficient to pass CI
5153 homeDir </> ".stack/snapshots/*/*/" ++ ghcVersion ++ "/pkgdb",
5254 homeDir </> ".cabal/store/ghc-" ++ ghcVersion ++ "/package.db"
5355 ]
src/lib/ProjectM36/TransactionGraph.hs+1−1
@@ -508,7 +508,7 @@ backtrackGraph graph currentTid (TransactionIdHeadBranchBacktrack steps) = do
508508backtrackGraph graph currentTid btrack@(TransactionStampHeadBacktrack stamp) = do
509509 trans <- transactionForId currentTid graph
510510 let parents = transactionParentIds trans
511− if transactionTimestamp trans < stamp then
511+ if transactionTimestamp trans <= stamp then
512512 pure currentTid
513513 else if S.null parents then
514514 Left RootTransactionTraversalError