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

Fix repl load not displaying errors, return loc info to trace #312

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

jmcardon
Copy link
Member

@jmcardon jmcardon commented Jan 29, 2025

Closes #261

After this PR, the following happens on error

➜  pact-core git:(jose/fix-load-error-repl) cabal run pact -- scratch/261_repro.repl -t
scratch/261_repro.repl:1:1: Cannot find module:  foo
 1 | (foo)
   |  ^^^


Load failed

Moreover: Pact trace locations were not being included in -t output. This PR fixes that, by adding the location parameter to replPrintLn, but the implementor is left with the flexibility of how to actually interpret the info. This way, the repl interactive output is left untouched, but the trace output using execScript works as intended.

Before this PR:

➜  pact-core git:(jose/fix-load-error-repl) ✗ cabal run pact -- scratch/tc-fail-repro.repl -t
3
7
"Loading scratch.repl..."
"hello"
24
()
Load successful

After this PR

➜  pact-core git:(jose/fix-load-error-repl) ✗ cabal run pact -- scratch/tc-fail-repro.repl -t
scratch/tc-fail-repro.repl:0:0-0:7: 3
scratch/tc-fail-repro.repl:1:0-1:7: 7
scratch/tc-fail-repro.repl:2:0-2:21: "Loading scratch.repl..."
scratch/scratch.repl:0:0-0:7: "hello"
scratch/scratch.repl:1:0-1:9: 24
scratch/tc-fail-repro.repl:2:0-2:21: ()
Load successful

PR checklist:

  • Test coverage for the proposed changes
  • N/A, we don't actually have tests for the stability of this sort of thing.
  • PR description contains example output from repl interaction or a snippet from unit test output
  • (If Relevant) Documentation has been (manually) updated at https://docs.kadena.io/pact

Additionally, please justify why you should or should not do the following:

  • Benchmark regressions
  • Confirm replay/back compat (Ignore until core release)
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact (Ignore until core release)

@jmcardon jmcardon force-pushed the jose/fix-load-error-repl branch from 04b8688 to 59c4e7e Compare January 29, 2025 19:54
@jmcardon jmcardon changed the title Jose/fix load error repl Fix repl load not displaying errors, return loc info to trace Jan 29, 2025
@jmcardon jmcardon merged commit 4949709 into master Jan 30, 2025
10 checks passed
@jmcardon jmcardon deleted the jose/fix-load-error-repl branch January 30, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running a REPL file from the command line doesn't show errors
2 participants