From 808261b279ded6d443f2f8155a7110bfe9d3da19 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 2 Oct 2024 06:57:09 +1000 Subject: [PATCH 01/10] Make it build with ghc-9.10 --- cabal.project | 25 ++++++++----------- .../Test/Cardano/Db/Mock/Property/Property.hs | 2 +- .../DbSync/Era/Shelley/Generic/Tx/Alonzo.hs | 8 +++--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/cabal.project b/cabal.project index 941d8e2b8..0566b1a9a 100644 --- a/cabal.project +++ b/cabal.project @@ -10,8 +10,8 @@ repository cardano-haskell-packages d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee index-state: - , hackage.haskell.org 2024-09-10T19:44:01Z - , cardano-haskell-packages 2024-09-06T13:43:41Z + , hackage.haskell.org 2024-09-11T05:54:39Z + , cardano-haskell-packages 2024-09-10T13:49:28Z packages: cardano-db @@ -68,11 +68,18 @@ package snap-server flags: -openssl allow-newer: - swagger2:aeson + , swagger2:aeson + -- The version of ouroboros-consensus specified by cardano-node uses an earlier version of + -- quickcheck-state-machine that does not compile with ghc-9.10 so we allow a never version + -- that builds with ghc-9.10 (and earlier). + , ouroboros-consensus:quickcheck-state-machine constraints: + , cardano-node ^>= 9.1.1 -- STM 2.5.2 is broken: https://github.com/haskell/stm/issues/76 , stm >= 2.5.3.1 + -- Earlier versions do not compile with ghc-9.10. + , quickcheck-state-machine ^>= 0.10 -- --------------------------------------------------------- @@ -80,15 +87,3 @@ constraints: -- when using the "cabal" wrapper script provided by nix-shell. -- --------------------------- 8< -------------------------- -- Please do not put any `source-repository-package` clause above this line. - -source-repository-package - type: git - location: https://github.com/IntersectMBO/cardano-node - tag: efd560070aaf042d1eb4680ae37fc607c7742319 - --sha256: sha256-VIwEjpaGk09+dAcKELjLSR2OP3qBCWTGHpd0SBjgbVc= - subdir: - cardano-node - cardano-submit-api - trace-dispatcher - trace-forward - trace-resources diff --git a/cardano-chain-gen/test/Test/Cardano/Db/Mock/Property/Property.hs b/cardano-chain-gen/test/Test/Cardano/Db/Mock/Property/Property.hs index 58aba6032..aa75b72be 100644 --- a/cardano-chain-gen/test/Test/Cardano/Db/Mock/Property/Property.hs +++ b/cardano-chain-gen/test/Test/Cardano/Db/Mock/Property/Property.hs @@ -286,7 +286,7 @@ sm interpreter mockServer dbSync = prop_empty_blocks :: IOManager -> [(Text, Text)] -> Property prop_empty_blocks iom knownMigrations = withMaxSuccess 20 $ noShrinking $ forAllCommands smSymbolic (Just 20) $ \cmds -> monadicIO $ do (hist, res) <- run $ runAction $ \interpreter mockServer dbSync -> do - (hist, _model, res) <- runCommands' (pure $ sm interpreter mockServer dbSync) cmds + (hist, _model, res) <- runCommands' (sm interpreter mockServer dbSync) cmds pure (hist, res) prettyCommands smSymbolic hist (checkCommandNames cmds (res === Ok)) where diff --git a/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Tx/Alonzo.hs b/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Tx/Alonzo.hs index bbe8e349c..4b551fda4 100644 --- a/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Tx/Alonzo.hs +++ b/cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Tx/Alonzo.hs @@ -38,7 +38,7 @@ import Cardano.DbSync.Era.Shelley.Generic.Witness import Cardano.DbSync.Types (DataHash) import qualified Cardano.Ledger.Address as Ledger import Cardano.Ledger.Allegra.Scripts (Timelock) -import Cardano.Ledger.Alonzo.Scripts (AsIx (..), ExUnits (..), PlutusPurpose (..), txscriptfee, unPlutusBinary) +import Cardano.Ledger.Alonzo.Scripts (AsIx (..), ExUnits (..), PlutusPurpose, txscriptfee, unPlutusBinary) import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo import qualified Cardano.Ledger.Alonzo.Tx as Alonzo import Cardano.Ledger.Alonzo.TxAuxData (AlonzoTxAuxData (..), getAlonzoTxAuxDataScripts) @@ -265,7 +265,7 @@ resolveRedeemers ioExtraPlutus mprices tx toCert = mkPurpose = \case Strict.SNothing -> Nothing - Strict.SJust a -> toAlonzoPurpose txBody $ hoistPlutusPurpose Alonzo.toAsItem a + Strict.SJust a -> toAlonzoPurpose txBody $ Alonzo.hoistPlutusPurpose Alonzo.toAsItem a handleTxInPtr :: Word64 -> Ledger.TxIn StandardCrypto -> RedeemerMaps -> (RedeemerMaps, Maybe (Either TxIn ByteString)) handleTxInPtr rdmrIx txIn mps = case Map.lookup txIn (rmInps mps) of @@ -331,7 +331,7 @@ getPlutusSizes :: ( Core.EraTx era , Core.TxWits era ~ Alonzo.AlonzoTxWits era , Core.Script era ~ Alonzo.AlonzoScript era - , AlonzoEraScript era + , Alonzo.AlonzoEraScript era ) => Core.Tx era -> [Word64] @@ -341,7 +341,7 @@ getPlutusSizes tx = tx ^. (Core.witsTxL . Alonzo.scriptAlonzoTxWitsL) -- | Returns Nothing for non-plutus scripts. -getPlutusScriptSize :: AlonzoEraScript era => Alonzo.AlonzoScript era -> Maybe Word64 +getPlutusScriptSize :: Alonzo.AlonzoEraScript era => Alonzo.AlonzoScript era -> Maybe Word64 getPlutusScriptSize script = case script of Alonzo.TimelockScript {} -> Nothing From 9f9865b36adba6f1cf721ea91812d6f523ab2ac0 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 2 Oct 2024 06:57:13 +1000 Subject: [PATCH 02/10] CI: Add ghc-9.10 to the build matrix --- .github/workflows/haskell.yml | 2 +- flake.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 3d43ff07a..7284013eb 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - compiler-nix-name: [ghc810, ghc96, ghc98] + compiler-nix-name: [ghc810, ghc96, ghc98, ghc910] include: # We want a single job, because macOS runners are scarce. - os: macos-latest diff --git a/flake.nix b/flake.nix index 26183d29c..1dc9aefd1 100644 --- a/flake.nix +++ b/flake.nix @@ -139,7 +139,7 @@ let compilers = if (system == "x86_64-linux") then - ["ghc96" "ghc98"] + ["ghc96" "ghc98" "ghc910"] else ["ghc98"]; in From 7fe7ec51c1bf6ce9bfd1263d2adabb48e766a5ee Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 3 Oct 2024 10:30:36 +1000 Subject: [PATCH 03/10] cabal.project: Reinstate cardano-node SRP This SRP seems to be needed for some Docker related reason. --- cabal.project | 12 ++++++++++++ cardano-chain-gen/cardano-chain-gen.cabal | 2 +- cardano-db-sync/cardano-db-sync.cabal | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cabal.project b/cabal.project index 0566b1a9a..ffa4ab3f3 100644 --- a/cabal.project +++ b/cabal.project @@ -87,3 +87,15 @@ constraints: -- when using the "cabal" wrapper script provided by nix-shell. -- --------------------------- 8< -------------------------- -- Please do not put any `source-repository-package` clause above this line. + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-node + tag: efd560070aaf042d1eb4680ae37fc607c7742319 + --sha256: sha256-VIwEjpaGk09+dAcKELjLSR2OP3qBCWTGHpd0SBjgbVc= + subdir: + cardano-node + cardano-submit-api + trace-dispatcher + trace-forward + trace-resources diff --git a/cardano-chain-gen/cardano-chain-gen.cabal b/cardano-chain-gen/cardano-chain-gen.cabal index 5e6840b9f..1d8c33e37 100644 --- a/cardano-chain-gen/cardano-chain-gen.cabal +++ b/cardano-chain-gen/cardano-chain-gen.cabal @@ -95,7 +95,7 @@ library , ouroboros-network-framework , ouroboros-network-protocols , plutus-core - , plutus-ledger-api:{plutus-ledger-api-testlib} ==1.30.0.0 + , plutus-ledger-api:{plutus-ledger-api-testlib} , serialise , strict-sop-core , strict-stm diff --git a/cardano-db-sync/cardano-db-sync.cabal b/cardano-db-sync/cardano-db-sync.cabal index 4814fab51..740504c45 100644 --- a/cardano-db-sync/cardano-db-sync.cabal +++ b/cardano-db-sync/cardano-db-sync.cabal @@ -209,7 +209,7 @@ library , ouroboros-network-protocols , persistent , persistent-postgresql - , plutus-ledger-api ==1.30.0.0 + , plutus-ledger-api , pretty-show , prometheus , psqueues From 7db70d66d0474c9ad80abc66837985dc7d3c3441 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 3 Oct 2024 16:55:05 +1000 Subject: [PATCH 04/10] Nix updates --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 7310bbea1..d76ea282c 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1725978043, - "narHash": "sha256-3AwgQ308g74rISxUlbzQRX3At0trVoH836vBwkcFFYg=", + "lastModified": 1727364445, + "narHash": "sha256-i/m1fmNx0BQbRvHz9ZbY6t0I5BGqwyCA/Jd/BL1Lp0Q=", "owner": "IntersectMBO", "repo": "cardano-haskell-packages", - "rev": "ce5ba82d474225506523e66a4050718de7e2b3fe", + "rev": "a28f93d778031ddabda3ac1aef9616ae933eea82", "type": "github" }, "original": { @@ -171,11 +171,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1726014807, - "narHash": "sha256-a1Vf++zjoFgSYl8ahl7qOwuQtDgn9bFDhr1T2rxqED4=", + "lastModified": 1727915231, + "narHash": "sha256-tBDL+S07XAs3vMh08CeijOzzk2m+CMKhBkMkIMtOuz4=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "45251f373aeb0db77d1e3e89e26b3bebd7897dca", + "rev": "f3ff858d82042429a59fd5443e1dd5dd8981b8d2", "type": "github" }, "original": { From d658ba133e8dd6ad53834e22b42c50ec9a323a09 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 3 Oct 2024 14:34:27 -0400 Subject: [PATCH 05/10] nix: Bump cabal@3.12.1.0 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1dc9aefd1..a360375cb 100644 --- a/flake.nix +++ b/flake.nix @@ -156,7 +156,7 @@ }; shell.tools = { - cabal = "3.10.3.0"; + cabal = "3.12.1.0"; ghcid = "0.8.8"; haskell-language-server = { src = From 67740bb97d9b6062bfe631d423beca65e19706a3 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 3 Oct 2024 15:39:20 -0400 Subject: [PATCH 06/10] nix: nix flake lock --update-input haskellNix --- flake.lock | 32 ++++++++++++++++---------------- flake.nix | 7 +++++++ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index d76ea282c..bf2c0508c 100644 --- a/flake.lock +++ b/flake.lock @@ -226,11 +226,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1721956799, - "narHash": "sha256-FU09PlekhkuocxDO2UN2aARdUflIGA36VP1EUra4b7c=", + "lastModified": 1728003067, + "narHash": "sha256-1PyuwafWmmisFen1ME4SLcuifTaAH0Xq72C12+uNjXw=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "ccbd8ed7d4aff11e0507d19dc7c40601487c0bea", + "rev": "5f03ffec7631a5bcfa0a22d9f1b39512b53f8cd4", "type": "github" }, "original": { @@ -395,16 +395,16 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1718469202, - "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "lastModified": 1720003792, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.9.0.0", + "ref": "2.9.0.1", "repo": "haskell-language-server", "type": "github" } @@ -655,11 +655,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1720122915, - "narHash": "sha256-Nby8WWxj0elBu1xuRaUcRjPi/rU3xVbkAt2kj4QwX2U=", + "lastModified": 1726447378, + "narHash": "sha256-2yV8nmYE1p9lfmLHhOCbYwQC/W8WYfGQABoGzJOb1JQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "835cf2d3f37989c5db6585a28de967a667a75fb1", + "rev": "086b448a5d54fd117f4dc2dee55c9f0ff461bdc1", "type": "github" }, "original": { @@ -687,11 +687,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1720181791, - "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "lastModified": 1726583932, + "narHash": "sha256-zACxiQx8knB3F8+Ze+1BpiYrI+CbhxyWpcSID9kVhkQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "rev": "658e7223191d2598641d50ee4e898126768fe847", "type": "github" }, "original": { @@ -769,11 +769,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1721952692, - "narHash": "sha256-UXiGzFWWOZMZRYkhS0oVaNK/v8Rr5PxxsM2qV1T6iJI=", + "lastModified": 1728000661, + "narHash": "sha256-yOYjHm31HMwuxvVjwc85E+s6EVn0tF3Hj4H+sTwSTv4=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "73bfeeb1dccad2858f22f6f57b6571b10579ed2e", + "rev": "bc4ee5c29ee435745f68a27feef49e8f8cda9341", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a360375cb..1dfdc4470 100644 --- a/flake.nix +++ b/flake.nix @@ -82,6 +82,13 @@ version = "2.2.0"; }; }) + + (final: prev: { + postgresql = prev.postgresql.overrideAttrs (_: + final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { + NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; + }); + }) ]; }; From beb88eba621c35639cc3cb24423f2675a05fb980 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Wed, 9 Oct 2024 15:48:11 -0400 Subject: [PATCH 07/10] fix: Try haskell.nix unmerged fix --- flake.lock | 7 ++++--- flake.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index bf2c0508c..fdd7957fa 100644 --- a/flake.lock +++ b/flake.lock @@ -226,16 +226,17 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1728003067, - "narHash": "sha256-1PyuwafWmmisFen1ME4SLcuifTaAH0Xq72C12+uNjXw=", + "lastModified": 1728361811, + "narHash": "sha256-wJIfJ5VUsq0VVz6z3GjRPNFhP1huMlc7he++kpm7JkA=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "5f03ffec7631a5bcfa0a22d9f1b39512b53f8cd4", + "rev": "d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "haskell.nix", + "rev": "d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 1dfdc4470..87c08c5bc 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ nixpkgs.follows = "haskellNix/nixpkgs-unstable"; utils.url = "github:numtide/flake-utils"; haskellNix = { - url = "github:input-output-hk/haskell.nix"; + url = "github:input-output-hk/haskell.nix?rev=d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c"; inputs.hackage.follows = "hackageNix"; }; hackageNix = { From 7b32ac30df644f76afe044991ecd077fd110cc0c Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 10 Oct 2024 09:19:51 -0400 Subject: [PATCH 08/10] fix: Dowgrade postgresql@15 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 87c08c5bc..e9392b931 100644 --- a/flake.nix +++ b/flake.nix @@ -84,7 +84,7 @@ }) (final: prev: { - postgresql = prev.postgresql.overrideAttrs (_: + postgresql = prev.postgresql_15.overrideAttrs (_: final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; }); From d7b255ac69f9a827074fa72f97f279533b6f5f64 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 10 Oct 2024 16:19:10 -0400 Subject: [PATCH 09/10] fix: postgresql static build --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index e9392b931..cb0f6488b 100644 --- a/flake.nix +++ b/flake.nix @@ -84,9 +84,12 @@ }) (final: prev: { - postgresql = prev.postgresql_15.overrideAttrs (_: + postgresql = prev.postgresql.overrideAttrs (_: final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; + LC_CTYPE = "C"; + + doCheck = false; }); }) ]; From c3bf18ccdf3ef46c99d1e9a8f4eb048521547d87 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Mon, 14 Oct 2024 21:41:03 -0400 Subject: [PATCH 10/10] fix: apply WIP literate haskell 9.10 fix --- flake.lock | 14 +++++++------- flake.nix | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index fdd7957fa..aa7f84aa4 100644 --- a/flake.lock +++ b/flake.lock @@ -226,17 +226,17 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1728361811, - "narHash": "sha256-wJIfJ5VUsq0VVz6z3GjRPNFhP1huMlc7he++kpm7JkA=", + "lastModified": 1728955493, + "narHash": "sha256-paBZF1BXIPxaWKqbn3glR17BHjTiDl8r5Ojk/Q0cPsM=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c", + "rev": "d3b4fe3f64493a98de755e3af6dd08cae0e2961a", "type": "github" }, "original": { "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c", + "rev": "d3b4fe3f64493a98de755e3af6dd08cae0e2961a", "type": "github" } }, @@ -770,11 +770,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1728000661, - "narHash": "sha256-yOYjHm31HMwuxvVjwc85E+s6EVn0tF3Hj4H+sTwSTv4=", + "lastModified": 1728691846, + "narHash": "sha256-WXPaGfa8D64YjKU31HOIx2cLfYkMfZT9yYO2XdYUerA=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "bc4ee5c29ee435745f68a27feef49e8f8cda9341", + "rev": "38e3ccb33364353514117c552b7362295ea5b02e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cb0f6488b..4883b3f9a 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ nixpkgs.follows = "haskellNix/nixpkgs-unstable"; utils.url = "github:numtide/flake-utils"; haskellNix = { - url = "github:input-output-hk/haskell.nix?rev=d1f3c854b8d4b02ea4cfbaf553cd22d615a5ad6c"; + url = "github:input-output-hk/haskell.nix?rev=d3b4fe3f64493a98de755e3af6dd08cae0e2961a"; inputs.hackage.follows = "hackageNix"; }; hackageNix = {