Skip to content

Commit 5ca296b

Browse files
Bodigrimandreasabel
authored andcommitted
Support Cabal-3.16
1 parent 87995ec commit 5ca296b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

exes/Main.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE PatternSynonyms #-}
23

34
{-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-}
45

@@ -41,7 +42,7 @@ import Network.URI
4142
( URI(..), URIAuth(..), parseAbsoluteURI )
4243
import Distribution.Simple.Command
4344
import Distribution.Simple.Setup
44-
( Flag(..), fromFlag, fromFlagOrDefault, flagToList, flagToMaybe )
45+
( Flag, pattern Flag, pattern NoFlag, fromFlag, fromFlagOrDefault, flagToList, flagToMaybe )
4546
import Data.Maybe
4647
( isNothing )
4748
import Data.List

hackage-server.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ common defaults
165165
-- other dependencies shared by most components
166166
build-depends:
167167
, aeson >= 2.1.0.0 && < 2.3
168-
, Cabal >= 3.14.2.0 && < 3.16
169-
, Cabal-syntax >= 3.14.2.0 && < 3.16
168+
, Cabal >= 3.14.2.0 && < 3.18
169+
, Cabal-syntax >= 3.14.2.0 && < 3.18
170170
-- Cabal-syntax needs to be bound to constrain hackage-security
171171
-- see https://github.com/haskell/hackage-server/issues/1130
172172
, network-bsd ^>= 2.8

src/Distribution/Server/Framework/Instances.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ instance SafeCopy CompilerFlavor where
250250
putCopy JHC = contain $ putWord8 7
251251
putCopy LHC = contain $ putWord8 8
252252
putCopy UHC = contain $ putWord8 9
253+
#if !MIN_VERSION_Cabal_syntax(3,16,0)
253254
putCopy (HaskellSuite s) = contain $ putWord8 10 >> safePut s
255+
#endif
254256
putCopy GHCJS = contain $ putWord8 11
255257
putCopy Eta = contain $ putWord8 12
256258
#if MIN_VERSION_Cabal_syntax(3,12,1)
@@ -270,7 +272,9 @@ instance SafeCopy CompilerFlavor where
270272
7 -> return JHC
271273
8 -> return LHC
272274
9 -> return UHC
275+
#if !MIN_VERSION_Cabal_syntax(3,16,0)
273276
10 -> return HaskellSuite <*> safeGet
277+
#endif
274278
11 -> return GHCJS
275279
12 -> return Eta
276280
#if MIN_VERSION_Cabal_syntax(3,12,1)
@@ -411,7 +415,9 @@ instance Arbitrary CompilerFlavor where
411415
, pure JHC
412416
, pure LHC
413417
, pure UHC
418+
#if !MIN_VERSION_Cabal_syntax(3,16,0)
414419
, pure HaskellSuite <*> vectorOf 3 (choose ('A', 'Z'))
420+
#endif
415421
, pure GHCJS
416422
, pure Eta
417423
#if MIN_VERSION_Cabal_syntax(3,12,1)

0 commit comments

Comments
 (0)