summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-11-16 15:38:24 +0000
committerZubin Duggal <zubin.duggal@gmail.com>2021-12-16 16:21:09 +0530
commit5bccb7b85505798873ae02a233020be1fa548229 (patch)
tree10978ba9f5b764b7da8a64f73e7254cd8d3db493
parentc92d040d0175636138848285c15cc37365319050 (diff)
downloadhaskell-5bccb7b85505798873ae02a233020be1fa548229.tar.gz
Revert "base: Use one-shot kqueue on macOS"
This reverts commit 41117d71bb58e001f6a2b6a11c9314d5b70b9182 (cherry picked from commit f8c1c549bbb02cb0a943a9ae49dee922c96d85c4)
-rw-r--r--libraries/base/GHC/Event/Manager.hs17
1 files changed, 15 insertions, 2 deletions
diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs
index 51306795fe..eda3e61490 100644
--- a/libraries/base/GHC/Event/Manager.hs
+++ b/libraries/base/GHC/Event/Manager.hs
@@ -150,7 +150,9 @@ callbackTableVar mgr fd = emFds mgr ! hashFd fd
haveOneShot :: Bool
{-# INLINE haveOneShot #-}
-#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
+haveOneShot = False
+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
haveOneShot = True
#else
haveOneShot = False
@@ -363,9 +365,20 @@ registerFd mgr cb fd evs lt = do
return r
{-# INLINE registerFd #-}
+{-
+ Building GHC with parallel IO manager on Mac freezes when
+ compiling the dph libraries in the phase 2. As workaround, we
+ don't use oneshot and we wake up an IO manager on Mac every time
+ when we register an event.
+
+ For more information, please read:
+ https://gitlab.haskell.org/ghc/ghc/issues/7651
+-}
-- | Wake up the event manager.
wakeManager :: EventManager -> IO ()
-#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
+wakeManager mgr = sendWakeup (emControl mgr)
+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
wakeManager _ = return ()
#else
wakeManager mgr = sendWakeup (emControl mgr)