From 28c44431b3070c07510499fc561f06b07ab6f83c Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 5 Oct 2023 09:46:09 +1100 Subject: [PATCH 1/2] Make it build with ghc-9.8 --- cabal.project | 27 +++++++++++++++++-- cardano-binary/cardano-binary.cabal | 2 +- cardano-binary/test/cardano-binary-test.cabal | 2 +- .../cardano-crypto-class.cabal | 2 +- .../src/Cardano/Crypto/KES/Mock.hs | 2 +- .../src/Cardano/Crypto/PinnedSizedBytes.hs | 7 +++-- .../cardano-crypto-praos.cabal | 2 +- .../cardano-crypto-tests.cabal | 4 +-- cardano-slotting/cardano-slotting.cabal | 2 +- strict-checked-vars/strict-checked-vars.cabal | 4 +-- 10 files changed, 40 insertions(+), 14 deletions(-) diff --git a/cabal.project b/cabal.project index c678bee29..c23617ad7 100644 --- a/cabal.project +++ b/cabal.project @@ -10,9 +10,9 @@ repository cardano-haskell-packages d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee -- The hackage index-state -index-state: 2023-07-31T10:10:32Z +index-state: 2023-10-05T21:19:55Z -- The CHaP index-state -index-state: cardano-haskell-packages 2023-08-08T14:32:15Z +index-state: cardano-haskell-packages 2023-10-05T20:34:14Z packages: base-deriving-via @@ -37,3 +37,26 @@ benchmarks: true program-options ghc-options: -Werror + +if impl(ghc >= 9.8) + allow-newer: + , *:base + , *:deepseq + , *:ghc-prim + , *:template-haskell + , aeson:th-abstraction + + constraints: + , aeson >= 2.0.0.0 + , bytestring >= 0.11 + , hastache >= 0.6.1 + , monad-par >= 0.3.5 + , statistics >= 0.16.2.0 + , th-abstraction >= 0.6.0.0 + + -- Git head compiles with `ghc-9.8`, but Hackage version does not. + source-repository-package + type: git + location: https://github.com/recursion-schemes/recursion-schemes + tag: cc2e88c3400a6548e975830c9addb12ab087545f + --sha256: 06shyihy6cpblv3pf18xgdfjgxqw2y2awvpcy33r76fr642gdvgn diff --git a/cardano-binary/cardano-binary.cabal b/cardano-binary/cardano-binary.cabal index 940910f6e..959cc093f 100644 --- a/cardano-binary/cardano-binary.cabal +++ b/cardano-binary/cardano-binary.cabal @@ -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 diff --git a/cardano-binary/test/cardano-binary-test.cabal b/cardano-binary/test/cardano-binary-test.cabal index 240b88e88..7bf67858f 100644 --- a/cardano-binary/test/cardano-binary-test.cabal +++ b/cardano-binary/test/cardano-binary-test.cabal @@ -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 diff --git a/cardano-crypto-class/cardano-crypto-class.cabal b/cardano-crypto-class/cardano-crypto-class.cabal index 79870ac34..76f88de60 100644 --- a/cardano-crypto-class/cardano-crypto-class.cabal +++ b/cardano-crypto-class/cardano-crypto-class.cabal @@ -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 diff --git a/cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs b/cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs index ed0d7480d..ae9b1b82c 100644 --- a/cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs +++ b/cardano-crypto-class/src/Cardano/Crypto/KES/Mock.hs @@ -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) -- diff --git a/cardano-crypto-class/src/Cardano/Crypto/PinnedSizedBytes.hs b/cardano-crypto-class/src/Cardano/Crypto/PinnedSizedBytes.hs index 283b70f55..1eaabe2cd 100644 --- a/cardano-crypto-class/src/Cardano/Crypto/PinnedSizedBytes.hs +++ b/cardano-crypto-class/src/Cardano/Crypto/PinnedSizedBytes.hs @@ -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" diff --git a/cardano-crypto-praos/cardano-crypto-praos.cabal b/cardano-crypto-praos/cardano-crypto-praos.cabal index 2b1f53e04..40342bbc8 100644 --- a/cardano-crypto-praos/cardano-crypto-praos.cabal +++ b/cardano-crypto-praos/cardano-crypto-praos.cabal @@ -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 diff --git a/cardano-crypto-tests/cardano-crypto-tests.cabal b/cardano-crypto-tests/cardano-crypto-tests.cabal index ad8acf63d..4d044eb82 100644 --- a/cardano-crypto-tests/cardano-crypto-tests.cabal +++ b/cardano-crypto-tests/cardano-crypto-tests.cabal @@ -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 @@ -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 diff --git a/cardano-slotting/cardano-slotting.cabal b/cardano-slotting/cardano-slotting.cabal index 75c9070ea..e48157734 100644 --- a/cardano-slotting/cardano-slotting.cabal +++ b/cardano-slotting/cardano-slotting.cabal @@ -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 diff --git a/strict-checked-vars/strict-checked-vars.cabal b/strict-checked-vars/strict-checked-vars.cabal index c45408e4b..8648d80e0 100644 --- a/strict-checked-vars/strict-checked-vars.cabal +++ b/strict-checked-vars/strict-checked-vars.cabal @@ -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 @@ -79,7 +79,7 @@ test-suite test default-language: Haskell2010 build-depends: - , base >=4.9 && <4.19 + , base , io-classes , io-sim , nothunks From e088124fd13c07d03b08b1116f2c07886353a057 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 6 Oct 2023 11:52:30 +1100 Subject: [PATCH 2/2] Nix updates --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 075692c34..8ef042851 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1690795016, - "narHash": "sha256-UOIamXYb+xLDrTYs41BaaCun2C3P/cscH4jQ+/1R3w0=", + "lastModified": 1696538731, + "narHash": "sha256-oTsPiABmN7mw9hctagxzNcIDtvmyK4EuBzvMD2iXeeQ=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "75cb0539932adc80f03ebcdfbca9dcf6166015b1", + "rev": "4276a203ed968d067b6c31c943b5bae5fc2ec4a2", "type": "github" }, "original": { @@ -486,11 +486,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1684223806, - "narHash": "sha256-IyLoP+zhuyygLtr83XXsrvKyqqLQ8FHXTiySFf4FJOI=", + "lastModified": 1696471795, + "narHash": "sha256-aNNvjUtCGXaXSp5M/HSj1SOeLjqLyTRWYbIHqAEeUp0=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "86421fdd89b3af43fa716ccd07638f96c6ecd1e4", + "rev": "91f16fa8acb58b312f94977715c630d8bf77e33e", "type": "github" }, "original": {