Skip to content

Commit

Permalink
Make it build with ghc-9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Aug 29, 2023
1 parent f54cdd8 commit 0ed3c97
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 16 deletions.
37 changes: 32 additions & 5 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository cardano-haskell-packages
-- The hackage index-state
index-state: 2023-07-31T10:10:32Z
-- The CHaP index-state
index-state: cardano-haskell-packages 2023-07-31T10:10:32Z
index-state: cardano-haskell-packages 2023-08-28T22:23:10Z

packages:
base-deriving-via
Expand Down Expand Up @@ -41,7 +41,34 @@ program-options
if impl(ghc >= 9.6)
allow-newer:
, *:base
, protolude:ghc-prim
, protolude:binary
, protolude:bytestring
, protolude:text
, *:deepseq
, *:ghc-prim
, aeson:template-haskell
, hedgehog:template-haskell
, recursion-schemes:template-haskell
, scientific:template-haskell
, text-short:template-haskell
, uuid-types:template-haskell
, vector-th-unbox:template-haskell

constraints:
, aeson >= 2.0.0.0
, hastache >= 0.6.1
, monad-par >= 0.3.5
, statistics >= 0.16.2.0

-- `aeson` has a whole bunch of dependencies (and sometimes the dependency's dependency) which do
-- not compile with `ghc-9.8`. Easier to just do this.
source-repository-package
type: git
location: https://github.com/input-output-hk/aeson
tag: 2cb7304e91f17583fc12026762fc5ae6ba9aa1b6
subdir:
.
text-iso8601

source-repository-package
type: git
-- Git head compiles with `ghc-9.8`, but Hackage version does not.
location: https://github.com/recursion-schemes/recursion-schemes
tag: cc2e88c3400a6548e975830c9addb12ab087545f
2 changes: 1 addition & 1 deletion cardano-binary/cardano-binary.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build-type: Simple
extra-source-files: README.md
CHANGELOG.md

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion cardano-binary/test/cardano-binary-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ category: Currency
build-type: Simple
extra-source-files: CHANGELOG.md

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion cardano-crypto-class/cardano-crypto-class.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ flag secp256k1-support
default: True
manual: True

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ instance KnownNat t => KESAlgorithm (MockKES t) where

data SigKES (MockKES t) =
SigMockKES !(Hash ShortHash ()) !(SignKeyKES (MockKES t))
deriving stock (Show, Eq, Ord, Generic)
deriving stock (Show, Eq, Generic)
deriving anyclass (NoThunks)

--
Expand Down
7 changes: 5 additions & 2 deletions cardano-crypto-class/src/Cardano/Crypto/PinnedSizedBytes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,12 @@ ptrPsbToSizedPtr = SizedPtr . castPtr
-- then this throws an exception.
pinnedByteArrayFromListN :: forall a. Prim.Prim a => Int -> [a] -> ByteArray
pinnedByteArrayFromListN 0 _ =
die "pinnedByteArrayFromListN" "list length zero"
die "pinnedByteArrayFromListN" "list length zero #1"
pinnedByteArrayFromListN n ys = runST $ do
marr <- newPinnedByteArray (n * Prim.sizeOf (head ys))
let headYs = case ys of
[] -> die "pinnedByteArrayFromListN" "list length zero #2"
(y:_) -> y
marr <- newPinnedByteArray (n * Prim.sizeOf headYs)
let go !ix [] = if ix == n
then return ()
else die "pinnedByteArrayFromListN" "list length less than specified size"
Expand Down
2 changes: 1 addition & 1 deletion cardano-crypto-praos/cardano-crypto-praos.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ flag external-libsodium-vrf
default: True
manual: True

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion cardano-crypto-tests/cardano-crypto-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ flag secp256k1-support
default: True
manual: True

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
2 changes: 1 addition & 1 deletion cardano-slotting/cardano-slotting.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ copyright: IOHK
build-type: Simple
extra-source-files: CHANGELOG.md

common base { build-depends: base >= 4.14 && < 4.19 }
common base { build-depends: base >= 4.14 && < 5 }

common project-config
default-language: Haskell2010
Expand Down
4 changes: 2 additions & 2 deletions strict-checked-vars/strict-checked-vars.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ library

default-language: Haskell2010
build-depends:
, base >=4.9 && <4.19
, base >=4.9 && <5
, io-classes ^>=1.2
, strict-mvar ^>=1.2
, strict-stm ^>=1.2
Expand All @@ -77,7 +77,7 @@ test-suite test

default-language: Haskell2010
build-depends:
, base >=4.9 && <4.19
, base
, io-sim
, QuickCheck
, strict-checked-vars
Expand Down

0 comments on commit 0ed3c97

Please sign in to comment.