From 5226bb62c1e8a0124ea124d1ec896ffc64864229 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 2 Oct 2024 06:57:09 +1000 Subject: [PATCH 1/6] Make it build with ghc-9.10 --- cabal.project | 8 +++++++- .../src/Cardano/DbSync/Era/Shelley/Generic/Tx/Alonzo.hs | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 444ed9962..3729a70b2 100644 --- a/cabal.project +++ b/cabal.project @@ -68,11 +68,17 @@ 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: -- 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 -- --------------------------------------------------------- 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 e00937ec2a81778ecd4c604257f6fda11a9c04e7 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 2 Oct 2024 06:57:13 +1000 Subject: [PATCH 2/6] 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 07c955018..552cf1e27 100644 --- a/flake.nix +++ b/flake.nix @@ -146,7 +146,7 @@ let compilers = if (system == "x86_64-linux") then - ["ghc96" "ghc98"] + ["ghc96" "ghc98" "ghc910"] else ["ghc98"]; in From ceff42547695a262a44761b33c747379f4eec44d Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Tue, 15 Oct 2024 12:16:53 +1300 Subject: [PATCH 3/6] Build cabal-install with ghc 9.8.2 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 552cf1e27..bddeb3e04 100644 --- a/flake.nix +++ b/flake.nix @@ -163,7 +163,7 @@ }; shell.tools = { - cabal = "3.10.3.0"; + cabal = { version = "3.10.3.0"; compiler-nix-name = "ghc982"; }; ghcid = "0.8.8"; haskell-language-server = { src = From cc579ca69089ac0027e28e6f7e8554a2fd96be78 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 3 Oct 2024 14:34:27 -0400 Subject: [PATCH 4/6] Update nix devShell tools * Bump cabal@latest * Remove ghcid --- flake.lock | 12 ++++++------ flake.nix | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 3dd18286a..19cb31e47 100644 --- a/flake.lock +++ b/flake.lock @@ -458,11 +458,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1721825987, - "narHash": "sha256-PPcma4tjozwXJAWf+YtHUQUulmxwulVlwSQzKItx/n8=", + "lastModified": 1728687575, + "narHash": "sha256-38uD8SqT557eh5yyRYuthKm1yTtiWzAN0FH7L/01QKM=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "eb61f2c14e1f610ec59117ad40f8690cddbf80cb", + "rev": "86c2bd46e8a08f62ea38ffe77cb4e9c337b42217", "type": "github" }, "original": { @@ -802,11 +802,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bddeb3e04..fd96b40cf 100644 --- a/flake.nix +++ b/flake.nix @@ -86,7 +86,7 @@ (final: prev: { postgresql = prev.postgresql.overrideAttrs (_: final.lib.optionalAttrs (final.stdenv.hostPlatform.isMusl) { - doCheck = false; + NIX_LDFLAGS = "--push-state --as-needed -lstdc++ --pop-state"; }); }) ]; @@ -163,8 +163,7 @@ }; shell.tools = { - cabal = { version = "3.10.3.0"; compiler-nix-name = "ghc982"; }; - ghcid = "0.8.8"; + cabal = "latest"; haskell-language-server = { src = if config.compiler-nix-name == "ghc8107" then From 55c334f9d5f5c29ec3e79de5ef2ec64b9e6afcd7 Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Thu, 10 Oct 2024 09:19:51 -0400 Subject: [PATCH 5/6] fix: postgresql static build --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index fd96b40cf..a73f5fd23 100644 --- a/flake.nix +++ b/flake.nix @@ -87,6 +87,9 @@ 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 70678fb570dfe12e57650fc23b25534a215361ab Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Fri, 25 Oct 2024 10:05:51 -0400 Subject: [PATCH 6/6] CI: Temporarily remove GHC-9.10 from build matrix --- .github/workflows/haskell.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 7284013eb..2f19cec64 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -19,7 +19,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - compiler-nix-name: [ghc810, ghc96, ghc98, ghc910] + # TODO: Add ghc910 when input-output-hk/devx is fixed + compiler-nix-name: [ghc810, ghc96, ghc98] include: # We want a single job, because macOS runners are scarce. - os: macos-latest