Skip to content

Add MR2537-use-one-shot-kqueue-on-macos.patch #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ in {
++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch
++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch
++ always ./patches/ghc/respect-ar-path.patch

++ until "8.12" ./patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch
++ final.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch
++ final.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch
++ final.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch
Expand Down
52 changes: 52 additions & 0 deletions overlays/patches/ghc/MR2537-use-one-shot-kqueue-on-macos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 41117d71bb58e001f6a2b6a11c9314d5b70b9182 Mon Sep 17 00:00:00 2001
From: Ben Gamari <[email protected]>
Date: Thu, 23 Jan 2020 14:11:20 -0500
Subject: [PATCH] base: Use one-shot kqueue on macOS

The underlying reason requiring that one-shot usage be disabled (#13903)
has been fixed.

Closes #15768.
---
libraries/base/GHC/Event/Manager.hs | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs
index eda3e61490..51306795fe 100644
--- a/libraries/base/GHC/Event/Manager.hs
+++ b/libraries/base/GHC/Event/Manager.hs
@@ -150,9 +150,7 @@ callbackTableVar mgr fd = emFds mgr ! hashFd fd

haveOneShot :: Bool
{-# INLINE haveOneShot #-}
-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
-haveOneShot = False
-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
haveOneShot = True
#else
haveOneShot = False
@@ -365,20 +363,9 @@ 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:
- http://ghc.haskell.org/trac/ghc/ticket/7651
--}
-- | Wake up the event manager.
wakeManager :: EventManager -> IO ()
-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
-wakeManager mgr = sendWakeup (emControl mgr)
-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
wakeManager _ = return ()
#else
wakeManager mgr = sendWakeup (emControl mgr)
--
2.25.0