From 3b13704d3e0e55c99c673456990eb4e290a1ac78 Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Thu, 1 Sep 2022 12:16:56 +0100 Subject: [PATCH] Bump hackage.nix, haskell.nix, and index-state (#4818) * Bump haskell.nix and hackage.nix It's been a while * Bump index-state * Bump cardano-prelude * Bump cabal To avoid https://github.com/haskell/cabal/issues/8370 which affects 3.6.2.0. * Loosen some upper bounds * Fixups for new versions * New PyF is broken --- cabal.project | 4 ++-- flake.lock | 12 ++++++------ nix/pkgs/haskell/extra.nix | 4 +++- nix/pkgs/haskell/haskell.nix | 2 +- plutus-core/executables/Common.hs | 4 ++-- plutus-core/plutus-core.cabal | 10 +++++----- plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs | 13 +------------ .../plutus-ir/src/PlutusIR/Transform/DeadCode.hs | 2 +- .../Evaluation/Machine/Cek/ExBudgetMode.hs | 2 +- plutus-errors/plutus-errors.cabal | 4 ++-- plutus-tx-plugin/plutus-tx-plugin.cabal | 4 +++- 11 files changed, 27 insertions(+), 34 deletions(-) diff --git a/cabal.project b/cabal.project index dde3d2cc03d..4840e2a06c2 100644 --- a/cabal.project +++ b/cabal.project @@ -1,5 +1,5 @@ -- Bump this if you need newer packages -index-state: 2022-05-12T00:00:00Z +index-state: 2022-08-31T00:00:00Z packages: doc plutus-benchmark @@ -64,7 +64,7 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/cardano-prelude - tag: fd773f7a58412131512b9f694ab95653ac430852 + tag: 533aec85c1ca05c7d171da44b89341fb736ecfe5 subdir: cardano-prelude cardano-prelude-test diff --git a/flake.lock b/flake.lock index 2e76d69192c..21aec64adc2 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1659230043, - "narHash": "sha256-YQdiUsDpJ+//OKUwPqUYb2Yj4EQWPYR8UNbfnPQIaUM=", + "lastModified": 1661919111, + "narHash": "sha256-E+T8fPxEdxcuS/dOcmY1ctBFl96GV5J2w7IeSmGCvdU=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "273bd35f0de3b4a944bbe57510d80c4939150f41", + "rev": "d2077b0703f10ab08a071669729805d3bfea340d", "type": "github" }, "original": { @@ -68,11 +68,11 @@ "haskell-nix": { "flake": false, "locked": { - "lastModified": 1659260510, - "narHash": "sha256-VNrw6Pc/vnkQ0xzaoJAJZjQcUQB50hlYdP4S4vz+5gg=", + "lastModified": 1661131248, + "narHash": "sha256-UCbiKv4DWeGVeOknUbQqJkk0sZAn34CSntjIG12uWOg=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "c2f14344f119f68c10be2ea84fd372d8d8d16cd7", + "rev": "e36a34c4abc02287ec79bf88a0c993f6b66f9945", "type": "github" }, "original": { diff --git a/nix/pkgs/haskell/extra.nix b/nix/pkgs/haskell/extra.nix index 4de8e65901b..a35e3f66745 100644 --- a/nix/pkgs/haskell/extra.nix +++ b/nix/pkgs/haskell/extra.nix @@ -63,8 +63,10 @@ let }; cabalInstallProject = haskell-nix.hackage-project { name = "cabal-install"; - version = "3.6.2.0"; + version = "3.8.1.0"; inherit compiler-nix-name index-state; + # The test suite depends on a nonexistent package... + configureArgs = "--disable-tests"; }; cardanoRepoToolProject = haskell-nix.cabalProject' { src = sources.cardano-repo-tool; diff --git a/nix/pkgs/haskell/haskell.nix b/nix/pkgs/haskell/haskell.nix index d30227b23f1..f4f9469bec6 100644 --- a/nix/pkgs/haskell/haskell.nix +++ b/nix/pkgs/haskell/haskell.nix @@ -34,7 +34,7 @@ let "https://github.com/Quid2/flat.git"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm"; # editorconfig-checker-disable-line "https://github.com/input-output-hk/cardano-base"."cc049d7c9b9a0129c15b1355fd1dff9e1a1a551c" = "sha256-Ckbl3QkKOuMkIuTsSIWxWly6NNuhGP53q+nwYyBXzz8="; # editorconfig-checker-disable-line "https://github.com/input-output-hk/cardano-crypto.git"."07397f0e50da97eaa0575d93bee7ac4b2b2576ec" = "06sdx5ndn2g722jhpicmg96vsrys89fl81k8290b3lr6b1b0w4m3"; # editorconfig-checker-disable-line - "https://github.com/input-output-hk/cardano-prelude"."fd773f7a58412131512b9f694ab95653ac430852" = "02jddik1yw0222wd6q0vv10f7y8rdgrlqaiy83ph002f9kjx7mh6"; # editorconfig-checker-disable-line + "https://github.com/input-output-hk/cardano-prelude"."533aec85c1ca05c7d171da44b89341fb736ecfe5" = "0z2y3wzppc12bpn9bl48776ms3nszw8j58xfsdxf97nzjgrmd62g"; # editorconfig-checker-disable-line "https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx"; # editorconfig-checker-disable-line }; # Configuration settings needed for cabal configure to work when cross compiling diff --git a/plutus-core/executables/Common.hs b/plutus-core/executables/Common.hs index bc086f47b0b..5f7e56a50ec 100644 --- a/plutus-core/executables/Common.hs +++ b/plutus-core/executables/Common.hs @@ -145,7 +145,7 @@ printBudgetStateBudget model b = putStrLn $ "CPU budget: " ++ show cpu putStrLn $ "Memory budget: " ++ show mem -printBudgetStateTally :: (Eq fun, Cek.Hashable fun, Show fun) +printBudgetStateTally :: (Cek.Hashable fun, Show fun) => UPLC.Term UPLC.Name PLC.DefaultUni PLC.DefaultFun () -> CekModel -> Cek.CekExTally fun -> IO () printBudgetStateTally term model (Cek.CekExTally costs) = do putStrLn $ "Const " ++ pbudget (Cek.BStep Cek.BConst) @@ -204,7 +204,7 @@ class PrintBudgetState cost where instance PrintBudgetState Cek.CountingSt where printBudgetState _term model (Cek.CountingSt budget) = printBudgetStateBudget model budget -instance (Eq fun, Cek.Hashable fun, Show fun) => PrintBudgetState (Cek.TallyingSt fun) where +instance (Cek.Hashable fun, Show fun) => PrintBudgetState (Cek.TallyingSt fun) where printBudgetState term model (Cek.TallyingSt tally budget) = do printBudgetStateBudget model budget putStrLn "" diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index 05adc1fa32e..eef3b4cd1a1 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -259,7 +259,7 @@ library build-depends: , aeson - , algebraic-graphs >=0.3 + , algebraic-graphs >=0.7 , array , barbies , base >=4.9 && <5 @@ -305,7 +305,7 @@ library , semigroupoids , semigroups >=0.19.1 , serialise - , some <1.0.3 + , some , template-haskell , text , th-compat @@ -364,7 +364,7 @@ library plutus-core-testlib , prettyprinter >=1.1.0.1 , prettyprinter-configurable , size-based - , some <1.0.3 + , some , Stream , tasty , tasty-golden @@ -737,7 +737,7 @@ library index-envs , containers , extra , nonempty-vector - , ral ==0.1 + , ral ^>=0.2 , vector -- broken for ral-0.2 conflicts with cardano-binary:recursion-schemes @@ -752,7 +752,7 @@ benchmark index-envs-bench , criterion >=1.5.9.0 , index-envs , nonempty-vector - , ral ==0.1 + , ral ^>=0.2 , random >=1.2.0 -- broken for ral-0.2 conflicts with cardano-binary:recursion-schemes diff --git a/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs b/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs index b44c8fb7ed0..4717300df5e 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs @@ -38,6 +38,7 @@ import PlutusIR.Core.Type import Control.Lens hiding (Strict, (<.>)) import Data.Functor.Apply +import Data.Functor.Bind.Class infixr 6 <^> @@ -105,18 +106,6 @@ bindingIds f = \case <.*> traverse1Maybe ((PLC.tyVarDeclName . PLC.theUnique) f) tvdecls <.> PLC.theUnique f n <.*> traverse1Maybe ((PLC.varDeclName . PLC.theUnique) f) vdecls) - where - -- | Traverse using 'Apply', but getting back the result in 'MaybeApply f' instead of in 'f'. - traverse1Maybe :: (Apply f, Traversable t) => (a -> f b) -> t a -> MaybeApply f (t b) - traverse1Maybe f' = traverse (MaybeApply . Left . f') - - -- | Apply a non-empty container of functions to a possibly-empty-with-unit container of values. - -- Taken from: - (<.*>) :: (Apply f) => f (a -> b) -> MaybeApply f a -> f b - ff <.*> MaybeApply (Left fa) = ff <.> fa - ff <.*> MaybeApply (Right a) = ($ a) <$> ff - infixl 4 <.*> - {-# INLINE termSubkinds #-} -- | Get all the direct child 'Kind's of the given 'Term'. diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs index 6e8765fa582..ab541a03f4a 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs @@ -51,7 +51,7 @@ calculateLiveness ver t = let depGraph :: G.Graph Deps.Node depGraph = fst $ Deps.runTermDeps ver t - in Set.fromList $ T.reachable Deps.Root depGraph + in Set.fromList $ T.reachable depGraph Deps.Root live :: (MonadReader Liveness m, PLC.HasUnique n unique) => n -> m Bool live n = diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/ExBudgetMode.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/ExBudgetMode.hs index ddadb93a354..3f54ff1191f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/ExBudgetMode.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/ExBudgetMode.hs @@ -98,7 +98,7 @@ instance (Show fun, Ord fun) => Pretty (TallyingSt fun) where ] -- | For a detailed report on what costs how much + the same overall budget that 'Counting' gives. -tallying :: (Eq fun, Hashable fun) => ExBudgetMode (TallyingSt fun) uni fun +tallying :: (Hashable fun) => ExBudgetMode (TallyingSt fun) uni fun tallying = monoidalBudgeting $ \key budgetToSpend -> TallyingSt (CekExTally $ singleton key budgetToSpend) budgetToSpend diff --git a/plutus-errors/plutus-errors.cabal b/plutus-errors/plutus-errors.cabal index 4332cb2bde1..36fc1c463e9 100644 --- a/plutus-errors/plutus-errors.cabal +++ b/plutus-errors/plutus-errors.cabal @@ -61,7 +61,7 @@ library , plutus-tx-plugin ^>=1.0 , prettyprinter >=1.1.0.1 , template-haskell >=2.16 - , th-abstraction <0.4 + , th-abstraction <0.5 executable plutus-errors-next import: lang @@ -84,4 +84,4 @@ executable plutus-errors-bootstrap , plutus-core , plutus-errors , template-haskell >=2.16 - , th-abstraction <0.4 + , th-abstraction <0.5 diff --git a/plutus-tx-plugin/plutus-tx-plugin.cabal b/plutus-tx-plugin/plutus-tx-plugin.cabal index cb7844fdb63..6db8e69f716 100644 --- a/plutus-tx-plugin/plutus-tx-plugin.cabal +++ b/plutus-tx-plugin/plutus-tx-plugin.cabal @@ -68,6 +68,8 @@ library PlutusTx.PIRTypes PlutusTx.PLCTypes + -- this comment should be by the dep, but cabal-fmt moves it :( + -- Newer PyF is mysteriously broken, hence the bound: https://github.com/guibou/PyF/issues/111 build-depends: , array , base >=4.9 && <5 @@ -82,7 +84,7 @@ library , plutus-core ^>=1.0 , plutus-tx ^>=1.0 , prettyprinter - , PyF + , PyF <0.11 , template-haskell , text , transformers