diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 18a2bc87..00000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -# Use a lightweight base image; we provide our own build tools. -language: c - -# Docker builds make GHC much slower for some reason: -# https://github.com/travis-ci/travis-ci/issues/5623 -sudo: true - -cache: - timeout: 600 # 10 minutes - directories: - - $HOME/.ghc - - $HOME/.stack - - $HOME/.cabal - -matrix: - include: - - env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.2 - addons: {apt: {packages: [cabal-install-2.2, ghc-8.4.4], sources: [hvr-ghc]}} - - env: BUILD=cabal GHCVER=8.6.5 CABALVER=2.4 - addons: {apt: {packages: [cabal-install-2.4, ghc-8.6.5], sources: [hvr-ghc]}} - # TODO: switch everything to cabal new-build - - env: BUILD=cabal-new GHCVER=8.6.5 CABALVER=2.4 - addons: {apt: {packages: [cabal-install-2.4, ghc-8.6.5], sources: [hvr-ghc]}} - - env: BUILD=stack STACK='stack --resolver=lts-12.26' - addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack STACK='stack' # Use the resolver in stack.yaml - addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack STACK='stack --stack-yaml=stack-8.8.yaml' - addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack STACK='stack --stack-yaml=stack-8.10.yaml' - addons: {apt: {packages: [libgmp-dev]}} - - env: BUILD=stack STACK='stack --stack-yaml=stack-9.0.yaml' - addons: {apt: {packages: [libgmp-dev]}} - -before_install: - - mkdir -p $HOME/.local/bin - - case "$BUILD" in - stack) - export PATH=/opt/ghc/$GHCVER/bin:$HOME/.local/bin:$PATH;; - cabal) - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH;; - cabal-new) - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH;; - esac - - curl -L https://github.com/commercialhaskell/stack/releases/download/v2.3.1/stack-2.3.1-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C $HOME/.local/bin '*/stack' - - curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip > protoc-release.zip - - unzip -p protoc-release.zip bin/protoc > $HOME/.local/bin/protoc - - chmod a+x $HOME/.local/bin/protoc - - rm protoc-release.zip - -install: - - case "$BUILD" in - stack) - $STACK setup --no-terminal; - $STACK build --no-terminal happy; - $STACK build --only-dependencies --no-terminal;; - cabal) - cabal update;; - esac - -script: - # Separate stack's build and test commands, since build by itself hits some - # edge cases around custom Setup.hs script dependencies. - # Also build the tutorial, with proto-lens-* as extra-deps. Note that - # since stack is not hermetic, the extra-deps for the tutorial reuse some - # build outputs from the regular build. - - case "$BUILD" in - stack) - STACK_ARGS=(--haddock --no-haddock-deps); - $STACK build --bench --no-run-benchmarks "${STACK_ARGS[@]}" && $STACK test "${STACK_ARGS[@]}" && - (cd proto-lens-tutorial && $STACK build "${STACK_ARGS[@]}");; - cabal) - ./travis-cabal.sh;; - cabal-new) - ./travis-cabal-new.sh;; - esac diff --git a/discrimination-ieee754/discrimination-ieee754.cabal b/discrimination-ieee754/discrimination-ieee754.cabal index d37daa0a..81d8da41 100644 --- a/discrimination-ieee754/discrimination-ieee754.cabal +++ b/discrimination-ieee754/discrimination-ieee754.cabal @@ -31,7 +31,7 @@ library hs-source-dirs: src build-depends: - base >=4.10 && <4.16 + base >=4.10 && <4.17 , contravariant >=1.3 && <1.6 , data-binary-ieee754 ==0.4.* , discrimination >=0.3 && <0.5 @@ -46,7 +46,7 @@ test-suite test test build-depends: QuickCheck - , base >=4.10 && <4.16 + , base >=4.10 && <4.17 , contravariant >=1.3 && <1.6 , data-binary-ieee754 ==0.4.* , discrimination >=0.3 && <0.5 diff --git a/discrimination-ieee754/package.yaml b/discrimination-ieee754/package.yaml index e23a0929..bb0bd4d5 100644 --- a/discrimination-ieee754/package.yaml +++ b/discrimination-ieee754/package.yaml @@ -12,7 +12,7 @@ license: BSD3 github: google/proto-lens/discrimination-ieee754 dependencies: - - base >= 4.10 && < 4.16 + - base >= 4.10 && < 4.17 - data-binary-ieee754 >= 0.4 && < 0.5 - contravariant >= 1.3 && < 1.6 - discrimination >= 0.3 && < 0.5 diff --git a/discrimination-ieee754/test/test.hs b/discrimination-ieee754/test/test.hs index 09bb219b..ec0f30e6 100644 --- a/discrimination-ieee754/test/test.hs +++ b/discrimination-ieee754/test/test.hs @@ -122,7 +122,7 @@ comparisonsTestGroup nm s toWord makeNaN makePayload = testGroup nm , testProperty "INF > x" $ propInfGTNumbers s - , testGroup "agrees with Ord" $ ($propAgreesWithOrd s) <$> + , testGroup "agrees with Ord" $ ($ propAgreesWithOrd s) <$> [ testProperty "l = 0" . (. (0,)) , testProperty "r = 0" . (. (,0)) , testProperty "l = -INF" . (. (negInf,)) diff --git a/matrix.yaml b/matrix.yaml index d3e3bd61..426966c5 100644 --- a/matrix.yaml +++ b/matrix.yaml @@ -24,3 +24,7 @@ build: - resolver: nightly compiler: ghc-9.0.1 stackyaml: stack-9.0.yaml + + - resolver: nightly + compiler: ghc-9.2.1 + stackyaml: stack-9.2.yaml diff --git a/proto-lens-arbitrary/package.yaml b/proto-lens-arbitrary/package.yaml index 5b922dc3..95722aa9 100644 --- a/proto-lens-arbitrary/package.yaml +++ b/proto-lens-arbitrary/package.yaml @@ -15,8 +15,8 @@ extra-source-files: dependencies: - proto-lens >= 0.4 && < 0.8 - - base >= 4.10 && < 4.16 - - bytestring == 0.10.* + - base >= 4.10 && < 4.17 + - bytestring >= 0.10 && < 0.12 - containers >= 0.5 && < 0.7 - text == 1.2.* - lens-family >= 1.2 && < 2.2 diff --git a/proto-lens-arbitrary/proto-lens-arbitrary.cabal b/proto-lens-arbitrary/proto-lens-arbitrary.cabal index a3e6e549..84cf8828 100644 --- a/proto-lens-arbitrary/proto-lens-arbitrary.cabal +++ b/proto-lens-arbitrary/proto-lens-arbitrary.cabal @@ -34,8 +34,8 @@ library src build-depends: QuickCheck >=2.8 && <2.15 - , base >=4.10 && <4.16 - , bytestring ==0.10.* + , base >=4.10 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , lens-family >=1.2 && <2.2 , proto-lens >=0.4 && <0.8 diff --git a/proto-lens-discrimination/package.yaml b/proto-lens-discrimination/package.yaml index b6bfd973..390abbe0 100644 --- a/proto-lens-discrimination/package.yaml +++ b/proto-lens-discrimination/package.yaml @@ -15,15 +15,15 @@ extra-source-files: custom-setup: dependencies: - - base >= 4.10 && < 4.16 + - base >= 4.10 && < 4.17 - Cabal - proto-lens-setup >= 0.4 && < 0.5 build-tools: proto-lens-protoc:proto-lens-protoc dependencies: - - base >= 4.11 && < 4.16 - - bytestring == 0.10.* + - base >= 4.11 && < 4.17 + - bytestring >= 0.10 && < 0.12 - contravariant >= 1.3 && < 1.6 - containers >= 0.5 && < 0.7 - discrimination >= 0.3 && < 0.5 diff --git a/proto-lens-discrimination/proto-lens-discrimination.cabal b/proto-lens-discrimination/proto-lens-discrimination.cabal index da01b15e..176d4330 100644 --- a/proto-lens-discrimination/proto-lens-discrimination.cabal +++ b/proto-lens-discrimination/proto-lens-discrimination.cabal @@ -29,7 +29,7 @@ source-repository head custom-setup setup-depends: Cabal - , base >=4.10 && <4.16 + , base >=4.10 && <4.17 , proto-lens-setup ==0.4.* library @@ -44,8 +44,8 @@ library build-tool-depends: proto-lens-protoc:proto-lens-protoc build-depends: - base >=4.11 && <4.16 - , bytestring ==0.10.* + base >=4.11 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , contravariant >=1.3 && <1.6 , discrimination >=0.3 && <0.5 @@ -76,8 +76,8 @@ test-suite discrimination_test build-depends: HUnit >=1.3 && <1.7 , QuickCheck >=2.8 && <2.15 - , base >=4.11 && <4.16 - , bytestring ==0.10.* + , base >=4.11 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , contravariant >=1.3 && <1.6 , discrimination >=0.3 && <0.5 diff --git a/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs b/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs index 739d88df..cda8f36f 100644 --- a/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs +++ b/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs @@ -96,7 +96,7 @@ discFieldSet discList disc32 disc64 discBS discInt = discList (divided discInt (discList discWireValue)) where toIntMap = - fmap ($[]) . IM.fromListWith (flip (.)) . + fmap ($ []) . IM.fromListWith (flip (.)) . fmap (\ (TaggedValue (Tag t) v) -> (t, (v:))) discWireValue = contramap toEithers $ chosen diff --git a/proto-lens-discrimination/tests/disc_test.hs b/proto-lens-discrimination/tests/disc_test.hs index 2445c89b..8dc0d07f 100644 --- a/proto-lens-discrimination/tests/disc_test.hs +++ b/proto-lens-discrimination/tests/disc_test.hs @@ -124,7 +124,10 @@ messageSortTest = testGroup "Message" (GT == sortCompare s msg2 msg1) , testProperty "transitivity" $ \(ArbitraryMessage m1) (ArbitraryMessage m2) (ArbitraryMessage m3) -> - let [low, mid, high] = sortBy (sortCompare s) [m1, m2, m3] + let (low, mid, high) = + case sortBy (sortCompare s) [m1, m2, m3] of + [l, m, h] -> (l, m, h) + res -> error $ "Expected 3 elements, got: " ++ show res in LT === sortCompare s low high .||. (EQ, EQ) === (sortCompare s low mid, sortCompare s mid high) ] diff --git a/proto-lens-optparse/package.yaml b/proto-lens-optparse/package.yaml index 7ff30217..7e1c885c 100644 --- a/proto-lens-optparse/package.yaml +++ b/proto-lens-optparse/package.yaml @@ -16,7 +16,7 @@ extra-source-files: dependencies: - proto-lens >= 0.1 && < 0.8 - - base >= 4.10 && < 4.16 + - base >= 4.10 && < 4.17 - optparse-applicative >= 0.13 && < 0.17 - text == 1.2.* diff --git a/proto-lens-optparse/proto-lens-optparse.cabal b/proto-lens-optparse/proto-lens-optparse.cabal index 2405db01..a186c64a 100644 --- a/proto-lens-optparse/proto-lens-optparse.cabal +++ b/proto-lens-optparse/proto-lens-optparse.cabal @@ -33,7 +33,7 @@ library hs-source-dirs: src build-depends: - base >=4.10 && <4.16 + base >=4.10 && <4.17 , optparse-applicative >=0.13 && <0.17 , proto-lens >=0.1 && <0.8 , text ==1.2.* diff --git a/proto-lens-protobuf-types/package.yaml b/proto-lens-protobuf-types/package.yaml index d33be9d5..3cd7745d 100644 --- a/proto-lens-protobuf-types/package.yaml +++ b/proto-lens-protobuf-types/package.yaml @@ -22,14 +22,14 @@ extra-source-files: custom-setup: dependencies: - - base >= 4.10 && < 4.16 + - base >= 4.10 && < 4.17 - Cabal - proto-lens-setup == 0.4.* build-tools: proto-lens-protoc:proto-lens-protoc dependencies: - - base >= 4.10 && < 4.16 + - base >= 4.10 && < 4.17 - lens-family >= 1.2 && < 2.2 - proto-lens == 0.7.* - proto-lens-runtime == 0.7.* diff --git a/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal b/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal index b5dc4c4b..ab717c94 100644 --- a/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal +++ b/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal @@ -35,7 +35,7 @@ source-repository head custom-setup setup-depends: Cabal - , base >=4.10 && <4.16 + , base >=4.10 && <4.17 , proto-lens-setup ==0.4.* library @@ -76,7 +76,7 @@ library build-tool-depends: proto-lens-protoc:proto-lens-protoc build-depends: - base >=4.10 && <4.16 + base >=4.10 && <4.17 , lens-family >=1.2 && <2.2 , proto-lens ==0.7.* , proto-lens-runtime ==0.7.* diff --git a/proto-lens-protoc/app/Data/ProtoLens/Compiler/Generate.hs b/proto-lens-protoc/app/Data/ProtoLens/Compiler/Generate.hs index 7a7ef229..5d7ac56f 100644 --- a/proto-lens-protoc/app/Data/ProtoLens/Compiler/Generate.hs +++ b/proto-lens-protoc/app/Data/ProtoLens/Compiler/Generate.hs @@ -35,14 +35,19 @@ import GHC.Hs (ideclName, ideclAs) #else import HsSyn (ideclName, ideclAs) #endif +#if MIN_VERSION_ghc(9,2,0) +import GHC.Parser.Annotation (EpAnn(EpAnnNotUsed), SrcSpanAnn'(SrcSpanAnn)) +#endif #if MIN_VERSION_ghc(9,0,0) import GHC.Unit.Module.Name (moduleNameString, mkModuleName) import qualified GHC.Utils.Outputable as Outputable -import GHC.Types.SrcLoc (unLoc, noLoc) +import GHC.Types.SrcLoc (unLoc) +import qualified GHC.Types.SrcLoc as SrcLoc #else import Module (moduleNameString, mkModuleName) import qualified Outputable -import SrcLoc (unLoc, noLoc) +import SrcLoc (unLoc) +import qualified SrcLoc #endif import Lens.Family2 ((^.)) import Text.Printf (printf) @@ -203,6 +208,11 @@ type ModifyImports = ImportDecl' -> ImportDecl' reexported :: ModifyImports reexported imp = imp { ideclName = noLoc m', ideclAs = Just m } where +#if MIN_VERSION_ghc(9,2,0) + noLoc = SrcLoc.L (SrcSpanAnn EpAnnNotUsed SrcLoc.noSrcSpan) +#else + noLoc = SrcLoc.noLoc +#endif m' = mkModuleName $ "Data.ProtoLens.Runtime." ++ moduleNameString (unLoc m) m = ideclName imp diff --git a/proto-lens-protoc/package.yaml b/proto-lens-protoc/package.yaml index 2a4c8e39..07ef2906 100644 --- a/proto-lens-protoc/package.yaml +++ b/proto-lens-protoc/package.yaml @@ -17,7 +17,7 @@ extra-source-files: - Changelog.md dependencies: - - base >= 4.9 && < 4.16 + - base >= 4.9 && < 4.17 - filepath >= 1.4 && < 1.6 library: @@ -30,9 +30,9 @@ executables: main: protoc-gen-haskell.hs source-dirs: app dependencies: - - bytestring == 0.10.* + - bytestring >= 0.10 && < 0.12 - containers >= 0.5 && < 0.7 - - ghc >= 8.2 && < 9.1 + - ghc >= 8.2 && < 9.3 - ghc-paths == 0.1.* - ghc-source-gen >= 0.4 && < 0.5 - lens-family >= 1.2 && < 2.2 diff --git a/proto-lens-protoc/proto-lens-protoc.cabal b/proto-lens-protoc/proto-lens-protoc.cabal index 2a59e49b..ccaf5d18 100644 --- a/proto-lens-protoc/proto-lens-protoc.cabal +++ b/proto-lens-protoc/proto-lens-protoc.cabal @@ -34,7 +34,7 @@ library hs-source-dirs: src build-depends: - base >=4.9 && <4.16 + base >=4.9 && <4.17 , filepath >=1.4 && <1.6 default-language: Haskell2010 @@ -55,11 +55,11 @@ executable proto-lens-protoc hs-source-dirs: app build-depends: - base >=4.9 && <4.16 - , bytestring ==0.10.* + base >=4.9 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , filepath >=1.4 && <1.6 - , ghc >=8.2 && <9.1 + , ghc >=8.2 && <9.3 , ghc-paths ==0.1.* , ghc-source-gen ==0.4.* , lens-family >=1.2 && <2.2 diff --git a/proto-lens-runtime/package.yaml b/proto-lens-runtime/package.yaml index bdc0bfbf..0cffcb43 100644 --- a/proto-lens-runtime/package.yaml +++ b/proto-lens-runtime/package.yaml @@ -16,8 +16,8 @@ extra-source-files: library: dependencies: - - base >= 4.10 && < 4.16 - - bytestring == 0.10.* + - base >= 4.10 && < 4.17 + - bytestring >= 0.10 && < 0.12 - containers >= 0.5 && < 0.7 - deepseq == 1.4.* - filepath >= 1.4 && < 1.6 diff --git a/proto-lens-runtime/proto-lens-runtime.cabal b/proto-lens-runtime/proto-lens-runtime.cabal index 62c207f1..5ff95495 100644 --- a/proto-lens-runtime/proto-lens-runtime.cabal +++ b/proto-lens-runtime/proto-lens-runtime.cabal @@ -53,8 +53,8 @@ library , Lens.Family2.Unchecked as Data.ProtoLens.Runtime.Lens.Family2.Unchecked , Text.Read as Data.ProtoLens.Runtime.Text.Read build-depends: - base >=4.10 && <4.16 - , bytestring ==0.10.* + base >=4.10 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , deepseq ==1.4.* , filepath >=1.4 && <1.6 diff --git a/proto-lens-setup/package.yaml b/proto-lens-setup/package.yaml index 0fdc5875..c02cd34a 100644 --- a/proto-lens-setup/package.yaml +++ b/proto-lens-setup/package.yaml @@ -50,10 +50,10 @@ extra-source-files: library: source-dirs: src dependencies: - - base >= 4.10 && < 4.16 - - bytestring == 0.10.* + - base >= 4.10 && < 4.17 + - bytestring >= 0.10 && < 0.12 - containers >= 0.5 && < 0.7 - - Cabal >= 2.0 && < 3.5 + - Cabal >= 2.0 && < 3.7 - deepseq == 1.4.* - directory >= 1.2 && < 1.4 - filepath >= 1.4 && < 1.6 diff --git a/proto-lens-setup/proto-lens-setup.cabal b/proto-lens-setup/proto-lens-setup.cabal index e458124a..5aea2fc2 100644 --- a/proto-lens-setup/proto-lens-setup.cabal +++ b/proto-lens-setup/proto-lens-setup.cabal @@ -68,9 +68,9 @@ library hs-source-dirs: src build-depends: - Cabal >=2.0 && <3.5 - , base >=4.10 && <4.16 - , bytestring ==0.10.* + Cabal >=2.0 && <3.7 + , base >=4.10 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , deepseq ==1.4.* , directory >=1.2 && <1.4 diff --git a/proto-lens/package.yaml b/proto-lens/package.yaml index 8ff214ed..175a7ad1 100644 --- a/proto-lens/package.yaml +++ b/proto-lens/package.yaml @@ -34,11 +34,11 @@ library: - Data.ProtoLens.Encoding.Parser.Internal - Data.ProtoLens.TextFormat.Parser dependencies: - - base >= 4.10 && < 4.16 - - bytestring == 0.10.* + - base >= 4.10 && < 4.17 + - bytestring >= 0.10 && < 0.12 - containers >= 0.5 && < 0.7 - deepseq == 1.4.* - - ghc-prim >= 0.4 && < 0.8 + - ghc-prim >= 0.4 && < 0.9 - lens-family >= 1.2 && < 2.2 - parsec == 3.1.* - pretty == 1.1.* diff --git a/proto-lens/proto-lens.cabal b/proto-lens/proto-lens.cabal index 778e4ea1..ad5a6350 100644 --- a/proto-lens/proto-lens.cabal +++ b/proto-lens/proto-lens.cabal @@ -58,11 +58,11 @@ library hs-source-dirs: src build-depends: - base >=4.10 && <4.16 - , bytestring ==0.10.* + base >=4.10 && <4.17 + , bytestring >=0.10 && <0.12 , containers >=0.5 && <0.7 , deepseq ==1.4.* - , ghc-prim >=0.4 && <0.8 + , ghc-prim >=0.4 && <0.9 , lens-family >=1.2 && <2.2 , parsec ==3.1.* , pretty ==1.1.* diff --git a/stack-9.2.yaml b/stack-9.2.yaml new file mode 100644 index 00000000..13d1e382 --- /dev/null +++ b/stack-9.2.yaml @@ -0,0 +1,33 @@ +# Copyright 2019 Google LLC +# +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file or at +# https://developers.google.com/open-source/licenses/bsd + +resolver: nightly-2021-11-28 +compiler: ghc-9.2.1 + +packages: +- discrimination-ieee754 +- proto-lens +- proto-lens-arbitrary +- proto-lens-benchmarks +- proto-lens-discrimination +- proto-lens-optparse +- proto-lens-protobuf-types +- proto-lens-protoc +- proto-lens-runtime +- proto-lens-setup +- proto-lens-tests +- proto-lens-tests-dep + +extra-deps: +- aeson-2.0.2.0 +- attoparsec-0.14.2 +- base-compat-0.12.1 +- base-compat-batteries-0.12.1 +- github: google/ghc-source-gen + commit: f6b9130d8f384be0ef7a02b371870d532090ccb6 + +ghc-options: + "$locals": -Wall -Werror