Skip to content

Commit

Permalink
Add GHC 9.2 support (#431)
Browse files Browse the repository at this point in the history
* Remove .travis.yml
* Add GHC 9.2 to CI
  • Loading branch information
brandon-leapyear authored Dec 5, 2021
1 parent 8318dd4 commit d62a7aa
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 125 deletions.
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions discrimination-ieee754/discrimination-ieee754.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion discrimination-ieee754/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion discrimination-ieee754/test/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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,))
Expand Down
4 changes: 4 additions & 0 deletions matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions proto-lens-arbitrary/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-arbitrary/proto-lens-arbitrary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions proto-lens-discrimination/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions proto-lens-discrimination/proto-lens-discrimination.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion proto-lens-discrimination/tests/disc_test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]
Expand Down
2 changes: 1 addition & 1 deletion proto-lens-optparse/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*

Expand Down
2 changes: 1 addition & 1 deletion proto-lens-optparse/proto-lens-optparse.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-protobuf-types/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-protobuf-types/proto-lens-protobuf-types.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.*
Expand Down
14 changes: 12 additions & 2 deletions proto-lens-protoc/app/Data/ProtoLens/Compiler/Generate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions proto-lens-protoc/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions proto-lens-protoc/proto-lens-protoc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-runtime/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions proto-lens-runtime/proto-lens-runtime.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions proto-lens-setup/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions proto-lens-setup/proto-lens-setup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit d62a7aa

Please sign in to comment.