on develop help sign in
Merge remote-tracking branch 'origin/develop' into fast-weak-partial-requester
41bc90eRyan Trinkle
default.nix+1−1
@@ -1,6 +1,6 @@
1haskellPackages: nixpkgs: {
1haskellPackages: nixpkgs: {
2 reflex-dom = haskellPackages.callPackage ./reflex-dom {};
2 reflex-dom = haskellPackages.callPackage ./reflex-dom {};
3 reflex-dom-core = haskellPackages.callPackage ./reflex-dom-core {
3 reflex-dom-core = haskellPackages.callPackage ./reflex-dom-core {
4− inherit (nixpkgs) xvfb_run chromium;
4+ inherit (nixpkgs) iproute chromium;
5 };
5 };
6}
6}
reflex-dom-core/default.nix+7−4
@@ -4,12 +4,12 @@
4, exception-transformers, ghcjs-dom, hlint, jsaddle, keycode, lens
4, exception-transformers, ghcjs-dom, hlint, jsaddle, keycode, lens
5, monad-control, mtl, primitive, random, ref-tf, reflex, semigroups
5, monad-control, mtl, primitive, random, ref-tf, reflex, semigroups
6, stdenv, stm, template-haskell, temporary, text, these, time
6, stdenv, stm, template-haskell, temporary, text, these, time
7−, transformers, unbounded-delays, unix, zenc, hashable, xvfb_run
7+, transformers, unbounded-delays, unix, zenc, hashable
8−, chromium, process, jsaddle-warp
8+, chromium, process, jsaddle-warp, linux-namespaces, iproute
9}:
9}:
10let addGcTestDepends = drv: if stdenv.system != "x86_64-linux" then drv else drv // {
10let addGcTestDepends = drv: if stdenv.system != "x86_64-linux" then drv else drv // {
11− testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process ];
11+ testHaskellDepends = (drv.testHaskellDepends or []) ++ [ temporary jsaddle-warp process linux-namespaces ];
12− testSystemDepends = (drv.testSystemDepends or []) ++ [ xvfb_run chromium ];
12+ testSystemDepends = (drv.testSystemDepends or []) ++ [ chromium iproute ];
13 };
13 };
14in mkDerivation (addGcTestDepends {
14in mkDerivation (addGcTestDepends {
15 pname = "reflex-dom-core";
15 pname = "reflex-dom-core";
@@ -31,6 +31,9 @@ in mkDerivation (addGcTestDepends {
31 export HOME="$PWD"
31 export HOME="$PWD"
32 '';
32 '';
33
33
34+ # Show some output while running tests, so we might notice what's wrong
35+ testTarget = "--show-details=streaming";
36+
34 testHaskellDepends = [ base hlint ];
37 testHaskellDepends = [ base hlint ];
35 description = "Functional Reactive Web Apps with Reflex";
38 description = "Functional Reactive Web Apps with Reflex";
36 license = stdenv.lib.licenses.bsd3;
39 license = stdenv.lib.licenses.bsd3;
reflex-dom-core/reflex-dom-core.cabal+2
@@ -155,8 +155,10 @@ test-suite gc
155 , reflex-dom-core
155 , reflex-dom-core
156 , jsaddle
156 , jsaddle
157 , jsaddle-warp
157 , jsaddle-warp
158+ , linux-namespaces
158 , process
159 , process
159 , temporary
160 , temporary
161+ , unix
160 hs-source-dirs: test
162 hs-source-dirs: test
161 ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
163 ghc-options: -rtsopts -with-rtsopts=-T -Wall -fwarn-tabs -funbox-strict-fields -O2 -ferror-spans
162 ghc-prof-options: -fprof-auto
164 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
285#ifdef ghcjs_HOST_OS
285#ifdef ghcjs_HOST_OS
286
286
287data JSCtx_IO
287data JSCtx_IO
288+type HasJS' = HasJS JSCtx_IO
288
289
289instance MonadIO m => HasJS JSCtx_IO (WithJSContextSingleton x m) where
290instance MonadIO m => HasJS JSCtx_IO (WithJSContextSingleton x m) where
290 type JSX (WithJSContextSingleton x m) = IO
291 type JSX (WithJSContextSingleton x m) = IO
@@ -335,6 +336,7 @@ foreign import javascript unsafe "function(){ return $1(arguments); }" funWithAr
335#else
336#else
336
337
337data JSCtx_JavaScriptCore x
338data JSCtx_JavaScriptCore x
339+type HasJS' = HasJS (JSCtx_JavaScriptCore ())
338
340
339instance IsJSContext (JSCtx_JavaScriptCore x) where
341instance IsJSContext (JSCtx_JavaScriptCore x) where
340 newtype JSRef (JSCtx_JavaScriptCore x) = JSRef_JavaScriptCore { unJSRef_JavaScriptCore :: JSVal }
342 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 =
635
635
636class MonadTransControl t => MonadTransControlStateless t where
636class MonadTransControl t => MonadTransControlStateless t where
637 stTCoercion :: proxy t -> Coercion (StT t a) a
637 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
639 stTCoercion _ = Control.Category.id
639 stTCoercion _ = Control.Category.id
640
640
641toStT :: MonadTransControlStateless t => proxy t -> a -> StT t a
641toStT :: 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
243
243
244class Monad m => HasDocument m where
244class Monad m => HasDocument m where
245 askDocument :: m Document
245 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
247 askDocument = lift askDocument
247 askDocument = lift askDocument
248
248
249instance HasDocument m => HasDocument (ReaderT r m)
249instance HasDocument m => HasDocument (ReaderT r m)
reflex-dom-core/test/gc.hs+7−1
@@ -10,7 +10,9 @@ import Language.Javascript.JSaddle.Warp
10import Reflex.Dom.Core
10import Reflex.Dom.Core
11import System.Exit
11import System.Exit
12import System.IO.Temp
12import System.IO.Temp
13+import System.Linux.Namespaces
13import System.Mem
14import System.Mem
15+import System.Posix
14import System.Process
16import System.Process
15
17
16-- In initial testing, the minimum live bytes count was 233128 and maximum was
18-- In initial testing, the minimum live bytes count was 233128 and maximum was
@@ -32,12 +34,16 @@ failureLimit = 0
32
34
33main :: IO ()
35main :: IO ()
34main = do
36main = do
37+ uid <- getEffectiveUserID
38+ unshare [User, Network]
39+ writeUserMappings Nothing [UserMapping 0 uid 1]
35 mainThread <- myThreadId
40 mainThread <- myThreadId
36 withSystemTempDirectory "reflex-dom-core_test_gc" $ \tmp -> do
41 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'"
38 let finishTest result = do
43 let finishTest result = do
39 interruptProcessGroupOf browserProcess
44 interruptProcessGroupOf browserProcess
40 throwTo mainThread result
45 throwTo mainThread result
46+ putStrLn "About to start the server"
41 run 3911 $ do
47 run 3911 $ do
42 -- enableLogging True
48 -- enableLogging True
43 liftIO $ putStrLn "Running..."
49 liftIO $ putStrLn "Running..."