Don't generate bindings with a synthetic package#115
Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom Sep 5, 2025
Merged
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.
Member
Author
|
Courtesy of @pchickey this PR is solving this current breakage on nightly: |
pchickey
reviewed
Sep 5, 2025
| /// This type is primarily used in generated code for exported and imported | ||
| /// resources. | ||
| #[repr(transparent)] | ||
| pub struct Resource<T: WasmResource> { |
Collaborator
There was a problem hiding this comment.
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?
pchickey
approved these changes
Sep 5, 2025
alexcrichton
added a commit
to alexcrichton/rust-wasi
that referenced
this pull request
Sep 5, 2025
Release a crate version with the fix from bytecodealliance#115
Merged
alexcrichton
added a commit
that referenced
this pull request
Sep 5, 2025
Release a crate version with the fix from #115
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Sep 6, 2025
…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.
rust-timer
added a commit
to rust-lang/rust
that referenced
this pull request
Sep 6, 2025
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.
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Sep 9, 2025
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses an issue in Rust nightly with the Rust standard library. Notably what's happening is that the
wasicrate is using a synthetic world/package calledrust:wasi/bindingsto generate bindings. This world includeswasi:cli/importsandwasi:http/imports. What's happening is that the Rust standard library is using one version of thewasicrate with one version of WASI bindings, but user crates might use something different. This fails to link becauserust:wasi/bindingsis asserted to be the same no matter what and there's two differentwasicrate versions feeding into this which cause conflicts.The fix in this commit is to skip using
rust:wasias 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/importsinto 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.