@@ -0,0 +1,52 @@
1+From 41117d71bb58e001f6a2b6a11c9314d5b70b9182 Mon Sep 17 00:00:00 2001
2+From: Ben Gamari <ben@smart-cactus.org>
3+Date: Thu, 23 Jan 2020 14:11:20 -0500
4+Subject: [PATCH] base: Use one-shot kqueue on macOS
6+The underlying reason requiring that one-shot usage be disabled (#13903)
11+ libraries/base/GHC/Event/Manager.hs | 17 ++---------------
12+ 1 file changed, 2 insertions(+), 15 deletions(-)
14+diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs
15+index eda3e61490..51306795fe 100644
16+--- a/libraries/base/GHC/Event/Manager.hs
17++++ b/libraries/base/GHC/Event/Manager.hs
18+@@ -150,9 +150,7 @@ callbackTableVar mgr fd = emFds mgr ! hashFd fd
21+ {-# INLINE haveOneShot #-}
22+-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
24+-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
25++#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
29+@@ -365,20 +363,9 @@ registerFd mgr cb fd evs lt = do
31+ {-# INLINE registerFd #-}
34+- Building GHC with parallel IO manager on Mac freezes when
35+- compiling the dph libraries in the phase 2. As workaround, we
36+- don't use oneshot and we wake up an IO manager on Mac every time
37+- when we register an event.
39+- For more information, please read:
40+- http://ghc.haskell.org/trac/ghc/ticket/7651
42+ -- | Wake up the event manager.
43+ wakeManager :: EventManager -> IO ()
44+-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
45+-wakeManager mgr = sendWakeup (emControl mgr)
46+-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
47++#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
48+ wakeManager _ = return ()
50+ wakeManager mgr = sendWakeup (emControl mgr)