Support multiple documents with a single default world.#494
Merged
alexcrichton merged 1 commit intoFeb 11, 2023
Merged
Conversation
Previously, wit-bindgen only supported using a default world when there was exactly one document. With this change, wit-bindgen will look through all the documents and if only one of them has a default world, it'll use that world. This is a common pattern in WASI proposal repos.
alexcrichton
approved these changes
Feb 11, 2023
alexcrichton
added a commit
to alexcrichton/wasm-tools
that referenced
this pull request
Feb 13, 2023
This pulls in bytecodealliance/wit-bindgen#494 as an "official" function to the `wit-parser` crate. I've written an analogue for that function in many locations so the hope is that all bindings generators can standardize on the necessary idioms by using this function. For example the Wasmtime bindings generator will want to update to use this as well.
alexcrichton
added a commit
to bytecodealliance/wasm-tools
that referenced
this pull request
Feb 13, 2023
This pulls in bytecodealliance/wit-bindgen#494 as an "official" function to the `wit-parser` crate. I've written an analogue for that function in many locations so the hope is that all bindings generators can standardize on the necessary idioms by using this function. For example the Wasmtime bindings generator will want to update to use this as well.
alexcrichton
added a commit
to alexcrichton/wasmtime
that referenced
this pull request
Feb 14, 2023
Inspired by bytecodealliance/wit-bindgen#494 specifying a world or document to bindgen is now optional as it's inferred if there's only one `default world` in a package's documents.
alexcrichton
added a commit
to alexcrichton/wit-bindgen
that referenced
this pull request
Feb 14, 2023
This updates to use `Resolve::select_world` which was added to `wit-parser` from bytecodealliance#494.
alexcrichton
added a commit
that referenced
this pull request
Feb 14, 2023
This updates to use `Resolve::select_world` which was added to `wit-parser` from #494.
alexcrichton
added a commit
to bytecodealliance/wasmtime
that referenced
this pull request
Feb 14, 2023
* Update world-selection in `bindgen!` macro Inspired by bytecodealliance/wit-bindgen#494 specifying a world or document to bindgen is now optional as it's inferred if there's only one `default world` in a package's documents. * Add cargo-vet entry
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.
Previously, wit-bindgen only supported using a default world when there was exactly one document.
With this change, wit-bindgen will look through all the documents and if only one of them has a default world, it'll use that world. This is a common pattern in WASI proposal repos.