From a95de63ae419368bc059d2070dcec5936d9c0597 Mon Sep 17 00:00:00 2001 From: John Ky Date: Thu, 17 Oct 2019 18:24:51 +1100 Subject: [PATCH] Add ghc-8.8.1 to CI --- .circleci/config.yml | 7 +- asif.cabal | 332 +++++++++++++++----------- src/Arbor/File/Format/Asif/Segment.hs | 2 +- 3 files changed, 206 insertions(+), 135 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 27f08c0..4195d9f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,16 +64,21 @@ workflows: name: GHC 8.4.4 executor: haskell/ghc-8_4_4 - - haskell/build-with-cci-cache: + - haskell/build: name: GHC 8.6.5 executor: haskell/ghc-8_6_5 + - haskell/build: + name: GHC 8.8.1 + executor: haskell/ghc-8_8_1 + - github/release-cabal: name: GitHub Release requires: - GHC 8.2.2 - GHC 8.4.4 - GHC 8.6.5 + - GHC 8.8.1 - Darwin checkout: true attach-workspace: true diff --git a/asif.cabal b/asif.cabal index d7e2fd6..33e6e2a 100644 --- a/asif.cabal +++ b/asif.cabal @@ -1,145 +1,211 @@ -cabal-version: 2.2 -name: asif -version: 6.0.3 -description: Library for creating and querying segmented feeds. Please see -synopsis: Library for creating and querying segmented feeds -category: Services -homepage: https://github.com/arbor/asif#readme -bug-reports: https://github.com/arbor/asif/issues -author: Arbor Networks -maintainer: mayhem@arbor.net -copyright: Arbor Networks -license: MIT -license-file: LICENSE -build-type: Simple -extra-source-files: - ChangeLog.md - README.md +cabal-version: 2.2 + +name: asif +version: 6.0.3 +description: Library for creating and querying segmented feeds. Please see +synopsis: Library for creating and querying segmented feeds +category: Services +homepage: https://github.com/arbor/asif#readme +bug-reports: https://github.com/arbor/asif/issues +author: Arbor Networks +maintainer: mayhem@arbor.net +copyright: Arbor Networks +license: MIT +license-file: LICENSE +tested-with: GHC == 8.8.1, GHC == 8.6.5, GHC == 8.4.4, GHC == 8.2.2 +build-type: Simple +extra-source-files: ChangeLog.md + README.md source-repository head type: git location: https://github.com/arbor/asif -common common-deps - default-language: Haskell2010 - ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -msse4.2 - build-depends: - attoparsec - , base >=4.7 && <5 - , binary - , bytestring - , conduit - , conduit-combinators - , conduit-extra - , containers - , cpu - , either - , exceptions - , foldl - , generic-lens - , hw-bits - , hw-ip >= 2.3.2.0 - , lens - , network - , old-locale - , profunctors - , resourcet - , temporary-resourcet - , text - , thyme - , transformers - , vector +common base { build-depends: base >= 4.7 && < 5 } + +common attoparsec { build-depends: attoparsec } +common binary { build-depends: binary } +common bytestring { build-depends: bytestring } +common conduit { build-depends: conduit } +common conduit-combinators { build-depends: conduit-combinators } +common conduit-extra { build-depends: conduit-extra } +common containers { build-depends: containers } +common cpu { build-depends: cpu } +common directory { build-depends: directory } +common either { build-depends: either } +common exceptions { build-depends: exceptions } +common foldl { build-depends: foldl } +common generic-lens { build-depends: generic-lens >= 1.2.0.1 } +common hedgehog { build-depends: hedgehog } +common hspec { build-depends: hspec } +common hw-bits { build-depends: hw-bits } +common hw-hspec-hedgehog { build-depends: hw-hspec-hedgehog } +common hw-ip { build-depends: hw-ip >= 2.3.4.2 } +common lens { build-depends: lens } +common network { build-depends: network } +common old-locale { build-depends: old-locale } +common optparse-applicative { build-depends: optparse-applicative } +common profunctors { build-depends: profunctors } +common resourcet { build-depends: resourcet } +common temporary-resourcet { build-depends: temporary-resourcet } +common text { build-depends: text } +common thyme { build-depends: thyme } +common transformers { build-depends: transformers } +common vector { build-depends: vector } + +common config + ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -msse4.2 + default-language: Haskell2010 +common asif + build-depends: asif library - import: common-deps - exposed-modules: - Arbor.File.Format.Asif - Arbor.File.Format.Asif.ByIndex - Arbor.File.Format.Asif.ByteString - Arbor.File.Format.Asif.ByteString.Builder - Arbor.File.Format.Asif.ByteString.Lazy - Arbor.File.Format.Asif.Data.Ip - Arbor.File.Format.Asif.Data.Read - Arbor.File.Format.Asif.Extract - Arbor.File.Format.Asif.Format - Arbor.File.Format.Asif.Format.Text - Arbor.File.Format.Asif.Get - Arbor.File.Format.Asif.IO - Arbor.File.Format.Asif.Lookup - Arbor.File.Format.Asif.Segment - Arbor.File.Format.Asif.Type - Arbor.File.Format.Asif.Whatever - Arbor.File.Format.Asif.Write - other-modules: - Arbor.File.Format.Asif.Format.SegmentValue - Arbor.File.Format.Asif.Format.Type - Arbor.File.Format.Asif.List - Arbor.File.Format.Asif.Maybe - Arbor.File.Format.Asif.Text - Paths_asif - autogen-modules: - Paths_asif - hs-source-dirs: - src - default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections - ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints - default-language: Haskell2010 + import: base, config + , attoparsec + , binary + , bytestring + , conduit + , conduit-combinators + , conduit-extra + , containers + , cpu + , either + , exceptions + , foldl + , generic-lens + , hw-bits + , hw-ip + , lens + , network + , old-locale + , profunctors + , resourcet + , temporary-resourcet + , text + , thyme + , transformers + , vector + exposed-modules: Arbor.File.Format.Asif + Arbor.File.Format.Asif.ByIndex + Arbor.File.Format.Asif.ByteString + Arbor.File.Format.Asif.ByteString.Builder + Arbor.File.Format.Asif.ByteString.Lazy + Arbor.File.Format.Asif.Data.Ip + Arbor.File.Format.Asif.Data.Read + Arbor.File.Format.Asif.Extract + Arbor.File.Format.Asif.Format + Arbor.File.Format.Asif.Format.Text + Arbor.File.Format.Asif.Get + Arbor.File.Format.Asif.IO + Arbor.File.Format.Asif.Lookup + Arbor.File.Format.Asif.Segment + Arbor.File.Format.Asif.Type + Arbor.File.Format.Asif.Whatever + Arbor.File.Format.Asif.Write + other-modules: Arbor.File.Format.Asif.Format.SegmentValue + Arbor.File.Format.Asif.Format.Type + Arbor.File.Format.Asif.List + Arbor.File.Format.Asif.Maybe + Arbor.File.Format.Asif.Text + Paths_asif + autogen-modules: Paths_asif + hs-source-dirs: src + default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections + ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints executable asif - import: common-deps - main-is: Main.hs - other-modules: - App.Commands - App.Commands.Dump - App.Commands.DumpBitmap - App.Commands.DumpOnly - App.Commands.EncodeFiles - App.Commands.ExtractFiles - App.Commands.ExtractSegments - App.Commands.Ls - App.Commands.Options.Type - App.Dump - App.IO - Paths_asif - autogen-modules: - Paths_asif - hs-source-dirs: - app - default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections - ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -threaded -rtsopts -O2 -msse4.2 - build-depends: - asif - , directory - , optparse-applicative - default-language: Haskell2010 + import: base, config + , asif + , attoparsec + , binary + , bytestring + , conduit + , conduit-combinators + , conduit-extra + , containers + , cpu + , directory + , either + , exceptions + , foldl + , generic-lens + , hw-bits + , hw-ip + , lens + , network + , old-locale + , optparse-applicative + , profunctors + , resourcet + , temporary-resourcet + , text + , thyme + , transformers + , vector + main-is: Main.hs + other-modules: App.Commands + App.Commands.Dump + App.Commands.DumpBitmap + App.Commands.DumpOnly + App.Commands.EncodeFiles + App.Commands.ExtractFiles + App.Commands.ExtractSegments + App.Commands.Ls + App.Commands.Options.Type + App.Dump + App.IO + Paths_asif + autogen-modules: Paths_asif + hs-source-dirs: app + default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections + ghc-options: -threaded -rtsopts -O2 test-suite asif-test - import: common-deps - type: exitcode-stdio-1.0 - main-is: Spec.hs - build-tool-depends: hspec-discover:hspec-discover - other-modules: - Arbor.File.Format.Asif.ByteString.BuilderSpec - Arbor.File.Format.Asif.Data.IpSpec - Arbor.File.Format.Asif.ExtractSpec - Arbor.File.Format.Asif.Format.SegmentValueSpec - Arbor.File.Format.Asif.Format.TextSpec - Arbor.File.Format.Asif.WriteSpec - Arbor.File.Format.AsifSpec - Arbor.TestUtils - Gen.Feed - TestApp - Paths_asif - autogen-modules: - Paths_asif - hs-source-dirs: - test - default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: - asif - , hedgehog - , hspec - , hw-hspec-hedgehog - default-language: Haskell2010 + import: base, config + , asif + , attoparsec + , binary + , bytestring + , conduit + , conduit-combinators + , conduit-extra + , containers + , cpu + , either + , exceptions + , foldl + , generic-lens + , hedgehog + , hspec + , hw-bits + , hw-hspec-hedgehog + , hw-ip + , lens + , network + , old-locale + , profunctors + , resourcet + , temporary-resourcet + , text + , thyme + , transformers + , vector + type: exitcode-stdio-1.0 + main-is: Spec.hs + build-tool-depends: hspec-discover:hspec-discover + other-modules: Arbor.File.Format.Asif.ByteString.BuilderSpec + Arbor.File.Format.Asif.Data.IpSpec + Arbor.File.Format.Asif.ExtractSpec + Arbor.File.Format.Asif.Format.SegmentValueSpec + Arbor.File.Format.Asif.Format.TextSpec + Arbor.File.Format.Asif.WriteSpec + Arbor.File.Format.AsifSpec + Arbor.TestUtils + Gen.Feed + TestApp + Paths_asif + autogen-modules: Paths_asif + hs-source-dirs: test + default-extensions: BangPatterns FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving MultiParamTypeClasses OverloadedStrings TupleSections + ghc-options: -threaded -rtsopts -with-rtsopts=-N diff --git a/src/Arbor/File/Format/Asif/Segment.hs b/src/Arbor/File/Format/Asif/Segment.hs index 5551c96..21e6b76 100644 --- a/src/Arbor/File/Format/Asif/Segment.hs +++ b/src/Arbor/File/Format/Asif/Segment.hs @@ -73,7 +73,7 @@ extractSegmentByteStringsWithHeader bs header = do let segs = fmap (\(o, l) -> LBS.take (fromIntegral l) $ LBS.drop (fromIntegral o) bs) header forM_ (zip segs header) $ \(seg, (_, len)) -> when (LC8.length seg /= fromIntegral len) $ - fail "XXX segments not read correctly" + Left "XXX segments not read correctly" return segs segmentNamed :: String -> M.Map Text (Z.Segment LC8.ByteString) -> Either String LC8.ByteString