on develop help sign in
Merge remote-tracking branch 'origin/develop' into fast-weak-partial-requester
commit41bc90ef4b215870c661098974c24c85a977ec54 authorRyan Trinkle <ryan.trinkle@gmail.com> dateMon 14 Aug 2017, 15:01 (9 years ago) parent5a95b46f3b3101
7 files changed+21−8
default.nix+1−1 reflex-dom-core/default.nix+7−4 reflex-dom-core/reflex-dom-core.cabal+2 reflex-dom-core/src/Foreign/JavaScript/TH.hs+2 reflex-dom-core/src/Reflex/Dom/Builder/Class.hs+1−1 reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs+1−1 reflex-dom-core/test/gc.hs+7−1
default.nix+1−1
@@ -1,6 +1,6 @@
11haskellPackages: nixpkgs: {
22 reflex-dom = haskellPackages.callPackage ./reflex-dom {};
33 reflex-dom-core = haskellPackages.callPackage ./reflex-dom-core {
4− inherit (nixpkgs) xvfb_run chromium;
4+ inherit (nixpkgs) iproute chromium;
55 };
66}
reflex-dom-core/default.nix+7−4
@@ -4,12 +4,12 @@
44, exception-transformers, ghcjs-dom, hlint, jsaddle, keycode, lens
55, monad-control, mtl, primitive, random, ref-tf, reflex, semigroups
66, stdenv, stm, template-haskell, temporary, text, these, time
7−, transformers, unbounded-delays, unix, zenc, hashable, xvfb_run
8−, chromium, process, jsaddle-warp
7+, transformers, unbounded-delays, unix, zenc, hashable
8+, chromium, process, jsaddle-warp, linux-namespaces, iproute
99}:
1010let addGcTestDepends = drv: if stdenv.system != "x86_64-linux" then drv else drv // {
11− testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process ];
12− testSystemDepends = (drv.testSystemDepends or []) ++ [ xvfb_run chromium ];
11+ testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process linux-namespaces ];
12+ testSystemDepends = (drv.testSystemDepends or []) ++ [ chromium iproute ];
1313 };
1414in mkDerivation (addGcTestDepends {
1515 pname = "reflex-dom-core";
@@ -31,6 +31,9 @@ in mkDerivation (addGcTestDepends {
3131 export HOME="$PWD"
3232 '';
3333
34+ # Show some output while running tests, so we might notice what's wrong
35+ testTarget = "--show-details=streaming";
36+
3437 testHaskellDepends = [ base hlint ];
3538 description = "Functional Reactive Web Apps with Reflex";
3639 license = stdenv.lib.licenses.bsd3;
reflex-dom-core/reflex-dom-core.cabal+2
@@ -155,8 +155,10 @@ test-suite gc
155155 , reflex-dom-core
156156 , jsaddle
157157 , jsaddle-warp
158+ , linux-namespaces
158159 , process
159160 , temporary
161+ , unix
160162 hs-source-dirs: test
161163 ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
162164 ghc-prof-options: -fprof-auto
reflex-dom-core/src/Foreign/JavaScript/TH.hs+2
@@ -285,6 +285,7 @@ class Monad m => MonadJS x m | m -> x where
285285#ifdef ghcjs_HOST_OS
286286
287287data JSCtx_IO
288+type HasJS' = HasJS JSCtx_IO
288289
289290instance MonadIO m => HasJS JSCtx_IO (WithJSContextSingleton x m) where
290291 type JSX (WithJSContextSingleton x m) = IO
@@ -335,6 +336,7 @@ foreign import javascript unsafe "function(){ return $1(arguments); }" funWithAr
335336#else
336337
337338data JSCtx_JavaScriptCore x
339+type HasJS' = HasJS (JSCtx_JavaScriptCore ())
338340
339341instance IsJSContext (JSCtx_JavaScriptCore x) where
340342 newtype JSRef (JSCtx_JavaScriptCore x) = JSRef_JavaScriptCore { unJSRef_JavaScriptCore :: JSVal }
reflex-dom-core/src/Reflex/Dom/Builder/Class.hs+1−1
@@ -635,7 +635,7 @@ type LiftDomBuilder t f m =
635635
636636class MonadTransControl t => MonadTransControlStateless t where
637637 stTCoercion :: proxy t -> Coercion (StT t a) a
638− default stTCoercion :: proxy t -> Coercion a a
638+ default stTCoercion :: (a ~ StT t a) => proxy t -> Coercion (StT t a) a
639639 stTCoercion _ = Control.Category.id
640640
641641toStT :: MonadTransControlStateless t => proxy t -> a -> StT t a
reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs+1−1
@@ -243,7 +243,7 @@ runImmediateDomBuilderT (ImmediateDomBuilderT a) env eventChan = do
243243
244244class Monad m => HasDocument m where
245245 askDocument :: m Document
246− default askDocument :: (m ~ f m', MonadTrans f, Monad m', HasDocument m') => f m' Document
246+ default askDocument :: (m ~ f m', MonadTrans f, Monad m', HasDocument m') => m Document
247247 askDocument = lift askDocument
248248
249249instance HasDocument m => HasDocument (ReaderT r m)
reflex-dom-core/test/gc.hs+7−1
@@ -10,7 +10,9 @@ import Language.Javascript.JSaddle.Warp
1010import Reflex.Dom.Core
1111import System.Exit
1212import System.IO.Temp
13+import System.Linux.Namespaces
1314import System.Mem
15+import System.Posix
1416import System.Process
1517
1618-- In initial testing, the minimum live bytes count was 233128 and maximum was
@@ -32,12 +34,16 @@ failureLimit = 0
3234
3335main :: IO ()
3436main = do
37+ uid <- getEffectiveUserID
38+ unshare [User, Network]
39+ writeUserMappings Nothing [UserMapping 0 uid 1]
3540 mainThread <- myThreadId
3641 withSystemTempDirectory "reflex-dom-core_test_gc" $ \tmp -> do
37− browserProcess <- spawnCommand $ "xvfb-run -a chromium --disable-gpu --user-data-dir=" ++ tmp ++ " http://localhost:3911"
42+ browserProcess <- spawnCommand $ "ip link set lo up ; ip addr ; sleep 1 ; echo 'Starting Chromium' ; chromium --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 --user-data-dir=" ++ tmp ++ " http://localhost:3911 ; echo 'Chromium exited'"
3843 let finishTest result = do
3944 interruptProcessGroupOf browserProcess
4045 throwTo mainThread result
46+ putStrLn "About to start the server"
4147 run 3911 $ do
4248 -- enableLogging True
4349 liftIO $ putStrLn "Running..."