Wasmtime 3.0.0#41
Merged
Merged
Conversation
In Wasmtime 3, `Trap` is now only an Enum (just like `TrapCode` was). See bytecodealliance/wasmtime#5149 I've adjusted the Ruby bindings to match that change: - Moved the trap code constants on `Trap`, removing the `TrapCode` module. - Renamed `Trap#trap_code` to `Trap#trap`. - Made `Trap#message` exclude the Wasm backtrace by default, and instead added a `wasm_backtrace_message` method for that. I chose this name so we can still implement `wasm_backtrace` that returns an Enumerable of traces, if we ever have the need. This is probably fine for now. In the spirit of matching Wasmtime closely, I wonder if we should instead have a single error type (`Wasmtime::Error`) and define `trap_code` and `wasm_backtrace` on it. We can take that on later and suggest merging this as it's a smaller diff and still gets us on Wasmtime 3.
saulecabrera
approved these changes
Nov 22, 2022
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.
In Wasmtime 3,
Trapis now only an Enum (just likeTrapCodewas).See bytecodealliance/wasmtime#5149
I've adjusted the Ruby bindings to match that change:
Trap, removing theTrapCodemodule.
Trap#trap_codetoTrap#trap.Trap#messageexclude the Wasm backtrace by default, andinstead added a
wasm_backtrace_messagemethod for that.I chose this name so we can still implement
wasm_backtracethatreturns an Enumerable of traces, if we ever have the need.
This is probably fine for now. In the spirit of matching Wasmtime
closely, I wonder if we should instead have a single error type
(
Wasmtime::Error) and definetrap_codeandwasm_backtraceon it.We can take that on later. I suggest merging this as it's a smaller
diff and still gets us on Wasmtime 3.