Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: GHC 9.10 #1873

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

-- ---------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion cardano-chain-gen/cardano-chain-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand Down
45 changes: 23 additions & 22 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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=d3b4fe3f64493a98de755e3af6dd08cae0e2961a";
inputs.hackage.follows = "hackageNix";
};
hackageNix = {
Expand Down Expand Up @@ -82,6 +82,16 @@
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";
LC_CTYPE = "C";

doCheck = false;
});
})
];
};

Expand Down Expand Up @@ -139,7 +149,7 @@
let
compilers =
if (system == "x86_64-linux") then
["ghc96" "ghc98"]
["ghc96" "ghc98" "ghc910"]
else
["ghc98"];
in
Expand All @@ -156,7 +166,7 @@
};

shell.tools = {
cabal = "3.10.3.0";
cabal = "3.12.1.0";
ghcid = "0.8.8";
haskell-language-server = {
src =
Expand Down
Loading