Skip to content

Commit

Permalink
Prepare upgrading to ghc9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed Nov 24, 2023
1 parent 1647f31 commit 60a4776
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
12 changes: 11 additions & 1 deletion common/base/HStream/Logger.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE PatternSynonyms #-}
Expand Down Expand Up @@ -60,7 +61,7 @@ import Control.Exception (finally)
import Control.Monad (forever, when)
import Data.IORef (IORef, atomicWriteIORef,
newIORef, readIORef)
import Foreign.C.Types (CInt (..))
import Foreign.C.Types
import GHC.Conc.Sync (ThreadId (..), myThreadId)
import GHC.Exts (ThreadId#)
import GHC.Stack
Expand Down Expand Up @@ -409,4 +410,13 @@ logBylevel flushLevel level cstack s = do

-------------------------------------------------------------------------------

-- this cannot be capi, as GHC panics.
#if __GLASGOW_HASKELL__ >= 904
-- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6163
foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CULLong
#elif __GLASGOW_HASKELL__ >= 900
-- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/1254
foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CLong
#else
foreign import ccall unsafe "rts_getThreadId" getThreadId :: ThreadId# -> CInt
#endif
2 changes: 1 addition & 1 deletion common/hstream/hstream-common.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ library
, hsc2hs:hsc2hs

build-depends:
, aeson >=1.5 && <2.0 || ^>=2.0
, aeson >=1.5 && <2.0 || ^>=2.1
, ansi-terminal
, async
, attoparsec
Expand Down
2 changes: 1 addition & 1 deletion hstream-sql/hstream-sql.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ library
, rio
, scientific
, string-random
, text ^>=1.2
, text
, time >=1.9.1 && <2
, time-compat
, unordered-containers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import GHC.Stack (HasCallStack,
import qualified Z.Data.CBytes as CBytes
import Z.Data.CBytes (CBytes)
import qualified Z.Foreign as Z
#if __GLASGOW_HASKELL__ >= 904
import GHC.Exts (ArrayArray# (ArrayArray#))
#endif

import HStream.Foreign
import qualified HStream.Store.Exception as E
Expand Down
3 changes: 3 additions & 0 deletions hstream-store/HStream/Store/Internal/LogDevice/Writer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import Z.Data.CBytes (CBytes)
import qualified Z.Data.Vector as V
import Z.Data.Vector (Bytes)
import qualified Z.Foreign as Z
#if __GLASGOW_HASKELL__ >= 904
import GHC.Exts (ArrayArray# (ArrayArray#))
#endif

import qualified HStream.Store.Exception as E
import HStream.Store.Internal.Foreign
Expand Down
12 changes: 6 additions & 6 deletions hstream-store/hstream-store.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ library
HStream.Store.Stream

build-depends:
, base >=4.13 && <5
, bytestring >=0.10 && <0.12
, base >=4.13 && <5
, bytestring >=0.10 && <0.12
, cache ^>=0.1
, containers ^>=0.6
, data-default ^>=0.7
, filepath ^>=1.4.2
, ghc-prim >=0.5 && <1.0
, hashable >=1.3.5 && <1.5
, filepath
, ghc-prim >=0.5 && <1.0
, hashable >=1.3.5 && <1.5
, hstream-common-base
, primitive ^>=0.7
, text
, vector >=0.12 && <0.14
, vector >=0.12 && <0.14
, vector-algorithms ^>=0.9
, Z-Data

Expand Down

0 comments on commit 60a4776

Please sign in to comment.