Allow base-4.17, ghc-9.4

Increase benchmark memory for ghc-9.5
This commit is contained in:
Harendra Kumar 2022-07-16 15:48:14 +05:30
parent d0ed396d11
commit efa19570f8
6 changed files with 34 additions and 12 deletions

View File

@ -35,6 +35,9 @@ where
import Control.DeepSeq (NFData(rnf))
import Data.Char (ord, chr)
#if MIN_VERSION_base(4,17,0)
import Data.Char (generalCategory, GeneralCategory(Space))
#endif
import Data.Word (Word8)
import System.Directory (getFileSize)
import System.Environment (lookupEnv)
@ -140,8 +143,10 @@ mkBenchSmall name env action =
useSmallH (RefHandles {smallInH = inh, outputH = outh}) = Handles inh outh
#if !MIN_VERSION_base(4,17,0)
foreign import ccall unsafe "u_iswspace"
iswspace :: Int -> Int
#endif
-- Code copied from base/Data.Char to INLINE it
{-# INLINE isSpace #-}
@ -154,7 +159,11 @@ isSpace :: Char -> Bool
-- so we'll do it like this until there's a way around that.
isSpace c
| uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
#if MIN_VERSION_base(4,17,0)
| otherwise = generalCategory c == Space
#else
| otherwise = iswspace (ord c) /= 0
#endif
where
uc = fromIntegral (ord c) :: Word

View File

@ -120,7 +120,7 @@ common bench-depends
-- Core libraries shipped with ghc, the min and max
-- constraints of these libraries should match with
-- the GHC versions we support
base >= 4.9 && < 4.17
base >= 4.9 && < 4.18
, deepseq >= 1.4.1 && < 1.5
, mtl >= 2.2 && < 2.3
@ -133,7 +133,7 @@ common bench-depends
, process >= 1.4 && < 1.7
, directory >= 1.2.2 && < 1.4
, filepath >= 1.4.1 && < 1.5
, ghc-prim >= 0.4 && < 0.9
, ghc-prim >= 0.4 && < 0.10
if flag(bench-core)
build-depends: streamly-core
@ -155,9 +155,8 @@ common bench-depends
build-depends:
fusion-plugin >= 0.2 && < 0.3
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.17
build-depends: template-haskell >= 2.14 && < 2.20
, inspection-testing >= 0.4 && < 0.5
, ghc-prim >= 0.2 && < 0.9
-- Array uses a Storable constraint in dev build making several inspection
-- tests fail
if flag(dev) && flag(inspection)
@ -582,6 +581,8 @@ benchmark FileSystem.Handle
other-modules:
Handle.Read
, Handle.ReadWrite
if flag(limit-build-mem)
ghc-options: +RTS -M1000M -RTS
if flag(bench-core)
buildable: False
else
@ -596,6 +597,8 @@ benchmark Unicode.Stream
type: exitcode-stdio-1.0
hs-source-dirs: Streamly/Benchmark/Unicode
main-is: Stream.hs
if flag(limit-build-mem)
ghc-options: +RTS -M1000M -RTS
if flag(bench-core)
buildable: False
else

View File

@ -24,4 +24,6 @@ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
source-repository-package
type: git
location: https://github.com/composewell/fusion-plugin
tag: 5fc7a38c9106e643b5ebde61400d54813a071d7b
tag: 25aa89c97aaaf83209d4282638ef774780061366
allow-newer: all

View File

@ -341,12 +341,12 @@ library
-- packages depending on the "ghc" package (packages
-- depending on doctest is a common example) can
-- depend on streamly.
base >= 4.9 && < 4.17
base >= 4.9 && < 4.18
, containers >= 0.5 && < 0.7
, deepseq >= 1.4.1 && < 1.5
, directory >= 1.2.2 && < 1.4
, exceptions >= 0.8 && < 0.11
, ghc-prim >= 0.2 && < 0.9
, ghc-prim >= 0.2 && < 0.10
, mtl >= 2.2 && < 2.3
, transformers >= 0.4 && < 0.7
, filepath >= 1.2.0.0 && < 1.5

View File

@ -85,6 +85,9 @@ import Control.Monad.Catch (MonadThrow(..), MonadCatch)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Data.Bits (shiftR, shiftL, (.|.), (.&.))
import Data.Char (chr, ord)
#if MIN_VERSION_base(4,17,0)
import Data.Char (generalCategory, GeneralCategory(Space))
#endif
import Data.Word (Word8)
import Foreign.Storable (Storable(..))
import Fusion.Plugin.Types (Fuse(..))
@ -1036,15 +1039,21 @@ stripHead = S.dropWhile isSpace
lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
lines = S.splitOnSuffix (== '\n')
#if !MIN_VERSION_base(4,17,0)
foreign import ccall unsafe "u_iswspace"
iswspace :: Int -> Int
#endif
-- | Code copied from base/Data.Char to INLINE it
{-# INLINE isSpace #-}
isSpace :: Char -> Bool
isSpace c
| uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
#if MIN_VERSION_base(4,17,0)
| otherwise = generalCategory c == Space
#else
| otherwise = iswspace (ord c) /= 0
#endif
where
uc = fromIntegral (ord c) :: Word

View File

@ -679,16 +679,16 @@ library
-- packages depending on the "ghc" package (packages
-- depending on doctest is a common example) can
-- depend on streamly.
base >= 4.9 && < 4.17
base >= 4.9 && < 4.18
, containers >= 0.5 && < 0.7
, deepseq >= 1.4.1 && < 1.5
, directory >= 1.2.2 && < 1.4
, exceptions >= 0.8 && < 0.11
, ghc-prim >= 0.2 && < 0.9
, ghc-prim >= 0.2 && < 0.10
, mtl >= 2.2 && < 2.3
, transformers >= 0.4 && < 0.7
, filepath >= 1.2.0.0 && < 1.5
, template-haskell >= 2.13 && < 2.19
, template-haskell >= 2.13 && < 2.20
-- The core streamly package
, streamly-core == 0.1.0
@ -716,8 +716,7 @@ library
frameworks: Cocoa
if flag(inspection)
build-depends: template-haskell >= 2.14 && < 2.17
, inspection-testing >= 0.4 && < 0.5
build-depends: inspection-testing >= 0.4 && < 0.5
-- Array uses a Storable constraint in dev build making several inspection
-- tests fail