Skip to content

Commit ec18bc6

Browse files
committed
Fix building and testing with the JS backend
Note that most tests have been disabled because they don't pass due to missing C function support (e.g. pipe). But it's a good basis to start adding tests for supported things (e.g. touchFd, cf haskell#285). This requires a recent version of GHC that provides getMonotonicTimeNSec. See https://gitlab.haskell.org/ghc/ghc/-/issues/23687 and https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10900.
1 parent b104a7f commit ec18bc6

File tree

5 files changed

+2423
-1990
lines changed

5 files changed

+2423
-1990
lines changed

System/Posix/Signals.hsc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,17 @@ import System.Posix.Process
112112
import System.Posix.Process.Internals
113113
import Data.Dynamic
114114

115+
#if defined(javascript_HOST_ARCH)
116+
-- These signals aren't supported by the JS RTS
117+
-- and the header isn't exposed.
118+
##define STG_SIG_DFL (-1)
119+
##define STG_SIG_IGN (-2)
120+
##define STG_SIG_ERR (-3)
121+
##define STG_SIG_HAN (-4)
122+
##define STG_SIG_RST (-5)
123+
#else
115124
##include "rts/Signals.h"
125+
#endif
116126

117127
import GHC.Conc hiding (Signal)
118128

0 commit comments

Comments
 (0)