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

[22.0.0] Change WASI trait impls back to being blanket impls #8767

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

alexcrichton
Copy link
Member

This is a backport of #8766 to the 22.0.0 release branch.

…#8766)

This commit is a partial revert of bytecodealliance#8609 to return `wasmtime-wasi` and
`wasmtime-wasi-http` back to using blanket impls. The main change from
before is to change the blanket impls to be in terms of a local newtype
wrapper to avoid trait coherence issues. This is done because otherwise
using the traits before required `&mut dyn WasiView` to exist but
sometimes only a `Foo<'a>` is held which is not easy to get a `&mut dyn
...` view of. By changing to a blanket impl in terms of a newtype
wrapper, `WasiImpl`, it's possible to call `bindgen!`-generated
`add_to_linker_get_host` functions with a return value of
`WasiImpl<Foo<'a>>` which enables hooking into all the generated
bindings.
@alexcrichton alexcrichton requested review from a team as code owners June 10, 2024 22:32
@alexcrichton alexcrichton requested review from pchickey and removed request for a team June 10, 2024 22:32
@alexcrichton alexcrichton enabled auto-merge (squash) June 10, 2024 22:37
@alexcrichton alexcrichton merged commit 69a78fc into bytecodealliance:release-22.0.0 Jun 10, 2024
118 checks passed
@alexcrichton alexcrichton deleted the backport branch June 10, 2024 22:45
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