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

Support multiple documents with a single default world. #494

Conversation

sunfishcode
Copy link
Member

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.

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 alexcrichton merged commit 1846165 into bytecodealliance:main 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.
@sunfishcode sunfishcode deleted the sunfishcode/unique-default-world branch February 13, 2023 16:07
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/witx-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
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