From bc0ba1b050629c5ab7b2ffda675ed1adc6971286 Mon Sep 17 00:00:00 2001 From: jmcardon Date: Mon, 4 Nov 2024 15:35:11 -0500 Subject: [PATCH 1/5] Separate repl into separate project - Move tracing flags to repl sublibrary - Fix repl builtins charging gas on the repl --- docs/builtins/General/enforce.md | 4 +- gasmodel/Pact/Core/GasModel/ContractBench.hs | 14 ++- {repl => pact-repl}/Main.hs | 0 .../Pact/Core/IR/Eval/Direct/CoreBuiltin.hs | 0 .../Pact/Core/IR/Eval/Direct/Evaluator.hs | 2 +- .../Pact/Core/IR/Eval/Direct/ReplBuiltin.hs | 0 .../Pact/Core/IR/Eval/Direct/Types.hs | 0 {pact => pact-repl}/Pact/Core/Repl.hs | 0 .../Pact/Core/Repl/BuiltinDocs.hs | 0 .../Pact/Core/Repl/BuiltinDocs/Internal.hs | 15 +++- {pact => pact-repl}/Pact/Core/Repl/Compile.hs | 0 .../Pact/Core/Repl/Runtime/ReplBuiltin.hs | 0 .../Pact/Core/Repl/UserDocs.hs | 0 {pact => pact-repl}/Pact/Core/Repl/Utils.hs | 23 +++++ pact-tng.cabal | 86 +++++++++---------- pact/Pact/Core/Builtin.hs | 6 ++ pact/Pact/Core/Compile.hs | 4 +- pact/Pact/Core/Debug.hs | 32 ++----- pact/Pact/Core/Evaluate.hs | 14 --- profile-tx/ProfileTx.hs | 4 +- 20 files changed, 114 insertions(+), 90 deletions(-) rename {repl => pact-repl}/Main.hs (100%) rename {pact => pact-repl}/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs (100%) rename {pact => pact-repl}/Pact/Core/IR/Eval/Direct/Evaluator.hs (99%) rename {pact => pact-repl}/Pact/Core/IR/Eval/Direct/ReplBuiltin.hs (100%) rename {pact => pact-repl}/Pact/Core/IR/Eval/Direct/Types.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl/BuiltinDocs.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl/BuiltinDocs/Internal.hs (85%) rename {pact => pact-repl}/Pact/Core/Repl/Compile.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl/Runtime/ReplBuiltin.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl/UserDocs.hs (100%) rename {pact => pact-repl}/Pact/Core/Repl/Utils.hs (88%) diff --git a/docs/builtins/General/enforce.md b/docs/builtins/General/enforce.md index f43dbd602..061fb562a 100644 --- a/docs/builtins/General/enforce.md +++ b/docs/builtins/General/enforce.md @@ -18,7 +18,7 @@ Use the following arguments to specify the test expression and error message for | Argument | Type | Description | |----------|--------|------------------------------------------------| -| `expression` | bool | Specifies the expression to evaluate. | +| expression | bool | Specifies the expression to evaluate. | | `message` | string | Specifies the error message to display if the `expression` evaluates as false. | ### Return values @@ -34,7 +34,7 @@ pact> (enforce (= (+ 2 2) 4) "All is well") true ``` -Because the specified expression (`2 + 2 = 4`) is true, the function returns true and the transaction continues. +Because the specified expression (`2 + 2 = 4`) is true, the function returns true and the transaction continues. The following example demonstrates how to use the `enforce` function to evaluate the expression `(2 + 2) != 4`: diff --git a/gasmodel/Pact/Core/GasModel/ContractBench.hs b/gasmodel/Pact/Core/GasModel/ContractBench.hs index 63c626e09..2108c4e22 100644 --- a/gasmodel/Pact/Core/GasModel/ContractBench.hs +++ b/gasmodel/Pact/Core/GasModel/ContractBench.hs @@ -41,6 +41,8 @@ import Pact.Core.Gas import Pact.Core.Namespace import Pact.Core.Serialise import Pact.Core.Persistence.MockPersistence +import qualified Pact.Core.IR.Eval.Direct.Evaluator as Direct +import qualified Pact.Core.IR.Eval.Direct.CoreBuiltin as Direct import Pact.Core.Errors import Pact.Core.Interpreter @@ -59,7 +61,15 @@ interpretBigStep :: Interpreter ExecRuntime CoreBuiltin Info interpretBigStep = evalInterpreter interpretDirect :: Interpreter ExecRuntime CoreBuiltin Info -interpretDirect = evalDirectInterpreter +interpretDirect = + Interpreter runGuard runTerm resume evalWithCap + where + runTerm purity term = Direct.eval purity benv term + runGuard info g = Direct.interpretGuard info benv g + resume info defPact = Direct.evalResumePact info benv defPact + evalWithCap info purity ct term = + Direct.evalWithinCap info purity benv ct term + benv = Direct.coreBuiltinEnv data CoinBenchSenders @@ -179,7 +189,7 @@ setupCoinTxs pdb = do putStrLn "Setting up the coin contract and the default funds" source <- T.readFile (contractsPath "coin-v5-create.pact") ee <- setupBenchEvalEnv pdb coinInitSigners coinInitData - () <$ runPactTxFromSource ee source evalDirectInterpreter + () <$ runPactTxFromSource ee source interpretDirect _run :: IO () diff --git a/repl/Main.hs b/pact-repl/Main.hs similarity index 100% rename from repl/Main.hs rename to pact-repl/Main.hs diff --git a/pact/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs b/pact-repl/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs similarity index 100% rename from pact/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs rename to pact-repl/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs diff --git a/pact/Pact/Core/IR/Eval/Direct/Evaluator.hs b/pact-repl/Pact/Core/IR/Eval/Direct/Evaluator.hs similarity index 99% rename from pact/Pact/Core/IR/Eval/Direct/Evaluator.hs rename to pact-repl/Pact/Core/IR/Eval/Direct/Evaluator.hs index ddc40f5fc..c182e9a7f 100644 --- a/pact/Pact/Core/IR/Eval/Direct/Evaluator.hs +++ b/pact-repl/Pact/Core/IR/Eval/Direct/Evaluator.hs @@ -675,7 +675,7 @@ applyLam -> EvalM e b i (EvalValue e b i) applyLam nclo@(N (NativeFn b env fn arity i)) args | arity == argLen = do - chargeFlatNativeGas i b + when (builtinChargesGas b) $ chargeFlatNativeGas i b fn i b env args | argLen > arity = throwExecutionError i ClosureAppliedToTooManyArgs | null args = return (VClosure nclo) diff --git a/pact/Pact/Core/IR/Eval/Direct/ReplBuiltin.hs b/pact-repl/Pact/Core/IR/Eval/Direct/ReplBuiltin.hs similarity index 100% rename from pact/Pact/Core/IR/Eval/Direct/ReplBuiltin.hs rename to pact-repl/Pact/Core/IR/Eval/Direct/ReplBuiltin.hs diff --git a/pact/Pact/Core/IR/Eval/Direct/Types.hs b/pact-repl/Pact/Core/IR/Eval/Direct/Types.hs similarity index 100% rename from pact/Pact/Core/IR/Eval/Direct/Types.hs rename to pact-repl/Pact/Core/IR/Eval/Direct/Types.hs diff --git a/pact/Pact/Core/Repl.hs b/pact-repl/Pact/Core/Repl.hs similarity index 100% rename from pact/Pact/Core/Repl.hs rename to pact-repl/Pact/Core/Repl.hs diff --git a/pact/Pact/Core/Repl/BuiltinDocs.hs b/pact-repl/Pact/Core/Repl/BuiltinDocs.hs similarity index 100% rename from pact/Pact/Core/Repl/BuiltinDocs.hs rename to pact-repl/Pact/Core/Repl/BuiltinDocs.hs diff --git a/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs b/pact-repl/Pact/Core/Repl/BuiltinDocs/Internal.hs similarity index 85% rename from pact/Pact/Core/Repl/BuiltinDocs/Internal.hs rename to pact-repl/Pact/Core/Repl/BuiltinDocs/Internal.hs index ab44ffbe0..e59e86a68 100644 --- a/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs +++ b/pact-repl/Pact/Core/Repl/BuiltinDocs/Internal.hs @@ -9,11 +9,14 @@ import Language.Haskell.TH.Syntax import System.Directory import System.FilePath +import Data.Default import Control.Monad +import Control.Monad.IO.Class import qualified Data.Text.IO as T import qualified Data.Text as T import qualified Data.Map.Strict as M import Data.Functor +import Text.Pandoc hiding (runIO) listBuiltinDocs :: IO [FilePath] listBuiltinDocs = do @@ -41,10 +44,20 @@ mkBuiltinDocs = embedIO action files <- listBuiltinDocs cnt <- forM files $ \f -> do let bname = takeBaseName f - content <- T.readFile f + content <- runIOorExplode $ + writeANSI writerOpts =<< readMarkdown readerOpts =<< liftIO (T.readFile f) pure (normalizedNameToBuiltin $ T.pack bname, MarkdownDoc content) pure $ M.fromList cnt +readerOpts :: ReaderOptions +readerOpts = def + { readerExtensions = pandocExtensions + } + +writerOpts :: WriterOptions +writerOpts = def + { writerExtensions = pandocExtensions + } builtinToNormalizedName :: T.Text -> T.Text builtinToNormalizedName = \case diff --git a/pact/Pact/Core/Repl/Compile.hs b/pact-repl/Pact/Core/Repl/Compile.hs similarity index 100% rename from pact/Pact/Core/Repl/Compile.hs rename to pact-repl/Pact/Core/Repl/Compile.hs diff --git a/pact/Pact/Core/Repl/Runtime/ReplBuiltin.hs b/pact-repl/Pact/Core/Repl/Runtime/ReplBuiltin.hs similarity index 100% rename from pact/Pact/Core/Repl/Runtime/ReplBuiltin.hs rename to pact-repl/Pact/Core/Repl/Runtime/ReplBuiltin.hs diff --git a/pact/Pact/Core/Repl/UserDocs.hs b/pact-repl/Pact/Core/Repl/UserDocs.hs similarity index 100% rename from pact/Pact/Core/Repl/UserDocs.hs rename to pact-repl/Pact/Core/Repl/UserDocs.hs diff --git a/pact/Pact/Core/Repl/Utils.hs b/pact-repl/Pact/Core/Repl/Utils.hs similarity index 88% rename from pact/Pact/Core/Repl/Utils.hs rename to pact-repl/Pact/Core/Repl/Utils.hs index 55d644281..c1d544925 100644 --- a/pact/Pact/Core/Repl/Utils.hs +++ b/pact-repl/Pact/Core/Repl/Utils.hs @@ -9,6 +9,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE DataKinds #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Pact.Core.Repl.Utils @@ -68,6 +69,7 @@ import Pact.Core.Environment import Pact.Core.Type import Pact.Core.Builtin import Pact.Core.PactValue +import Pact.Core.Debug import qualified Pact.Core.IR.Term as Term import System.Console.Haskeline.Completion @@ -246,3 +248,24 @@ replPrintLn' :: Text -> EvalM 'ReplRuntime b SpanInfo () replPrintLn' p = do r <- getReplState _replOutputLine r p + +-- This orphan instance allows us to separate +-- the repl declaration out, as ugly as it is +instance DebugPrintable 'ReplRuntime (ReplBuiltin CoreBuiltin) where + debugPrint dp term = + ask >>= \case + ReplEnv _ -> do + case dp of + DPLexer -> whenReplFlagSet ReplDebugLexer $ liftIO $ do + putStrLn "----------- Lexer output -----------------" + print (pretty term) + DPParser -> whenReplFlagSet ReplDebugParser $ + liftIO $ do + putStrLn "----------- Parser output ----------------" + print (pretty term) + DPDesugar -> whenReplFlagSet ReplDebugDesugar $ case term of + Term.TLTerm t -> + liftIO $ do + putStrLn "----------- Desugar output ---------------" + print (pretty t) + _ -> pure () diff --git a/pact-tng.cabal b/pact-tng.cabal index 64105a2cd..a35d2b45a 100644 --- a/pact-tng.cabal +++ b/pact-tng.cabal @@ -185,15 +185,6 @@ library import: pact-common hs-source-dirs: pact - if (flag(with-funcall-tracing)) - cpp-options: -DWITH_FUNCALL_TRACING - - if (flag(with-native-tracing)) - cpp-options: -DWITH_NATIVE_TRACING - - if (flag(with-native-tracing) || flag(with-funcall-tracing)) - cpp-options: -DWITH_TRACING - if (flag(with-crypto)) build-depends: pact-tng:pact-crypto else @@ -246,7 +237,6 @@ library Pact.Core.Evaluate Pact.Core.Scheme Pact.Core.SPV - Pact.Core.Repl Pact.Core.SizeOf Pact.Core.SizeOf.Deriving Pact.Core.StackFrame @@ -267,11 +257,6 @@ library Pact.Core.IR.Term Pact.Core.IR.Desugar - Pact.Core.IR.Eval.Direct.Evaluator - Pact.Core.IR.Eval.Direct.CoreBuiltin - Pact.Core.IR.Eval.Direct.ReplBuiltin - Pact.Core.IR.Eval.Direct.Types - -- Core IR Evaluator modules Pact.Core.IR.Eval.Runtime Pact.Core.IR.Eval.Runtime.Types @@ -286,14 +271,6 @@ library Pact.Core.Trans.MPFR Pact.Core.Version - -- Repl - Pact.Core.Repl.Utils - Pact.Core.Repl.Runtime.ReplBuiltin - Pact.Core.Repl.Compile - Pact.Core.Repl.BuiltinDocs - Pact.Core.Repl.BuiltinDocs.Internal - Pact.Core.Repl.UserDocs - -- Serialization Pact.Core.Serialise Pact.Core.Serialise.LegacyPact @@ -311,6 +288,44 @@ library extra-libraries: mpfr +library pact-repl + import: pact-common + hs-source-dirs: pact-repl + + if (flag(with-crypto)) + build-depends: pact-tng:pact-crypto + else + cpp-options: -DWITHOUT_CRYPTO + + if (flag(with-funcall-tracing)) + cpp-options: -DWITH_FUNCALL_TRACING + + if (flag(with-native-tracing)) + cpp-options: -DWITH_NATIVE_TRACING + + if (flag(with-native-tracing) || flag(with-funcall-tracing)) + cpp-options: -DWITH_TRACING + + exposed-modules: + Pact.Core.Repl + Pact.Core.Repl.Utils + Pact.Core.Repl.Runtime.ReplBuiltin + Pact.Core.Repl.Compile + Pact.Core.Repl.BuiltinDocs + Pact.Core.Repl.BuiltinDocs.Internal + Pact.Core.Repl.UserDocs + + Pact.Core.IR.Eval.Direct.Evaluator + Pact.Core.IR.Eval.Direct.CoreBuiltin + Pact.Core.IR.Eval.Direct.ReplBuiltin + Pact.Core.IR.Eval.Direct.Types + + build-depends: + , pact-tng + , pact-tng:pact-crypto + , filepath + , pandoc + library pact-lsp import: pact-common hs-source-dirs: pact-lsp @@ -322,6 +337,7 @@ library pact-lsp build-depends: , pact-tng + , pact-tng:pact-repl , lsp , lsp-types , filepath @@ -334,6 +350,7 @@ executable gasmodel build-depends: , pact-tng + , pact-tng:pact-repl , criterion , terminal-progress-bar , neat-interpolation @@ -369,10 +386,11 @@ executable profile-tx executable pact import: pact-common - main-is: repl/Main.hs + main-is: pact-repl/Main.hs build-depends: base , pact-tng + , pact-tng:pact-repl , pact-tng:pact-lsp , optparse-applicative , pact-tng:pact-request-api @@ -523,6 +541,7 @@ test-suite core-tests , semirings , neat-interpolation , pact-tng:pact-request-api + , pact-tng:pact-repl , pact-tng:pact-lsp , pact-tng:test-utils , pact-tng:unsafe @@ -568,22 +587,3 @@ test-suite core-tests , Pact.Core.Test.ServerUtils if (flag(with-crypto)) build-depends: pact-tng:pact-crypto - - --- -- tools --- executable pact-server --- import: pact-common --- hs-source-dirs: pact-server - --- main-is: Pact/Server.hs - --- build-depends: --- , pact-tng --- , async --- , fast-logger --- , filepath --- , servant --- , servant-server --- ghc-options: -Wall -threaded -rtsopts -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints --- ghc-prof-options: -fprof-auto -fprof-auto-calls --- default-language: Haskell2010 diff --git a/pact/Pact/Core/Builtin.hs b/pact/Pact/Core/Builtin.hs index cd0f0f2eb..9e3440e0b 100644 --- a/pact/Pact/Core/Builtin.hs +++ b/pact/Pact/Core/Builtin.hs @@ -566,6 +566,7 @@ coreBuiltinToUserText = \case instance IsBuiltin CoreBuiltin where builtinName = NativeName . coreBuiltinToText + builtinChargesGas _ = True builtinArity = \case CoreAdd -> 2 -- Num -> @@ -783,6 +784,7 @@ data ReplOnlyBuiltin instance IsBuiltin ReplOnlyBuiltin where builtinName = NativeName . replBuiltinsToText + builtinChargesGas _ = False builtinArity = \case RExpect -> 3 RExpectFailure -> 2 @@ -843,6 +845,9 @@ instance IsBuiltin b => IsBuiltin (ReplBuiltin b) where builtinArity = \case RBuiltinWrap b -> builtinArity b RBuiltinRepl b -> builtinArity b + builtinChargesGas = \case + RBuiltinWrap b -> builtinChargesGas b + RBuiltinRepl b -> builtinChargesGas b -- RLoad -> 1 @@ -961,6 +966,7 @@ replCoreBuiltinOnlyMap = class Show b => IsBuiltin b where builtinArity :: b -> Int builtinName :: b -> NativeName + builtinChargesGas :: b -> Bool instance Pretty CoreBuiltin where diff --git a/pact/Pact/Core/Compile.hs b/pact/Pact/Core/Compile.hs index 49eb6f6f3..400b31acc 100644 --- a/pact/Pact/Core/Compile.hs +++ b/pact/Pact/Core/Compile.hs @@ -153,7 +153,7 @@ evalModuleGovernance interpreter tl = do compileDesugarOnly :: forall e b i - . (HasCompileEnv b i) + . (HasCompileEnv b i, DebugPrintable e b) => Interpreter e b i -> Lisp.TopLevel i -> EvalM e b i (EvalTopLevel b i, S.Set ModuleName) @@ -169,7 +169,7 @@ compileDesugarOnly interpreter tl = do interpretTopLevel :: forall e b i - . (HasCompileEnv b i) + . (HasCompileEnv b i, DebugPrintable e b) => Interpreter e b i -> RawCode -> Lisp.TopLevel i diff --git a/pact/Pact/Core/Debug.hs b/pact/Pact/Core/Debug.hs index 8fc2f5e7e..9527c7e5a 100644 --- a/pact/Pact/Core/Debug.hs +++ b/pact/Pact/Core/Debug.hs @@ -1,22 +1,23 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FunctionalDependencies #-} module Pact.Core.Debug ( DebugFlag(..) , DebugPrint(..) - , debugPrint + , DebugPrintable(..) ) where -import Control.Monad.Reader import Pact.Core.Type import Pact.Core.Names import Pact.Core.Syntax.LexUtils(PosToken) import Pact.Core.Environment import qualified Pact.Core.Syntax.ParseTree as Syntax import qualified Pact.Core.IR.Term as Term -import Pact.Core.Repl.Utils -import Pact.Core.Pretty +import Pact.Core.Builtin (CoreBuiltin) data DebugPrint b i term where DPLexer :: DebugPrint b i [PosToken] @@ -29,23 +30,8 @@ data DebugFlag | DFDesugar deriving (Show, Eq, Ord, Enum, Bounded) -debugPrint :: (Pretty b) => DebugPrint b i term -> term -> EvalM e b i () -debugPrint dp term = - ask >>= \case - ExecEnv _ -> pure () - ReplEnv _ -> do - case dp of - DPLexer -> whenReplFlagSet ReplDebugLexer $ liftIO $ do - putStrLn "----------- Lexer output -----------------" - print (pretty term) - DPParser -> whenReplFlagSet ReplDebugParser $ - liftIO $ do - putStrLn "----------- Parser output ----------------" - print (pretty term) - DPDesugar -> whenReplFlagSet ReplDebugDesugar $ case term of - Term.TLTerm t -> - liftIO $ do - putStrLn "----------- Desugar output ---------------" - print (pretty t) - _ -> pure () +class DebugPrintable (e :: RuntimeMode) b | e -> b where + debugPrint :: DebugPrint b i term -> term -> EvalM e b i () +instance DebugPrintable 'ExecRuntime CoreBuiltin where + debugPrint _ _ = pure () diff --git a/pact/Pact/Core/Evaluate.hs b/pact/Pact/Core/Evaluate.hs index c0345b252..e7f6fcd3d 100644 --- a/pact/Pact/Core/Evaluate.hs +++ b/pact/Pact/Core/Evaluate.hs @@ -23,7 +23,6 @@ module Pact.Core.Evaluate , Eval , EvalBuiltinEnv , allModuleExports - , evalDirectInterpreter , evalInterpreter , EvalInput , EnableGasLogs(..) @@ -64,8 +63,6 @@ import Pact.Core.Info import Pact.Core.Signer import Pact.Core.IR.Eval.CEK.CoreBuiltin import qualified Pact.Core.IR.Eval.CEK.Evaluator as CEK -import qualified Pact.Core.IR.Eval.Direct.Evaluator as Direct -import qualified Pact.Core.IR.Eval.Direct.CoreBuiltin as Direct import qualified Pact.Core.Syntax.Lexer as Lisp import qualified Pact.Core.Syntax.Parser as Lisp import qualified Pact.Core.Syntax.ParseTree as Lisp @@ -118,17 +115,6 @@ evalInterpreter = cekEnv :: CEK.BuiltinEnv ExecRuntime CoreBuiltin Info cekEnv = coreBuiltinEnv @ExecRuntime -evalDirectInterpreter :: Interpreter ExecRuntime CoreBuiltin Info -evalDirectInterpreter = - Interpreter runGuard runTerm resume evalWithCap - where - runTerm purity term = Direct.eval purity env term - runGuard info g = Direct.interpretGuard info env g - resume info defPact = Direct.evalResumePact info env defPact - evalWithCap info purity ct term = - Direct.evalWithinCap info purity env ct term - env = Direct.coreBuiltinEnv - -- | Transaction-payload related environment data. data MsgData = MsgData { mdData :: !PactValue diff --git a/profile-tx/ProfileTx.hs b/profile-tx/ProfileTx.hs index c379a8c12..4aaa522ff 100644 --- a/profile-tx/ProfileTx.hs +++ b/profile-tx/ProfileTx.hs @@ -183,7 +183,7 @@ setupCoinTxs pdb = do putStrLn "Setting up the coin contract and the default funds" source <- T.readFile (contractsPath "coin-v5-create.pact") ee <- setupBenchEvalEnv pdb coinInitSigners coinInitData - () <$ runPactTxFromSource ee source evalDirectInterpreter + () <$ runPactTxFromSource ee source evalInterpreter _run :: IO () @@ -242,7 +242,7 @@ _testCoinTransfer = withSqlitePactDb serialisePact_lineinfo (T.pack benchmarkSql t <- liftEither $ compileOnlyTermLineInfo (RawCode termText) _dsOut <$> runDesugarTerm t term <- getRightIO eterm - (out, _) <- runEvalM (ExecEnv ee) es (eval evalDirectInterpreter PImpure term) + (out, _) <- runEvalM (ExecEnv ee) es (eval evalInterpreter PImpure term) print out unsafeModuleHash :: Text -> Hash From e933597eb05e67f48eef5448805cfa6191336ad3 Mon Sep 17 00:00:00 2001 From: chessai Date: Tue, 5 Nov 2024 12:51:59 -0600 Subject: [PATCH 2/5] update hackage input --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 21601df10..4d53c4739 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1721090796, - "narHash": "sha256-LleV7JlffICihKbSLDRG2Sr+2n4UtLygDPULqUqlGmI=", + "lastModified": 1730766483, + "narHash": "sha256-FXRKDUDRxiBKcKovDPFAyARtiPozLKheqFEGQyGGPRg=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "f7afd47be16385a29e58f40f2f084274ba48125f", + "rev": "bf178f8740c5a4f2c265fd10a6631a864dd50317", "type": "github" }, "original": { From 786eff49c5da44444c38f14bca699c5062eead15 Mon Sep 17 00:00:00 2001 From: jmcardon Date: Tue, 5 Nov 2024 13:54:04 -0500 Subject: [PATCH 3/5] do not pull in LSP for test-utils --- pact-tng.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/pact-tng.cabal b/pact-tng.cabal index a35d2b45a..00922dbe3 100644 --- a/pact-tng.cabal +++ b/pact-tng.cabal @@ -476,7 +476,6 @@ library test-utils , semirings , neat-interpolation , pact-tng:pact-request-api - , pact-tng:pact-lsp , pact-tng:unsafe , lsp-test >= 0.17 , lsp-types From 5d26c24cc944652c5fff8763607db4e8f37d20ce Mon Sep 17 00:00:00 2001 From: chessai Date: Tue, 5 Nov 2024 13:04:11 -0600 Subject: [PATCH 4/5] temporarily disable withHoogle in devShell --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index c14aa3a16..a2e4f58f6 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,7 @@ z3 pkg-config ]; + shell.withHoogle = false; }; }) ]; From f2628e7ea3c74eedbaa42aa54b22d832ecef45fd Mon Sep 17 00:00:00 2001 From: chessai Date: Tue, 5 Nov 2024 13:45:53 -0600 Subject: [PATCH 5/5] remove upper bound on happy --- pact-tng.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pact-tng.cabal b/pact-tng.cabal index 00922dbe3..50201ea28 100644 --- a/pact-tng.cabal +++ b/pact-tng.cabal @@ -192,7 +192,7 @@ library build-tool-depends: , alex:alex - , happy:happy < 2 + , happy:happy other-modules: -- TODO: Uncomment once this is finally fixed