-
Notifications
You must be signed in to change notification settings - Fork 56
Don't generate bindings with a synthetic package #115
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
Don't generate bindings with a synthetic package #115
Conversation
This commit addresses an issue in Rust nightly with the Rust standard library. Notably what's happening is that the `wasi` crate is using a synthetic world/package called `rust:wasi/bindings` to generate bindings. This world includes `wasi:cli/imports` and `wasi:http/imports`. What's happening is that the Rust standard library is using one version of the `wasi` crate with one version of WASI bindings, but user crates might use something different. This fails to link because `rust:wasi/bindings` is asserted to be the same no matter what and there's two different `wasi` crate versions feeding into this which cause conflicts. The fix in this commit is to skip using `rust:wasi` as a package and generate bindings directly from WASI packages themselves. These bindings correctly have versions in them and are versioned appropriately so there's no clash and merging proceeds as expected. This required moving the bindings for `wasi:http/imports` into the generation of bindings for `wasi:http/proxy`, but that doesn't actually change the structure of the crate just how the generated bindings work out.
Courtesy of @pchickey this PR is solving this current breakage on nightly:
|
/// This type is primarily used in generated code for exported and imported | ||
/// resources. | ||
#[repr(transparent)] | ||
pub struct Resource<T: WasmResource> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned we now have two different Resource structs defined - the wasi:http/types and outgoing-handler interfaces used to use the one now in imports, but now uses this one. They have identical text, but will we run into problems where the types arent actually equal?
Release a crate version with the fix from bytecodealliance#115
Release a crate version with the fix from #115
…tgross35 std: Update `wasi` crate dependency The recent work on the WASIp2 target being integrated into the standard library (rust-lang#146207, rust-lang#145944) ended up causing a bug in nightly on the target. This [has now been fixed](bytecodealliance/wasi-rs#115) in the `wasi` crate so this commit pulls in the updated version to ensure bindings work correctly.
Rollup merge of #146257 - alexcrichton:update-wasi-crate, r=tgross35 std: Update `wasi` crate dependency The recent work on the WASIp2 target being integrated into the standard library (#146207, #145944) ended up causing a bug in nightly on the target. This [has now been fixed](bytecodealliance/wasi-rs#115) in the `wasi` crate so this commit pulls in the updated version to ensure bindings work correctly.
…tgross35 std: Update `wasi` crate dependency The recent work on the WASIp2 target being integrated into the standard library (rust-lang#146207, rust-lang#145944) ended up causing a bug in nightly on the target. This [has now been fixed](bytecodealliance/wasi-rs#115) in the `wasi` crate so this commit pulls in the updated version to ensure bindings work correctly.
This commit addresses an issue in Rust nightly with the Rust standard library. Notably what's happening is that the
wasi
crate is using a synthetic world/package calledrust:wasi/bindings
to generate bindings. This world includeswasi:cli/imports
andwasi:http/imports
. What's happening is that the Rust standard library is using one version of thewasi
crate with one version of WASI bindings, but user crates might use something different. This fails to link becauserust:wasi/bindings
is asserted to be the same no matter what and there's two differentwasi
crate versions feeding into this which cause conflicts.The fix in this commit is to skip using
rust:wasi
as a package and generate bindings directly from WASI packages themselves. These bindings correctly have versions in them and are versioned appropriately so there's no clash and merging proceeds as expected.This required moving the bindings for
wasi:http/imports
into the generation of bindings forwasi:http/proxy
, but that doesn't actually change the structure of the crate just how the generated bindings work out.