fix(bindgen): futures and stream are not `Clone` (#12155)Signed-off-by: Roman Volosatovs <[email protected]>
Update to wasm-tools 0.237.0 (#11517)* Update to wasm-tools 0.237.0That version comes with support for fallible resource constructors. `wasmtime-wit-bindgen` doesn't need any additional changes t
Update to wasm-tools 0.237.0 (#11517)* Update to wasm-tools 0.237.0That version comes with support for fallible resource constructors. `wasmtime-wit-bindgen` doesn't need any additional changes to support this, though I've added a codegen test for it to be sure.* Add vets---------Co-authored-by: Alex Crichton <[email protected]>
show more ...
Update wasm-tools crates to 226 (#10235)* Update wasm-tools crates to 226This commit updates the wasm-tools crates to the 226 track of versions.The most notable change here is the removal and re
Update wasm-tools crates to 226 (#10235)* Update wasm-tools crates to 226This commit updates the wasm-tools crates to the 226 track of versions.The most notable change here is the removal and refactoring withinwasm-tools of support for multiple and named returns in the componentmodel along with the support for 33+ flags in the `flags` type. This hasbeen gated for some time now and it's just now being removed now thatit's been awhile an no issues have been raised.prtest:full* Fix some issues from CI* Fix benchmarks* Switch to crates.io-based crates
Configure WIT feature gates at runtime & implement wasi-cli `exit-with-code` (#9381)* Remove `features` configuration from component::bindgen! and always emit all unstable members. These features w
Configure WIT feature gates at runtime & implement wasi-cli `exit-with-code` (#9381)* Remove `features` configuration from component::bindgen! and always emit all unstable members. These features will be gated at runtime.* Implement wasi-cli's unstable `exit-with-code`* Add codegen test for unstable features* Add LinkOptions type and add a parameter to all add_to_linker functions in for worlds/interfaces that use any unstable feature.* More descriptive test feature names.* Generate feature gate `if` checks* Expose `cli-exit-with-code` as CLI option* Generate bespoke option types per interface and world.* Add unit test* Remove exit code restriction on Windows* Add cli_exit_with_code test* Use BTreeSet to generate the options in consistent order* Change wasmtime-wasi's `add_to_linker_(a)sync` signature back to how it was and add new variants that take the option parameters.* Lift Windows exit code restriction in tests* Lift Windows exit code restriction
Update wasm-tools crates (#9336)* Update wasm-tools crates* WIT `float32` and `float64` are now hard errors (renamed to `f32` and `f64`)* Stack switching has been implemented in wasm-tools, bu
Update wasm-tools crates (#9336)* Update wasm-tools crates* WIT `float32` and `float64` are now hard errors (renamed to `f32` and `f64`)* Stack switching has been implemented in wasm-tools, but not Wasmtime.* New shared-everything-threads component model intrinsics are not implemented"Holes" for these new features in wasmparser are now present in Wasmtimeand panics shouldn't be hit because the new proposals aren't enabled inthe validator at this time.* Fix fuzzer build* Fix fuzzer tests
Correctly Reference `Imports` Trait of World Named `host` (#9316)* Add Tests for WIT with World Named `host`* Use `to_rust_upper_camel_case` When Trying to Reference the `Host_Imports` traitClo
Correctly Reference `Imports` Trait of World Named `host` (#9316)* Add Tests for WIT with World Named `host`* Use `to_rust_upper_camel_case` When Trying to Reference the `Host_Imports` traitCloses bindgen macro: "Use of Undeclared Type `HostImports`" when WIT world name is `host` #9315
feat: component bindgen: add support for multiple wit paths (#9288)* feat: bindgen: add support for multiple wit paths* expanded tests* fmt---------Co-authored-by: Lochlan Wansbrough <>
fix: bindgen trappable_errors using unversion/versioned packages (#8305)Signed-off-by: Brian H <[email protected]>
Fix generating bindings for dead code (#8065)This commit fixes a bindgen problem where dead types, which had nogenerated bindings, could be referred to from other dead types, whichdid have genera
Fix generating bindings for dead code (#8065)This commit fixes a bindgen problem where dead types, which had nogenerated bindings, could be referred to from other dead types, whichdid have generated bindings. The fix is to not generate code for deadtypes at all by fixing how type information is analyzed.
Rename generated structures to `Guest` in bindgen (#7794)This mirrors how traits for the host are all called `Host` and it avoidsname clashes with types that share the name of the interface they a
Rename generated structures to `Guest` in bindgen (#7794)This mirrors how traits for the host are all called `Host` and it avoidsname clashes with types that share the name of the interface they are in.I've also added some simple debugging of macro-generated code to getbetter error messages.Closes #7775
Include Version in the export name if required (#7656)Signed-off-by: James Sturtevant <[email protected]>
Ensure exports are properly namespaced (#7196)Continuation of #7172 where imports and export _definitions_ areproperly namespaced by version by the usage of exports was not.
Support multiple versions in `bindgen!` (#7172)This commit fixes a bug in the `bindgen!` macro where when faced withmultiple packages that differ only in version number invalid bindingswere gener
Support multiple versions in `bindgen!` (#7172)This commit fixes a bug in the `bindgen!` macro where when faced withmultiple packages that differ only in version number invalid bindingswere generated. The fix here is to add version number information topackage module names if necessary in situations such as this. Thisrequired some refactoring internally to have a single source of truthfor what the name of a module should be and avoid having it implicitlycalculated in two locations.
Add a whole lot of semicolons to WIT files (#7159)To prepare this commit I've run `WIT_REQUIRE_SEMICOLONS=1 ./ci/run-tests.sh`locally which configures `wit-parser` to generate an error for missing
Add a whole lot of semicolons to WIT files (#7159)To prepare this commit I've run `WIT_REQUIRE_SEMICOLONS=1 ./ci/run-tests.sh`locally which configures `wit-parser` to generate an error for missingsemicolons in WIT files. This led me to add quite a few semicolons inquite a few places in what is going to be the first of a few batches ofsemicolons.CI checks for this cannot be added just yet because the wasi-nn spec isa submodule which needs to be updated with semicolons before thisrepository can require semicolons. Nevertheless that doesn't stop usfrom using semicolons in the meantime (yay gradual rollout of changes!)so I figure this would be good to get in sooner rather than later.
Implement support for exported resources in `bindgen!` (#7050)* Implement support for exported resources in `bindgen!`This commit updates the `wasmtime::component::bindgen!` to supportexported r
Implement support for exported resources in `bindgen!` (#7050)* Implement support for exported resources in `bindgen!`This commit updates the `wasmtime::component::bindgen!` to supportexported resources. Exported resources are themselves always modeled as`ResourceAny` at runtime and are required to perform dynamic type checksto ensure that the right type of resource is passed in. Exportedresources have their own `GuestXXX` structure exported to namespace allof their methods. Otherwise, like imports, there's not a whole lot ofspecial treatment of exported resources.* Work around `heck` issueLooks like `to_snake_case` behaves differently if the `unicode` featureis enabled or not so bypass that entirely.
Host resources wit-bindgen code generation (#6886)* added trap to resource dtor* basic resources* fixed signature and trait bounds* fixed static function* fixed trait signature* basic res
Host resources wit-bindgen code generation (#6886)* added trap to resource dtor* basic resources* fixed signature and trait bounds* fixed static function* fixed trait signature* basic resources* added result to resource drop* reverted formatting* added doc comment to resource `dtor`* fixed merge issue* fixed another merge issue* added resource import codegen test* Revert changes to `Cargo.lock`* Update `Cargo.lock` with the wit-bindgen update* Add `cargo vet` entries for new crates* Restore old-style of printing types in bindgenAvoid collecting resources-as-we-go in favor of doing that moredeclaratively elsewhere. Additionally handle imported-vs-exportedresource via the order that interfaces are visited.* Update the shape of resource traits:* Use `&mut self` instead of `StoreContextMut`* Make resource traits as supertraits of the `Host` trait generated for each resource.* More uniformly handle types/returns with resource methods.* Fix derivations of `Clone` and `Copy` for where handles are contained.* Fix generation of handle typedefs* Support resources-in-worlds* Remove now-duplicate functionThis is now the same as the preexisting `generate_function_trait_sig`* Fix classifying handles as imported or exportedThis determination happens by looking up the origin definition of aresource, not the leaf possibly-aliased type.* Fix chains-of-use of resourcesResources don't have their representation asserted since the bare typeitself doesn't implement `ComponentType`, but otherwise generate typealiases the same way as other type aliases.* Revert `Cargo.lock` changesNo need to update `wit-bindgen` to 0.10.0 just yet, that'll happen in afuture update if necessary.* Add basic runtime tests for resources* fixed merge issue---------Co-authored-by: Alex Crichton <[email protected]>
Remove component union types (#6913)- Bump wasm-tools deps- Use new TypeSectionReader::into_iter_err_on_gc_types method
Update Wasmtime for upcoming WIT changes (#6390)* Update Wasmtime for upcoming WIT changesThis PR integrates bytecodealliance/wasm-tools#1027 into Wasmtime. Themain changes here are:* WIT synt
Update Wasmtime for upcoming WIT changes (#6390)* Update Wasmtime for upcoming WIT changesThis PR integrates bytecodealliance/wasm-tools#1027 into Wasmtime. Themain changes here are:* WIT syntax is updated with WebAssembly/component-model#193* Generated bindings in the `bindgen!` macro have been updated to reflect the new structure of WIT.* The accepted component model binary format has been updated to account for changes.This PR disables wasi-http tests and the on-by-default feature becausethe WIT syntax has been updated but the submodule containing the WITshas not been updated yet so there's no way to get that buildingtemporarily. Once that's updated then this can be reenabled.* Update wasmtime-wasi crate with new WIT* Add wit-bindgen override for the updated version* Officially disable wasi-http tests/building* Move test-reactor WIT into the main WIT filesDon't store duplicates with the rest of the WASI WIT files we have.* Remove adapter's copy of WIT files* Disable default features for wit-bindgen* Plumb disabling wasi-http tests a bit more* Fix reactor tests and adapter build* Remove no-longer-needed feature* Update adapter verification script* Back out some wasi-http hacks* Update vet and some dependency sources* Move where wit-bindgen comes fromMake it a more "official" location which is also less likely to beaccidentally deleted in the future.* Don't document wasi-http-tests
components: Fix bindgen! with renamed interfaces (#5968)This follows the same strategy pioneered by the `wit-bindgen` guest Rustbindgen which keeps track of the latest name of an interface for how
components: Fix bindgen! with renamed interfaces (#5968)This follows the same strategy pioneered by the `wit-bindgen` guest Rustbindgen which keeps track of the latest name of an interface for how torefer to an interface.Closes #5961
Change the name of wit-bindgen's host implementation traits. (#5890)* Change the name of wit-bindgen's host implementation traits.Instead of naming the host implementation trait something like`w
Change the name of wit-bindgen's host implementation traits. (#5890)* Change the name of wit-bindgen's host implementation traits.Instead of naming the host implementation trait something like`wasi_filesystem::WasiFilesystem`, name it `wasi_filesystem::Host`, andavoid using the identifier `Host` in other places.This fixes a collision when generating bindings for the currentwasi-clock API, which contains an interface `wall-clock` which containsa type `wall-clock`, which created a naming collision on the name`WallClock`.* Update tests to use the new trait name.* Fix one more.* Add the new test interface to the simple-wasi world.
Fix a missing `async_trait` annotation in `bindgen!` (#5747)Closes #5743
Update to the latest `wit-parser` (#5694)This notably pulls in support in WIT for types-in-worlds.
Fix some wit-bindgen-related issues with generated bindings (#5692)* Prefix component-bindgen-generated-functions with `call_` This fixes clashes between Rust-native methods and the methods the
Fix some wit-bindgen-related issues with generated bindings (#5692)* Prefix component-bindgen-generated-functions with `call_` This fixes clashes between Rust-native methods and the methods themselves. For example right now `new` is a Rust-generated function for constructing the wrapper but this can conflict with a world-exported function called `new`. Closes #5585 * Fix types being both shared and owned This refactors some inherited cruft from the original `wit-bindgen` repository to be more Wasmtime-specific and fixes a codegen case where a type was used in both a shared and an owned context. Closes #5688
Fix calculation of param/result types in wit-bindgen (#5622)This commit fixes a bug in the `bindgen!` macro for components where previously the `param` and `result` properties weren't properly ca
Fix calculation of param/result types in wit-bindgen (#5622)This commit fixes a bug in the `bindgen!` macro for components where previously the `param` and `result` properties weren't properly calculated depending on the structure of the type and which types were visited in which order. This is simplified to use a `LiveTypes` structure from the `wit-parser` crate and relies on that to do necessary recursion.
Update WIT tooling used by Wasmtime (#5565)* Update WIT tooling used by Wasmtime This commit updates the WIT tooling, namely the wasm-tools family of crates, with recent updates. Notably: *
Update WIT tooling used by Wasmtime (#5565)* Update WIT tooling used by Wasmtime This commit updates the WIT tooling, namely the wasm-tools family of crates, with recent updates. Notably: * bytecodealliance/wasm-tools#867 * bytecodealliance/wasm-tools#871 This updates index spaces in components and additionally bumps the minimum required version of the component binary format to be consumed by Wasmtime (because of the index space changes). Additionally WIT tooling now fully supports `use`. Note that WIT tooling doesn't, at this time, fully support packages and depending on remotely defined WIT packages. Currently WIT still needs to be vendored in the project. It's hoped that future work with `cargo component` and possible integration here could make the story about depending on remotely-defined WIT more ergonomic and streamlined. * Fix `bindgen!` codegen tests * Add a test for `use` paths an implement support * Update to crates.io versions of wasm-tools * Uncomment codegen tests
12