Opened 6 years ago

Closed 6 years ago

#9275 closed bug (fixed)

Missing import statement in GHC.Event.Poll

Reported by: ydewit Owned by: rwbarton
Priority: normal Milestone:
Component: libraries/base Version: 7.8.2
Keywords: Cc: hvr, ekmett
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by ydewit)

See the following section from base's GHC.Event.Poll module:

module GHC.Event.Poll
    , available
    ) where

#include "EventConfig.h"

#if !defined(HAVE_POLL_H)
import GHC.Base

new :: IO E.Backend
new = error "Poll back end not implemented for this platform"

available :: Bool
available = False
{-# INLINE available #-}
#include <poll.h>

import Control.Concurrent.MVar (MVar, newMVar, swapMVar)
import Control.Monad ((=<<), liftM, liftM2, unless)
import Data.Bits (Bits, FiniteBits, (.|.), (.&.))
import Data.Maybe (Maybe(..))
import Data.Monoid (Monoid(..))
import Data.Word
import Foreign.C.Types (CInt(..), CShort(..))
import Foreign.Ptr (Ptr)
import Foreign.Storable (Storable(..))
import GHC.Base
import GHC.Conc.Sync (withMVar)
import GHC.Enum (maxBound)
import GHC.Num (Num(..))
import GHC.Real (ceiling, fromIntegral)
import GHC.Show (Show)
import System.Posix.Types (Fd(..))

import qualified GHC.Event.Array as A
import qualified GHC.Event.Internal as E

Note how there is a missing import qualified GHC.Event.Internal as E when HAVE_POLL_H is not defined.

The same issue is present in master.

This is the error seen (note this is a custom haste build):

Building base-
Preprocessing library base-
hastec: setNumCapabilities: not supported in the non-threaded RTS

    Not in scope: type constructor or class ‘E.Backend’

Change History (5)

comment:1 Changed 6 years ago by ydewit

Description: modified (diff)

comment:2 Changed 6 years ago by ydewit

Status: newpatch

Here is the patch:

diff --git a/GHC/Event/Poll.hsc b/GHC/Event/Poll.hsc
index bb0b6e5..2ed25be 100644
--- a/GHC/Event/Poll.hsc
+++ b/GHC/Event/Poll.hsc
@@ -14,6 +14,7 @@ module GHC.Event.Poll
 #if !defined(HAVE_POLL_H)
 import GHC.Base
+import qualified GHC.Event.Internal as E
 new :: IO E.Backend
 new = error "Poll back end not implemented for this platform"

comment:3 Changed 6 years ago by rwbarton

Owner: set to rwbarton

comment:4 Changed 6 years ago by Reid Barton <rwbarton@…>

In fa8553de237a2f91f8551d69ef604c1d8a007b5f/ghc:

Fix imports in GHC.Event.Poll when not HAVE_POLL_H (#9275)

Though as far as I can tell, we can never successfully build under
this configuration anyways: GHC.Event.TimerManager requires the Poll
backend to be functional.

comment:5 Changed 6 years ago by rwbarton

Resolution: fixed
Status: patchclosed

Thanks, applied.

Note: See TracTickets for help on using tickets.