File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ library
110110 if flag(Agda-2-7-0-1)
111111 build-depends :
112112 Agda == 2.7.0.1
113+ if arch(wasm32)
114+ build-depends :
115+ unix >= 2.8.0.0 && < 2.9
113116
114117executable als
115118 main-is : Main.hs
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ import qualified Server.Handler as Handler
2828import Switchboard (Switchboard , agdaCustomMethod )
2929import qualified Switchboard
3030
31+ #if defined(wasm32_HOST_ARCH)
32+ import Agda.Utils.IO (catchIO )
33+ import System.IO (hPutStrLn , stderr )
34+ import System.Posix.IO (stdInput , setFdOption , FdOption (.. ))
35+ #endif
36+
3137--------------------------------------------------------------------------------
3238
3339run :: Options -> IO Int
@@ -44,6 +50,10 @@ run options = do
4450 -- Switchboard.destroy switchboard
4551 return 0
4652 Nothing -> do
53+ # if defined(wasm32_HOST_ARCH)
54+ liftIO $ setFdOption stdInput NonBlockingRead True
55+ `catchIO` (\ e -> hPutStrLn stderr $ " Failed to enable nonblocking on stdin: " ++ (show e) ++ " \n The WASM module might not behave correctly." )
56+ # endif
4757 runServer (serverDefn options)
4858 where
4959 serverDefn :: Options -> ServerDefinition Config
You can’t perform that action at this time.
0 commit comments