git.iko.soy/distributed-process
on master help sign in
Have d-p-test build with ghc-7.4.2.

Because d-p depended on deepseq >= 1.3.0.1 and ghc-7.4.2 ships deepseq-1.3.0.0, cabal would install a newer deepseq. Then in turn, cabal would rebuild reverse dependencies of deepseq which included the template-haskell package, which would cause the compiler to crash when compiling tests using template haskell. The lower bound of deepseq was moved to 1.3.0.0. But then d-p would fail to build because src/Control/Distributed/Process/Management/Table.hs uses Data.Map.Strict wich is not available in containers-0.4.2.1 shipped with ghc-7.4.2, and it is also a dependency of template-haskell. The solution was to use Data.Map instead, and insert seqs in Table.hs to achieve the semantics expected of Data.Map.Strict. Finally, for ghc-7.4.2 the version bounds are tightened so it is easier for cabal to find conflicts related to template-haskell.

commita909750afd7baf22cd066704b1ccfa5fc43c198d authorFacundo Domínguez <facundo.dominguez@tweag.io> dateThu 3 Apr 2014, 15:06 (13 years ago) parentea1b3b8
2 files changed+15−8
distributed-process.cabal+10−3 src/Control/Distributed/Process/Management/Table.hs+5−5
distributed-process.cabal+10−3
@@ -44,7 +44,6 @@ flag prof
4444Library
4545 Build-Depends: base >= 4.4 && < 5,
4646 binary >= 0.5 && < 0.8,
47− deepseq >= 1.3.0.1 && < 1.4,
4847 hashable >= 1.2.0.5 && < 1.3,
4948 network-transport >= 0.3 && < 0.4,
5049 stm >= 2.4 && < 2.5,
@@ -52,7 +51,6 @@ Library
5251 mtl >= 2.0 && < 2.2,
5352 data-accessor >= 0.2 && < 0.3,
5453 bytestring >= 0.9 && < 0.11,
55− containers >= 0.4 && < 0.6,
5654 old-locale >= 1.0 && < 1.1,
5755 time >= 1.2 && < 1.5,
5856 random >= 1.0 && < 1.1,
@@ -99,8 +97,17 @@ Library
9997 BangPatterns
10098 ghc-options: -Wall
10199 HS-Source-Dirs: src
100+ if impl(ghc <= 7.4.2)
101+ Build-Depends: containers >= 0.4 && < 0.5,
102+ deepseq == 1.3.0.0
103+ else
104+ Build-Depends: containers >= 0.4 && < 0.6,
105+ deepseq >= 1.3.0.1 && < 1.4
102106 if flag(th)
103− Build-Depends: template-haskell >= 2.6 && < 2.9
107+ if impl(ghc <= 7.4.2)
108+ Build-Depends: template-haskell >= 2.7 && < 2.8
109+ else
110+ Build-Depends: template-haskell >= 2.6 && < 2.9
104111 Exposed-modules: Control.Distributed.Process.Internal.Closure.TH
105112 CPP-Options: -DTemplateHaskellSupport
106113
src/Control/Distributed/Process/Management/Table.hs+5−5
@@ -49,8 +49,8 @@ import Control.Distributed.Process.Serializable (Serializable)
4949import Control.Monad.IO.Class (liftIO)
5050import Data.Accessor (Accessor, accessor, (^=), (^:))
5151import Data.Binary (Binary)
52−import Data.Map.Strict (Map)
53−import qualified Data.Map.Strict as Map
52+import Data.Map (Map)
53+import qualified Data.Map as Map
5454import Data.Typeable (Typeable)
5555
5656import GHC.Generics
@@ -181,7 +181,7 @@ startTableCoordinator fork = run Map.empty
181181 , _entries = Map.empty
182182 }
183183 (pid, _) <- spawnSup $ tableHandler initState
184− return $ (pid, Map.insert mxId pid tblMap)
184+ return $ (pid, mxId `seq` pid `seq` Map.insert mxId pid tblMap)
185185
186186 spawnSup proc = do
187187 us <- getSelfPid
@@ -204,8 +204,8 @@ tableHandler state = do
204204 where
205205 handleTableRequest _ Delete = return Nothing
206206 handleTableRequest st Purge = return $ Just $ (entries ^= Map.empty) $ st
207− handleTableRequest st (Clear k) = return $ Just $ (entries ^: Map.delete k) $ st
208− handleTableRequest st (Set k v) = return $ Just $ (entries ^: Map.insert k v) st
207+ handleTableRequest st (Clear k) = return $ Just $ (entries ^: (k `seq` Map.delete k)) $ st
208+ handleTableRequest st (Set k v) = return $ Just $ (entries ^: (k `seq` v `seq` Map.insert k v)) st
209209 handleTableRequest st (Get k c) = getEntry k c st >> return (Just st)
210210
211211getEntry :: String