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

Wasmtime 3.0.0 #41

Merged
merged 2 commits into from
Nov 23, 2022
Merged

Wasmtime 3.0.0 #41

merged 2 commits into from
Nov 23, 2022

Conversation

jbourassa
Copy link
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