git.iko.soy/distributed-process
on master help sign in
Fix Compilation Warnings
commitfd852b78f34a261a7cf64c40186d66ca5d33f4f3 authorTim Watson <watson.timothy@gmail.com> dateFri 16 Nov 2018, 00:07 (8 years ago) parent003e52238b7a44
13 files changed+36−28
.travis.yml+4−4 distributed-process-tests/distributed-process-tests.cabal+3−2 distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+13−8 distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs+1−1 distributed-process-tests/src/Control/Distributed/Process/Tests/Mx.hs−2 distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs+7−8 distributed-process-tests/tests/runInMemory.hs−1 distributed-process.cabal+1−1 stack-ghc-7.10.3.yaml+1 stack-ghc-8.0.2.yaml+1−1 stack-ghc-8.2.2.yaml+2 stack-ghc-8.4.4.yaml+1 stack.yaml+2
.travis.yml+4−4
@@ -5,13 +5,13 @@ sudo: false
55matrix:
66 include:
77 - env: ARGS="--stack-yaml stack-ghc-7.10.3.yaml"
8− addons: {apt: {packages: [libgmp-dev]}}
8+ addons: {apt: {packages: [libgmp-dev]}}
99 - env: ARGS="--stack-yaml stack-ghc-8.2.2.yaml"
10− addons: {apt: {packages: [libgmp-dev]}}
10+ addons: {apt: {packages: [libgmp-dev]}}
1111 - env: ARGS="--stack-yaml stack-ghc-8.4.4.yaml"
12− addons: {apt: {packages: [libgmp-dev]}}
12+ addons: {apt: {packages: [libgmp-dev]}}
1313 - env: ARGS="--stack-yaml stack-nightly.yaml --resolver nightly"
14− addons: {apt: {packages: [libgmp-dev]}}
14+ addons: {apt: {packages: [libgmp-dev]}}
1515
1616cache:
1717 directories:
distributed-process-tests/distributed-process-tests.cabal+3−2
@@ -31,6 +31,7 @@ library
3131 bytestring >= 0.9 && < 0.12,
3232 distributed-process >= 0.6.0 && < 0.8,
3333 distributed-static,
34+ exceptions >= 0.5,
3435 HUnit >= 1.2 && < 1.7,
3536 network-transport >= 0.4.1.0 && < 0.6,
3637 network >= 2.5 && < 2.9,
@@ -125,7 +126,7 @@ Test-Suite TestMxInMemory
125126 network-transport-inmemory >= 0.5,
126127 test-framework >= 0.6 && < 0.9
127128 Extensions: CPP
128− ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
129+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
129130 HS-Source-Dirs: tests
130131
131132Test-Suite TestTracingInMemory
@@ -139,7 +140,7 @@ Test-Suite TestTracingInMemory
139140 network-transport-inmemory >= 0.5,
140141 test-framework >= 0.6 && < 0.9
141142 Extensions: CPP
142− ghc-options: -Wall -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
143+ ghc-options: -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
143144 HS-Source-Dirs: tests
144145
145146Test-Suite TestMxInTCP
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+13−8
@@ -25,13 +25,18 @@ import Control.Concurrent.MVar
2525 )
2626import Control.Monad (replicateM_, replicateM, forever, void, unless, join)
2727import Control.Exception (SomeException, throwIO, ErrorCall(..))
28−import qualified Control.Exception as Ex (catch)
29−import Control.Applicative ((<$>), (<*>), pure, (<|>))
28+import Control.Monad.Catch (try, catch, finally, mask, onException)
29+import Control.Applicative ((<|>))
3030import qualified Network.Transport as NT (closeEndPoint, EndPointAddress)
31−import Control.Distributed.Process
31+import Control.Distributed.Process hiding
32+ ( try
33+ , catch
34+ , finally
35+ , mask
36+ , onException
37+ )
3238import Control.Distributed.Process.Internal.Types
33− ( NodeId(nodeAddress)
34− , LocalNode(localEndPoint)
39+ ( LocalNode(localEndPoint)
3540 , ProcessExitException(..)
3641 , nullProcessId
3742 , createUnencodedMessage
@@ -68,7 +73,7 @@ expectThat a matcher = case res of
6873forkTry :: IO () -> IO ThreadId
6974forkTry p = do
7075 tid <- myThreadId
71− forkIO $ Ex.catch p (\e -> throwTo tid (e :: SomeException))
76+ forkIO $ catch p (\e -> throwTo tid (e :: SomeException))
7277
7378-- | The ping server from the paper
7479ping :: Process ()
@@ -760,8 +765,8 @@ testRemoteRegistry TestTransport{..} = do
760765 (\(RegisterReply _ _ _) -> return ()) ]
761766 registerRemoteAsync nid1 "ping" deadProcess
762767 receiveWait [
763− matchIf (\(RegisterReply label' False (Just pid)) ->
764− "ping" == label' && pid == pingServer)
768+ matchIf (\(RegisterReply label' False (Just pid'')) ->
769+ "ping" == label' && pid'' == pingServer)
765770 (\(RegisterReply _ _ _) -> return ()) ]
766771 unregisterRemoteAsync nid1 "dead"
767772 receiveWait [
distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs+1−1
@@ -522,7 +522,7 @@ testSpawnReconnect :: TestTransport -> RemoteTable -> Assertion
522522testSpawnReconnect testtrans@TestTransport{..} rtable = do
523523 [node1, node2] <- replicateM 2 $ newLocalNode testTransport rtable
524524 let nid1 = localNodeId node1
525− nid2 = localNodeId node2
525+ -- nid2 = localNodeId node2
526526 done <- newEmptyMVar
527527 iv <- newMVar (0 :: Int)
528528
distributed-process-tests/src/Control/Distributed/Process/Tests/Mx.hs−2
@@ -4,7 +4,6 @@ module Control.Distributed.Process.Tests.Mx (tests) where
44import Control.Distributed.Process.Tests.Internal.Utils
55import Network.Transport.Test (TestTransport(..))
66
7−import Control.Concurrent (threadDelay)
87import Control.Distributed.Process
98import Control.Distributed.Process.Node
109import Control.Distributed.Process.Management
@@ -21,7 +20,6 @@ import Control.Distributed.Process.Management
2120 , mxUpdateLocal
2221 , mxNotify
2322 , mxBroadcast
24− , mxGetId
2523 )
2624import Control.Monad (void, unless)
2725import Control.Rematch (equalTo)
distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs+7−8
@@ -10,13 +10,12 @@ import Network.Transport.Test (TestTransport(..))
1010
1111import Network.Transport (Transport)
1212import Control.Distributed.Process
13−import Control.Distributed.Process.Closure
1413import Control.Distributed.Process.Node
1514
1615import Control.Monad
1716
1817import Test.HUnit (Assertion, (@?=))
19−import Test.Framework (Test, defaultMain)
18+import Test.Framework (Test)
2019import Test.Framework.Providers.HUnit (testCase)
2120
2221-- Tests:
@@ -43,7 +42,7 @@ recTest2 :: ReceivePort ()
4342 -> SendPort String
4443 -> ReceivePort String -> ReceivePort String
4544 -> Process ()
46−recTest2 wait sync r1 r2 = do
45+recTest2 wait sync r1 _ = do
4746 forever $ do
4847 receiveChan wait
4948 r <- receiveWait
@@ -56,7 +55,7 @@ recTest3 :: ReceivePort ()
5655 -> SendPort String
5756 -> ReceivePort String -> ReceivePort String
5857 -> Process ()
59−recTest3 wait sync r1 r2 = do
58+recTest3 wait sync r1 _ = do
6059 forever $ do
6160 receiveChan wait
6261 r <- receiveWait
@@ -69,7 +68,7 @@ recTest4 :: ReceivePort ()
6968 -> SendPort String
7069 -> ReceivePort String -> ReceivePort String
7170 -> Process ()
72−recTest4 wait sync r1 r2 = do
71+recTest4 wait sync r1 _ = do
7372 forever $ do
7473 receiveChan wait
7574 r <- receiveWait
@@ -83,11 +82,11 @@ master :: Process ()
8382master = do
8483 (waits,waitr) <- newChan
8584 (syncs,syncr) <- newChan
86− let go expect = do
85+ let go expected = do
8786 sendChan waits ()
8887 r <- receiveChan syncr
89− liftIO $ print (r,expect, r == expect)
90− liftIO $ r @?= expect
88+ liftIO $ print (r, expected, r == expected)
89+ liftIO $ r @?= expected
9190
9291 liftIO $ putStrLn "---- Test 1 ----"
9392 (s1,r1) <- newChan
distributed-process-tests/tests/runInMemory.hs−1
@@ -8,7 +8,6 @@ import Network.Transport.Test (TestTransport(..))
88import Network.Transport.InMemory
99import Test.Framework (defaultMainWithArgs)
1010
11−import Control.Concurrent (threadDelay)
1211import System.Environment (getArgs)
1312
1413main :: IO ()
distributed-process.cabal+1−1
@@ -21,7 +21,7 @@ Description: This is an implementation of Cloud Haskell, as described in
2121
2222 You will probably also want to install a Cloud Haskell backend such
2323 as distributed-process-simplelocalnet.
24−Tested-With: GHC==7.6.3 GHC==7.8.4 GHC==7.10.3 GHC==8.0.1
24+Tested-With: GHC==7.10.3 GHC==8.0.2 GHC==8.2.2 GHC==8.4.4
2525Category: Control
2626extra-source-files: ChangeLog
2727
stack-ghc-7.10.3.yaml+1
@@ -14,6 +14,7 @@ extra-deps:
1414- network-transport-0.5.2
1515- network-transport-inmemory-0.5.2
1616- rematch-0.2.0.0
17+- exceptions-0.8.2.1 # test dependency
1718
1819flags:
1920 distributed-process-tests:
stack-ghc-8.0.2.yaml+1−1
@@ -1,5 +1,4 @@
11resolver: lts-9.21
2−
32# added -location for network-transport-tcp-0.6.0
43# since c7fd79 broke the client facing API for createTransport :/
54
@@ -17,6 +16,7 @@ extra-deps:
1716- network-transport-0.5.2
1817- network-transport-inmemory-0.5.2
1918- rematch-0.2.0.0
19+# - exceptions-0.8.2.1 # test dependency
2020
2121flags:
2222 distributed-process-tests:
stack-ghc-8.2.2.yaml+2
@@ -12,8 +12,10 @@ extra-deps:
1212- rank1dynamic-0.4.0
1313- distributed-static-0.3.8
1414- network-transport-0.5.2
15+- network-transport-tcp-0.6.0
1516- network-transport-inmemory-0.5.2
1617- rematch-0.2.0.0
18+# - exceptions-0.8.2.1 # test dependency
1719
1820flags:
1921 distributed-process-tests:
stack-ghc-8.4.4.yaml+1
@@ -12,6 +12,7 @@ extra-deps:
1212- rank1dynamic-0.4.0
1313- distributed-static-0.3.8
1414- network-transport-0.5.2
15+- network-transport-tcp-0.6.0
1516- network-transport-inmemory-0.5.2
1617- rematch-0.2.0.0
1718
stack.yaml+2
@@ -1,5 +1,7 @@
11resolver: lts-12.18 # Use GHC 8.4.4
22
3+# TODO: we can enable nightly-2018-11-11 once PR #319 is merged
4+
35packages:
46- '.'
57- distributed-process-tests/