Skip to content

Wasmtime 3.0.0#41

Merged
jbourassa merged 2 commits into
mainfrom
wasmtime-3.0.0
Nov 23, 2022
Merged

Wasmtime 3.0.0#41
jbourassa merged 2 commits into
mainfrom
wasmtime-3.0.0

Conversation

@jbourassa
Copy link
Copy Markdown
Collaborator

@jbourassa jbourassa commented Nov 22, 2022

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. I suggest merging this as it's a smaller
diff and still gets us on Wasmtime 3.

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.
@jbourassa jbourassa marked this pull request as ready for review November 22, 2022 18:32
@jbourassa jbourassa merged commit 2af68e5 into main Nov 23, 2022
@jbourassa jbourassa deleted the wasmtime-3.0.0 branch November 23, 2022 13: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.

2 participants