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 Oct 3, 2023
1 parent a00c5bd commit 06e316e
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 14 deletions.
41 changes: 39 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- The hackage index-state
index-state: 2023-07-31T10:10:32Z
index-state: 2023-09-29T19:30:18Z
-- The CHaP index-state
index-state: cardano-haskell-packages 2023-08-08T14:32:15Z
index-state: cardano-haskell-packages 2023-09-29T18:37:37Z

packages:
base-deriving-via
Expand All @@ -37,3 +37,40 @@ benchmarks: true

program-options
ghc-options: -Werror

if impl(ghc >= 9.6)
allow-newer:
, *:base
, *:deepseq
, *:ghc-prim
, aeson:template-haskell
, hedgehog:template-haskell
, recursion-schemes:template-haskell
, scientific:template-haskell
, text:template-haskell
, text-short:template-haskell
, uuid-types:template-haskell
, vector-th-unbox:template-haskell

constraints:
, aeson >= 2.0.0.0
, bytestring >= 0.11
, 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
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -66,7 +66,7 @@ library
build-depends: base
, bytestring >=0.10.12.0
, cardano-binary
, cardano-crypto-class >= 2.2
, cardano-crypto-class >= 2.1
, cardano-crypto-praos
, cborg
, containers
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 Down Expand Up @@ -79,7 +79,7 @@ test-suite test

default-language: Haskell2010
build-depends:
, base >=4.9 && <4.19
, base
, io-classes
, io-sim
, nothunks
Expand Down

0 comments on commit 06e316e

Please sign in to comment.