on master help sign in
Allow base-4.17, ghc-9.4

Increase benchmark memory for ghc-9.5

commitefa19570f8ef93650faab12b400043fde2c88390 authorHarendra Kumar <harendra@composewell.com> dateSat 16 Jul 2022, 15:48 (4 years ago) parentd0ed396
6 files changed+34−12
benchmark/lib/Streamly/Benchmark/Common/Handle.hs+9 benchmark/streamly-benchmarks.cabal+7−4 cabal.project.ghc-head+3−1 core/streamly-core.cabal+2−2 src/Streamly/Internal/Unicode/Stream.hs+9 streamly.cabal+4−5
benchmark/lib/Streamly/Benchmark/Common/Handle.hs+9
@@ -35,6 +35,9 @@ where
3535
3636import Control.DeepSeq (NFData(rnf))
3737import Data.Char (ord, chr)
38+#if MIN_VERSION_base(4,17,0)
39+import Data.Char (generalCategory, GeneralCategory(Space))
40+#endif
3841import Data.Word (Word8)
3942import System.Directory (getFileSize)
4043import System.Environment (lookupEnv)
@@ -140,8 +143,10 @@ mkBenchSmall name env action =
140143
141144 useSmallH (RefHandles {smallInH = inh, outputH = outh}) = Handles inh outh
142145
146+#if !MIN_VERSION_base(4,17,0)
143147foreign import ccall unsafe "u_iswspace"
144148 iswspace :: Int -> Int
149+#endif
145150
146151-- Code copied from base/Data.Char to INLINE it
147152{-# INLINE isSpace #-}
@@ -154,7 +159,11 @@ isSpace :: Char -> Bool
154159-- so we'll do it like this until there's a way around that.
155160isSpace c
156161 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
162+#if MIN_VERSION_base(4,17,0)
163+ | otherwise = generalCategory c == Space
164+#else
157165 | otherwise = iswspace (ord c) /= 0
166+#endif
158167 where
159168 uc = fromIntegral (ord c) :: Word
160169
benchmark/streamly-benchmarks.cabal+7−4
@@ -120,7 +120,7 @@ common bench-depends
120120 -- Core libraries shipped with ghc, the min and max
121121 -- constraints of these libraries should match with
122122 -- the GHC versions we support
123− base >= 4.9 && < 4.17
123+ base >= 4.9 && < 4.18
124124 , deepseq >= 1.4.1 && < 1.5
125125 , mtl >= 2.2 && < 2.3
126126
@@ -133,7 +133,7 @@ common bench-depends
133133 , process >= 1.4 && < 1.7
134134 , directory >= 1.2.2 && < 1.4
135135 , filepath >= 1.4.1 && < 1.5
136− , ghc-prim >= 0.4 && < 0.9
136+ , ghc-prim >= 0.4 && < 0.10
137137
138138 if flag(bench-core)
139139 build-depends: streamly-core
@@ -155,9 +155,8 @@ common bench-depends
155155 build-depends:
156156 fusion-plugin >= 0.2 && < 0.3
157157 if flag(inspection)
158− build-depends: template-haskell >= 2.14 && < 2.17
158+ build-depends: template-haskell >= 2.14 && < 2.20
159159 , inspection-testing >= 0.4 && < 0.5
160− , ghc-prim >= 0.2 && < 0.9
161160 -- Array uses a Storable constraint in dev build making several inspection
162161 -- tests fail
163162 if flag(dev) && flag(inspection)
@@ -582,6 +581,8 @@ benchmark FileSystem.Handle
582581 other-modules:
583582 Handle.Read
584583 , Handle.ReadWrite
584+ if flag(limit-build-mem)
585+ ghc-options: +RTS -M1000M -RTS
585586 if flag(bench-core)
586587 buildable: False
587588 else
@@ -596,6 +597,8 @@ benchmark Unicode.Stream
596597 type: exitcode-stdio-1.0
597598 hs-source-dirs: Streamly/Benchmark/Unicode
598599 main-is: Stream.hs
600+ if flag(limit-build-mem)
601+ ghc-options: +RTS -M1000M -RTS
599602 if flag(bench-core)
600603 buildable: False
601604 else
cabal.project.ghc-head+3−1
@@ -24,4 +24,6 @@ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
2424source-repository-package
2525 type: git
2626 location: https://github.com/composewell/fusion-plugin
27− tag: 5fc7a38c9106e643b5ebde61400d54813a071d7b
27+ tag: 25aa89c97aaaf83209d4282638ef774780061366
28+
29+allow-newer: all
core/streamly-core.cabal+2−2
@@ -341,12 +341,12 @@ library
341341 -- packages depending on the "ghc" package (packages
342342 -- depending on doctest is a common example) can
343343 -- depend on streamly.
344− base >= 4.9 && < 4.17
344+ base >= 4.9 && < 4.18
345345 , containers >= 0.5 && < 0.7
346346 , deepseq >= 1.4.1 && < 1.5
347347 , directory >= 1.2.2 && < 1.4
348348 , exceptions >= 0.8 && < 0.11
349− , ghc-prim >= 0.2 && < 0.9
349+ , ghc-prim >= 0.2 && < 0.10
350350 , mtl >= 2.2 && < 2.3
351351 , transformers >= 0.4 && < 0.7
352352 , filepath >= 1.2.0.0 && < 1.5
src/Streamly/Internal/Unicode/Stream.hs+9
@@ -85,6 +85,9 @@ import Control.Monad.Catch (MonadThrow(..), MonadCatch)
8585import Control.Monad.IO.Class (MonadIO, liftIO)
8686import Data.Bits (shiftR, shiftL, (.|.), (.&.))
8787import Data.Char (chr, ord)
88+#if MIN_VERSION_base(4,17,0)
89+import Data.Char (generalCategory, GeneralCategory(Space))
90+#endif
8891import Data.Word (Word8)
8992import Foreign.Storable (Storable(..))
9093import Fusion.Plugin.Types (Fuse(..))
@@ -1036,15 +1039,21 @@ stripHead = S.dropWhile isSpace
10361039lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
10371040lines = S.splitOnSuffix (== '\n')
10381041
1042+#if !MIN_VERSION_base(4,17,0)
10391043foreign import ccall unsafe "u_iswspace"
10401044 iswspace :: Int -> Int
1045+#endif
10411046
10421047-- | Code copied from base/Data.Char to INLINE it
10431048{-# INLINE isSpace #-}
10441049isSpace :: Char -> Bool
10451050isSpace c
10461051 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
1052+#if MIN_VERSION_base(4,17,0)
1053+ | otherwise = generalCategory c == Space
1054+#else
10471055 | otherwise = iswspace (ord c) /= 0
1056+#endif
10481057 where
10491058 uc = fromIntegral (ord c) :: Word
10501059
streamly.cabal+4−5
@@ -679,16 +679,16 @@ library
679679 -- packages depending on the "ghc" package (packages
680680 -- depending on doctest is a common example) can
681681 -- depend on streamly.
682− base >= 4.9 && < 4.17
682+ base >= 4.9 && < 4.18
683683 , containers >= 0.5 && < 0.7
684684 , deepseq >= 1.4.1 && < 1.5
685685 , directory >= 1.2.2 && < 1.4
686686 , exceptions >= 0.8 && < 0.11
687− , ghc-prim >= 0.2 && < 0.9
687+ , ghc-prim >= 0.2 && < 0.10
688688 , mtl >= 2.2 && < 2.3
689689 , transformers >= 0.4 && < 0.7
690690 , filepath >= 1.2.0.0 && < 1.5
691− , template-haskell >= 2.13 && < 2.19
691+ , template-haskell >= 2.13 && < 2.20
692692
693693 -- The core streamly package
694694 , streamly-core == 0.1.0
@@ -716,8 +716,7 @@ library
716716 frameworks: Cocoa
717717
718718 if flag(inspection)
719− build-depends: template-haskell >= 2.14 && < 2.17
720− , inspection-testing >= 0.4 && < 0.5
719+ build-depends: inspection-testing >= 0.4 && < 0.5
721720
722721 -- Array uses a Storable constraint in dev build making several inspection
723722 -- tests fail