on master help sign in
Include patch for criterion 0.8 and close #68
commitba4a1e86178cc932a0be71a150544c1d4296e66a authorMichael Snoyman <michael@snoyman.com> dateFri 21 Feb 2014, 06:56 (13 years ago) parent615bc8d
2 files changed+55−3
Stackage/Config.hs−3 patching/patches/criterion-0.8.0.0.patch+55
Stackage/Config.hs−3
@@ -314,9 +314,6 @@ defaultStablePackages ghcVer = unPackageMap $ execWriter $ do
314314 -- https://github.com/fpco/stackage/issues/46
315315 addRange "Michael Snoyman" "QuickCheck" "< 2.6"
316316
317− -- https://github.com/fpco/stackage/issues/68
318− addRange "Michael Snoyman" "criterion" "< 0.8"
319−
320317 -- https://github.com/fpco/stackage/issues/72
321318 addRange "Michael Snoyman" "HaXml" "< 1.24"
322319
patching/patches/criterion-0.8.0.0.patchnew file+55
@@ -0,0 +1,55 @@
1+diff -ru orig/Criterion/IO.hs new/Criterion/IO.hs
2+--- orig/Criterion/IO.hs 2014-02-21 06:51:14.286525542 +0200
3++++ new/Criterion/IO.hs 2014-02-21 06:51:14.000000000 +0200
4+@@ -1,4 +1,5 @@
5+ {-# LANGUAGE OverloadedStrings #-}
6++{-# LANGUAGE CPP #-}
7+ -- |
8+ -- Module : Criterion.IO
9+ -- Copyright : (c) 2009, 2010 Bryan O'Sullivan
10+@@ -21,7 +22,11 @@
11+
12+ import Criterion.Types (ResultForest, ResultTree(..))
13+ import Data.Binary (Binary(..), encode)
14++#if MIN_VERSION_binary(0, 6, 3)
15+ import Data.Binary.Get (runGetOrFail)
16++#else
17++import Data.Binary.Get (runGetState)
18++#endif
19+ import Data.Binary.Put (putByteString, putWord16be, runPut)
20+ import Data.Version (Version(..))
21+ import Paths_criterion (version)
22+@@ -56,6 +61,7 @@
23+ writeResults :: FilePath -> ResultForest -> IO ()
24+ writeResults path rs = withFile path WriteMode (flip hPutResults rs)
25+
26++#if MIN_VERSION_binary(0, 6, 3)
27+ readAll :: Binary a => Handle -> IO [a]
28+ readAll handle = do
29+ let go bs
30+@@ -64,3 +70,13 @@
31+ Left (_, _, err) -> fail err
32+ Right (bs', _, a) -> (a:) `fmap` go bs'
33+ go =<< L.hGetContents handle
34++#else
35++readAll :: Binary a => Handle -> IO [a]
36++readAll handle = do
37++ let go i bs
38++ | L.null bs = return []
39++ | otherwise =
40++ let (a, bs', i') = runGetState get bs i
41++ in (a:) `fmap` go i' bs'
42++ go 0 =<< L.hGetContents handle
43++#endif
44+diff -ru orig/criterion.cabal new/criterion.cabal
45+--- orig/criterion.cabal 2014-02-21 06:51:14.314525543 +0200
46++++ new/criterion.cabal 2014-02-21 06:51:14.000000000 +0200
47+@@ -58,7 +58,7 @@
48+ build-depends:
49+ aeson >= 0.3.2.12,
50+ base < 5,
51+- binary >= 0.6.3.0,
52++ binary >= 0.5.1.0,
53+ bytestring >= 0.9 && < 1.0,
54+ containers,
55+ deepseq >= 1.1.0.0,