Repository navigation
Enable Wire runtime debugging in ferret debug - #109
Merged
Merged
Conversation
Comment on lines
+55
to
+62
| name: Windows console and redirected input | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version: '>=1.26' | ||
| - run: go test -count=1 -timeout=1m ./internal/prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ferret debugnow compiles local FQL source on the selected runtime and opens a portable debugger session. For example,ferret debug --runtime wire --runtime-endpoint tcp://127.0.0.1:54321 --param limit=10 script.fqlcan step through FQL that calls a host-only function and inspect local variables. Builtin remains the default.The prompt renders a returned stop or completion result before handling an accompanying error. If a start or resume response has no event, the command exits nonzero because the last known stop can no longer be trusted. A clean completion keeps the existing prompt. Both runtimes can list retained breakpoints after completion. The builtin runtime also permits setting and deleting them. Wire alpha.4 rejects
pausefrom an already stopped prompt, after which stepping and continuing remain available.The command closes the session, plan, and runtime in order. Both the debugger and REPL detect unexpected termination of Wire's Connect stream, including when the TCP connection remains open. They release the runtime before waiting for borrowed input to settle. Callers injecting an indefinitely blocking reader into
StartWithIOcan implementReadContext(context.Context, []byte) (int, error)or wake it themselves. Process stdin is interruptible on Linux, macOS, and Windows.The Go prompt and renderer now accept
github.com/MontFerret/api/source.Source, and the owned debugger exposesapi/debugger.Session. The legacy HTTP Worker reportserrors.ErrUnsupportedfor debug compilation.Validation included
go test ./...,make lint, affected packages undergo test -race, and a smoke test of the built CLI against the example Wire host. Integration tests cover inspection and stepping on both runtimes, completion with a cleanup failure, an undeliverable completion response, and physical connection release on interruption or early exit. Unix pseudo-terminal checks exercised normal exit and cancellation. Native Windows CI exercises console mode restoration and redirected stdin reuse.On Apple M2 Max, five runs of
go test ./pkg/runtime -run '^$' -bench '^BenchmarkBuiltinDebugLifecycle$' -benchmem -count=5measured a median of 1.672 ms before the UAPI change and 1.763 ms after, with 18,022 and 18,038 allocations per session. For the follow-up change to Wire disconnect detection,go test ./pkg/runtime -run '^$' -bench '^BenchmarkWireConnection$' -benchmem -count=5measured median connection setup of 342 µs before and 357 µs after, with 1,050 and 1,053 allocations.