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

Rely on core::error::Error #9702

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

alexcrichton
Copy link
Member

With Wasmtime's new MSRV at 1.81 this means that core::error::Error is available which means that in no_std mode the Error trait can be used. This has been integrated into anyhow::Error already upstream and means that we can remove our own local hacks such as the Err2Anyhow trait.

This commit removes the Err2Anyhow trait and all usage, going back to idiomatic Rust error propagation and conversion even in the no_std world. This should make code more portable by default and remove some weird idioms we had for supporting this.

@alexcrichton
Copy link
Member Author

I'll note that this is a draft as this depends on a few upstream PRs:

@github-actions github-actions bot added wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime labels Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Subscribe to Label Action

cc @fitzgen

This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: wasmtime:ref-types

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton marked this pull request as ready for review December 2, 2024 23:20
@alexcrichton alexcrichton requested review from a team as code owners December 2, 2024 23:20
@alexcrichton alexcrichton requested review from abrown and removed request for a team December 2, 2024 23:20
@alexcrichton
Copy link
Member Author

Ok everything's good to go except object. I've also added an update of anyhow and serde to pull in their latest versions which have support for core::error::Error. A small workaround for object::Error has been added temporarily which can be removed once the upstream PR is merged and/or the feature is settled one way or another.

alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Dec 3, 2024
I'm getting segfaults on s390x in bytecodealliance#9702 and I can't reproduce them
locally in QEMU. Try updating QEMU to see if it's a transient bug.
Historical updates haven't always gone well, so let's see what CI says.

prtest:full
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Dec 3, 2024
I'm getting segfaults on s390x in bytecodealliance#9702 and I can't reproduce them
locally in QEMU. Try updating QEMU to see if it's a transient bug.
Historical updates haven't always gone well, so let's see what CI says.

prtest:full
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2024
* Update QEMU used in CI

I'm getting segfaults on s390x in #9702 and I can't reproduce them
locally in QEMU. Try updating QEMU to see if it's a transient bug.
Historical updates haven't always gone well, so let's see what CI says.

prtest:full

* Update risc-v qemu arguments
With Wasmtime's new MSRV at 1.81 this means that `core::error::Error` is
available which means that in `no_std` mode the `Error` trait can be
used. This has been integrated into `anyhow::Error` already upstream and
means that we can remove our own local hacks such as the `Err2Anyhow` trait.

This commit removes the `Err2Anyhow` trait and all usage, going back to
idiomatic Rust error propagation and conversion even in the `no_std`
world. This should make code more portable by default and remove some
weird idioms we had for supporting this.

prtest:full
@alexcrichton
Copy link
Member Author

Ok through much trial and error I've discovered that the s390x-specific failure on CI with this PR is due to the anyhow update. That's specifically the 1.0.76 to 1.0.77 update (which we're jumping from 75 to 93 here). This update uses std::backtrace by default and respects RUST_BACKTRACE=1. For the longest time I couldn't reproduce this locally, and turns out I copied over all env vars in CI except RUST_BACKTRACE=1.

I've disabled backtraces in CI for now. If that works and this lands I'll file an issue and cc Ulrich.

@alexcrichton alexcrichton added this pull request to the merge queue Dec 3, 2024
Merged via the queue into bytecodealliance:main with commit 9034e10 Dec 3, 2024
128 checks passed
@alexcrichton alexcrichton deleted the core-error branch December 3, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants