Skip to content

Commit f330b24

Browse files
authored
Add MR2537-use-one-shot-kqueue-on-macos.patch (#604)
This adds the one-shot-kqueue-on-macos MR from gitlab.
1 parent 2d1d4cc commit f330b24

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ in {
101101
++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch
102102
++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch
103103
++ always ./patches/ghc/respect-ar-path.patch
104-
104+
++ until "8.12" ./patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch
105105
++ final.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch
106106
++ final.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch
107107
++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 41117d71bb58e001f6a2b6a11c9314d5b70b9182 Mon Sep 17 00:00:00 2001
2+
From: Ben Gamari <[email protected]>
3+
Date: Thu, 23 Jan 2020 14:11:20 -0500
4+
Subject: [PATCH] base: Use one-shot kqueue on macOS
5+
6+
The underlying reason requiring that one-shot usage be disabled (#13903)
7+
has been fixed.
8+
9+
Closes #15768.
10+
---
11+
libraries/base/GHC/Event/Manager.hs | 17 ++---------------
12+
1 file changed, 2 insertions(+), 15 deletions(-)
13+
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
19+
20+
haveOneShot :: Bool
21+
{-# INLINE haveOneShot #-}
22+
-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
23+
-haveOneShot = False
24+
-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
25+
+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
26+
haveOneShot = True
27+
#else
28+
haveOneShot = False
29+
@@ -365,20 +363,9 @@ registerFd mgr cb fd evs lt = do
30+
return r
31+
{-# INLINE registerFd #-}
32+
33+
-{-
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.
38+
-
39+
- For more information, please read:
40+
- http://ghc.haskell.org/trac/ghc/ticket/7651
41+
--}
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 ()
49+
#else
50+
wakeManager mgr = sendWakeup (emControl mgr)
51+
--
52+
2.25.0

0 commit comments

Comments
 (0)