Migrate the Wasmtime CLI to `wasmtime::error` (#12295)* Migrate wasmtime-cli to `wasmtime::error`* migrate benches to `wasmtime::error` as well* Remove new usage of anyhow that snuck in
Use `.` instead of `/` for interface members. (#11947)* Use `.` instead of `/` for interface members.In the `wasmtime::component::generate` macro, change the syntax forreferencing functions and
Use `.` instead of `/` for interface members. (#11947)* Use `.` instead of `/` for interface members.In the `wasmtime::component::generate` macro, change the syntax forreferencing functions and types inside interfaces to use `.` insteadof `/`.For example, this changes strings like `wasi:http/types/outgoing-body`to `wasi:http/types.outgoing-body`.This makes the syntax more consistent with the syntax of[WIT `use` statements], which use `.` for this purpose.And, it avoids an incompatibility with the future nested namespaces syntax([]), where the `/d` in `a:b/c/d` is for traversing a component exportrather than an interface member.[WIT `use` statements]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-packages-and-use[]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#gated-features* Use the new syntax in more places.* Revert changes to vendored WIT files.* Revert more changes to vendored files.* Update syntax in more places.
show more ...
Redesign function configuration in `bindgen!` (#11328)* Redesign function configuration in `bindgen!`This commit is a redesign of how function-level configuration works inWasmtime's `bindgen!` m
Redesign function configuration in `bindgen!` (#11328)* Redesign function configuration in `bindgen!`This commit is a redesign of how function-level configuration works inWasmtime's `bindgen!` macro. The main goal of this redesign is tobetter support WASIp3 and component model async functions. Prior to thisredesign there was a mish mash of mechanisms to configure behavior ofimports/exports:* The `async` configuration could turn everything async, nothing async, only some imports async, or everything except some imports async.* The `concurrent_{imports,exports}` keys were required to explicitly opt-in to component model async signatures and applied to all imports/exports.* The `trappable_imports` configuration would indicate a list of imports allowed to trap and it had special configuration for everything, nothing, and only a certain list.* The `tracing` and `verbose_tracing` keys could be applied to either nothing or all functions.Overall the previous state of configuration in `bindgen!` was clearly ahodgepodge of systems that organically grew over time. In my personalopinion it was in dire need of a refresh to take into account howcomponent-model-async ended up being implemented as well asconsolidating the one-off systems amongst all of these configurationkeys. A major motivation of this redesign, for example, was to inheritbehavior from WIT files by default. An `async` function in WIT shouldnot require `concurrent_*` keys to be configured, but rather it shouldgenerate correct bindings by default.In this commit, all of the above keys were removed. All keys have beenreplaced with `imports` and `exports` configuration keys. Each behavesthe same way and looks like so: bindgen!({ // ... imports: { // enable tracing for just this function "my:local/interface/func": tracing, // enable verbose tracing for just this function "my:local/interface/other-func": tracing | verbose_tracing, // this is blocking in WIT, but generate async bindings for // it "my:local/interface/[method]io.block": async, // like above, but use "concurrent" bindings which have // access to the store. "my:local/interface/[method]io.block-again": async | store, // everything else is, by default, trappable default: trappable, }, });Effectively all the function-level configuration items are now bitflags.These bitflags are by default inherited from the WIT files itself (e.g.`async` functions are `async | store` by default). Further configurationis then layered on top at the desires of the embedder. Supported keys are:* `async` - this means that a Rust-level `async` function should be generated. This is either `CallStyle::Async` or `CallStyle::Concurrent` as it was prior, depending on ...* `store` - this means that the generated function will have access to the store on the host. This is only implemented right now for `async | store` functions which map to `CallStyle::Concurrent`. In the future I'd like to support just-`store` functions which means that you could define a synchronous function with access to the store in addition to an asynchronous function.* `trappable` - this means that the function returns a `wasmtime::Result<TheWitBindingType>`. If `trappable_errors` is applicable then it means just a `Result<TheWitOkType, TrappableErrorType>` is returned (like before)* `tracing` - this enables `tracing!` integration for this function.* `verbose_tracing` - this logs all argument values for this function (including lists).* `ignore_wit` - this ignores the WIT-level defaults of the function (e.g. ignoring WIT `async`).The way this then works is all modeled is that for any WIT functionbeing generated there are a set of flags associated with that function.To calculate the flags the algorithm looks like:1. Find the first matching rule in the `imports` or `exports` map depending on if the function is imported or exported. If there is no matching rule then use the `default` rule if present. This is the initial set of flags for the function (or empty if nothing was found).2. If `ignore_wit` is present, return the flags from step 1. Otherwise add in `async | store` if the function is `async` in WIT.The resulting set of flags are then used to control how everything isgenerated. For example the same split traits of today are stillgenerated and it's controlled based on the flags. Note though that theprevious `HostConcurrent` trait was renamed to `HostWithStore` to makespace for synchronous functions in this trait in the future too.The end result of all these changes is that configuring imports/exportsnow uses the exact same selection system as the `with` replacement map,meaning there's only one system of selecting functions instead of 3.WIT-level `async` is now respected by default meaning that bindings workby default without further need to configure anything (unless morefunctionality is desired).One final minor change made here as well is that auto-generated`instantiate` methods are now always synchronous and an`instantiate_async` method is unconditionally generated for async mode.This means that bindings always generate both functions and it's up tothe embedder to choose the appropriate one.Closes #11246Closes #11247* Update expanded test expectationsprtest:full* Fix the min platform embedding example* Fix doc tests* Always generate `*WithStore` traitsThis helps when using the `with` mapping since that can always assumethat `HostWithStore` is available in the generated bindings, avoidingthe need to duplicate configuration options.* Update test expectations* Review comments
Deps: Update `wasm-tools` crates to 0.233.0 (#10915)* Update `wasm-tools` deps to 0.233.0* Update `cargo vet` metadataJust a prune and wildcard renewals* cargo fmt* Fix type export identifi
Deps: Update `wasm-tools` crates to 0.233.0 (#10915)* Update `wasm-tools` deps to 0.233.0* Update `cargo vet` metadataJust a prune and wildcard renewals* cargo fmt* Fix type export identifiers* Fix more type identifiers in exports in WAT
Enable the `useless_conversion` Clippy lint (#10838)* Enable the `useless_conversion` Clippy lintWe've got lots of types in Wasmtime and convert between them quite alot, but often over time conv
Enable the `useless_conversion` Clippy lint (#10838)* Enable the `useless_conversion` Clippy lintWe've got lots of types in Wasmtime and convert between them quite alot, but often over time conversions become unnecessary throughrefactorings or similar. This will hopefully enable us to clean up someconversions as they come up to try to have as few as possible ideally.* Review comments
Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it's possible to make thisswitch. This commit moves Wasmtim
Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it's possible to make thisswitch. This commit moves Wasmtime to the 2024 Edition to keepup-to-date with Rust idioms and access many of the edition featuresexclusive to the 2024 edition.prtest:full* Reformat with the 2024 edition
Replace `GetHost` with a function pointer, add `HasData` (#10770)* Replace `GetHost` with a function pointer, add `HasData`This commit is a refactoring to the fundamentals of the `bindgen!` macro
Replace `GetHost` with a function pointer, add `HasData` (#10770)* Replace `GetHost` with a function pointer, add `HasData`This commit is a refactoring to the fundamentals of the `bindgen!` macroand the functions that it generates. Prior to this change thefundamental entrypoint generated by `bindgen!` was a function`add_to_linker_get_host` which takes a value of type `G: GetHost`. This`GetHost` implementation is effectively an alias for a closure whosereturn value is able to close over the parameter given lfietime-wise.The `GetHost` abstraction was added to Wasmtime originally to enableusing any type that implements `Host` traits, not just `&mut U` as wasoriginally supported. The definition of `GetHost` was _just_ right toenable a type such as `MyThing<&mut T>` to implement `Host` and aclosure could be provided that could return it. At the time that`GetHost` was added it was known to be problematic from anunderstandability point of view, namely:* It has a non-obvious definition.* It's pretty advanced Rust voodoo to understand what it's actually doing* Using `GetHost` required lots of `for<'a> ...` in places which is unfamiliar syntax for many.* `GetHost` values couldn't be type-erased (e.g. put in a trait object) as we couldn't figure out the lifetime syntax to do so.Despite these issues it was the only known solution at hand so we landedit and kept the previous `add_to_linker` style (`&mut T -> &mut U`) as aconvenience. While this has worked reasonable well (most folks just tryto not look at `GetHost`) it has reached a breaking point in the WASIp3work.In the WASIp3 work it's effectively now going to be required that the`G: GetHost` value is packaged up and actually stored inside ofaccessors provided to host functions. This means that `GetHost` valuesnow need to not only be taken in `add_to_linker` but additionallyprovided to the rest of the system through an "accessor". This was madepossible in #10746 by moving the `GetHost` type into Wasmtime itself (asopposed to generated code where it lived prior).While this worked with WASIp3 and it was possible to plumb `G: GetHost`safely around, this ended up surfacing more issues. Namely all"concurrent" host functions started getting significantly morecomplicated `where` clauses and type signatures. At the end of the day Ifelt that we had reached the end of the road to `GetHost` and wanted tosearch for alternatives, hence this change.The fundamental purpose of `GetHost` was to be able to express, in ageneric fashion:* Give me a closure that takes `&mut T` and returns `D`.* The `D` type can close over the lifetime in `&mut T`.* The `D` type must implement `bindgen!`-generated traits.A realization I had was that we could model this with a genericassociated type in Rust. Rust support for generic associated types isrelatively new and not something I've used much before, but it ended upbeing a perfect model for this. The definition of the new `HasData`trait is deceptively simple: trait HasData { type Data<'a>; }What this enables us to do though is to generate `add_to_linker`functions that look like this: fn add_to_linker<T, D>( linker: &mut Linker<T>, getter: fn(&mut T) -> D::Data<'_>, ) -> Result<()> where D: HasData, for<'a> D::Data<'a>: Host;This definition here models `G: GetHost` as a literal function pointer,and the ability to close over the `&mut T` lifetime with type (not just`&mut U`) is expressed through the type constructor `type Data<'a>`).Ideally we could take a generic generic associated type (I'm not evensure what to call that), but that's not something Rust has today.Overall this felt like a much simpler way of modeling `GetHost` and itsrequirements. This plumbed well throughout the WASIp3 work and thesignatures for concurrent functions felt much more appropriate in termsof complexity after this change. Taking this change to the limit meansthat `GetHost` in its entirety could be purged since all usages of itcould be replaced with `fn(&mut T) -> D::Data<'a>`, a hopefully muchmore understandable type.This change is not all rainbows however, there are some gotchas thatremain:* One is that all `add_to_linker` generated functions have a `D: HasData` type parameter. This type parameter cannot be inferred and must always be explicitly specified, and it's not easy to know what to supply here without reading documentation. Actually supplying the type parameter is quite easy once you know what to do (and what to fill in), but it may involve defining a small struct with a custom `HasData` implementation which can be non-obvious.* Another is that the `G: GetHost` value was previously a full Rust closure, but now it's transitioning to a function pointer. This is done in preparation for WASIp3 work where the function needs to be passed around, and doing that behind a generic parameter is more effort than it's worth. This means that embedders relying on the true closure-like nature here will have to update to using a function pointer instead.* The function pointer is stored in locations that require `'static`, and while `fn(T)` might be expected to be `'static` regardless of `T` is is, in fact, not. This means that practically `add_to_linker` requires `T: 'static`. Relative to just before this change this is a possible regression in functionality, but there orthogonal reasons beyond just this that we want to start requiring `T: 'static` anyway. That means that this isn't actually a regression relative to #10760, a related change.The first point is partially ameliorated with WASIp3 work insofar thatthe `D` type parameter will start serving as a location to specify whereconcurrent implementations are found. These concurrent methods don'ttake `&mut self` but instead are implemented for `T: HasData` types. Inthat sense it's more justified to have this weird type parameter, but inthe meantime without this support it'll feel a bit odd to have thislittle type parameter hanging off the side.This change has been integrated into the WASIp3 prototyping repositorywith success. This has additionally been integrated into the Spinembedding which has one of the more complicated reliances on`*_get_host` functions known. Given that it's expected that while thisis not necessarily a trivial change to rebase over it should at least bepossible.Finally the `HasData` trait here has been included with what I'm hopingis a sufficient amount of documentation to at least give folks a springboard to understand it. If folks have confusion about this `D` typeparameter my hope is they'll make their way to `HasData` which showcasesvarious patterns for "librarifying" host implementations of WITinterfaces. These patterns are all used throughout Wasmtime and WASIcurrently in crates and tests and such.* Update expanded test expectations
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
style: simplify string formatting (#9047)* style: simplify string formatting* fix: formatting in `benches/call.rs`
Redesign how component exports work (#8786)* Un-nest exports in a componentThis commit flattens the representation of exports in a component tomake them more easily indexable without forcing tra
Redesign how component exports work (#8786)* Un-nest exports in a componentThis commit flattens the representation of exports in a component tomake them more easily indexable without forcing traversal through thehierarchy of instance imports/exports to get there.* Guarantee type information on component exportsDon't have it optional in some cases and present in others, insteadensure there's type information for all component exports immediatelyavailable.* Refactor how component instance exports are loadedThis commit is a change to Wasmtime's public API for`wasmtime::component::Instance` that reorganizes how component exportsare loaded. Previously there was a system where `Instance::exports()`was called that that was sort of "iterated over" in a builder-stylepattern to acquire the actual export desired. This required lifetimetrickery for nested instances and some unfortunate API bloat. The majordownside of this approach is that it requires unconditional stringlookups at runtime for exports and additionally does not serve as agreat place to implement the semver-compatible logic of #8395. The goalof this refactoring is to pave the way to improving this.The new APIs for loading exports now look a bit more similar to what'savailable for core modules. Notably there's a new`Component::export_index` method which enables performing a stringlookup and returning an index. This index can in turn be passed to`Instance::get_*` to skip the string lookup when exports are loaded. The`Instance::exports` API is then entirely removed and dismantled.The only piece remaining is the ability to load nested exports which isdone through an `Option` parameter to `Component::export_index`. Theway to load a nested instance is now to first lookup the instance with`None` as this parameter an then the instance itself is `Some` to lookup an export of that instance. This removes the need for arecursive-style lifetime-juggling API from wasmtime and in theory helpssimplify the usage of loading exports.* Update `bindgen!` generated structures for exportsThis commit updates the output of `bindgen!` to have a different setupfor exports of worlds to handle the changes from the previous commit.This introduces new `*Pre` structures which are generated alongside theexisting `Guest` structures for example. The `*Pre` versions contain`ComponentExportIndex` from the previous commit and serve as a path toaccelerating instantiation because all name lookups are skipped.* Update test expectations for `bindgen!`-generated output* Review comments* Fix doc link
Update nightly used in CI and fix warnings (#8416)Fixes some warnings that nightly Rust has started emitting.
Disable traps by default in `bindgen!` imports (#8310)By default previously all return types were wrapped in`wasmtime::Result<T>` to enable any import to return a trap to the wasmguest. This is a
Disable traps by default in `bindgen!` imports (#8310)By default previously all return types were wrapped in`wasmtime::Result<T>` to enable any import to return a trap to the wasmguest. This is a fair bit of boilerplate, however, and it's easy toaccidentally turn a normal error into a trap. This is additionallysomewhat of a power-user method as many imports probably don't end upwanting to trap.This commit adds a new configuration option to `bindgen!`:`trappable_imports`, and switches the default to `false`. The previousbehavior can be recovered with `trappable_imports: true`.
Update syntax for `trappable_error_type` in `bindgen!` (#7170)* Update syntax for `trappable_error_type` in `bindgen!`Following through on a suggestion from #7152 this makes the syntax a bitmore
Update syntax for `trappable_error_type` in `bindgen!` (#7170)* Update syntax for `trappable_error_type` in `bindgen!`Following through on a suggestion from #7152 this makes the syntax a bitmore consistent with the rest of `bindgen!` today. This additionallyupdates the documentation on the `bindgen!` macro itself.* Update parsing to afford for versions
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.
Add an error resource to WASI streams (#7152)* Change `bindgen!`'s trappable error to take an input typeThis commit removes the generated type for `trappable_error_type` fromthe `bindgen!` macr
Add an error resource to WASI streams (#7152)* Change `bindgen!`'s trappable error to take an input typeThis commit removes the generated type for `trappable_error_type` fromthe `bindgen!` macro to allow users to provide a type instead. Thisworks similarly as before with new conversion functions generated intraits which are used to convert the custom error into the ABIrepresentation of what a WIT world expects.There are a few motivations for this commit:* This enables reducing the number of errors in play between async/sync bindings by using the same error type there.* This avoids an auto-generated type which is more difficult to inspect than one that's written down already and the source can more easily be inspected.* This enables richer conversions using `self` (e.g. `self.table_mut()`) between error types rather than purely relying on `Into`. This is important for #7017 where an error is going to be inserted into the table as it gets converted.* Fix tests* Update WASI to use new trappable errorsThis commit deals with the fallout of the previous commit for the WASIpreview2 implementation. The main changes here are:* Bindgen-generated `Error` types no longer exist. These are replaced with `TrappableError<T>` where type aliases are used such as ```rust type FsError = TrappableError<wasi::filesystem::types::ErrorCode>; ```* Type synonyms such as `FsResult<T>` are now added for more conveniently writing down fallible signatures.* Some various error conversions are updated from converting to the old `Error` type to now instead directly into corresponding `ErrorCode` types.* A number of cases where unknown errors were turned into traps now return bland error codes and log the error instead since these aren't fatal events.* The `StreamError` type does not use `TrappableError` since it has other variants that it's concerned with such as a `LastOperationFailed` variant which has an `anyhow::Error` payload.* Some minor preview1 issues were fixed such as trapping errors being turned into normal I/O errors by accident.* Add an `error` resource to WASI streamsThis commit adds a new `error` resource to the `wasi:io/streams`interface. This `error` resource is returned as part of`last-operation-failed` and serves as a means to discover through otherinterfaces more granular type information than a generic string. Thiserror type has a new function in the `filesystem` interface, forexample, which enables getting filesystem-related error codes from I/Operformed on filesystem-originating streams. This is plumbed through tothe adapter as well to return more than `ERRNO_IO` from failedread/write operations now too.This is not super fancy just yet but is intended to be a vector throughwhich future additions can be done. The main thing this enables is toavoid dropping errors on the floor in the host and enabling the guest todiscover further information about I/O errors on streams.Closes #7017* Update crates/wasi-http/wit/deps/io/streams.witCo-authored-by: Trevor Elliott <[email protected]>* Update wasi-http wit too* Remove unnecessary clone---------Co-authored-by: Trevor Elliott <[email protected]>
Add a bindgen test that exercises using error types from a different interface (#6802)
Resolve trappable error types with fully qualified package paths (#6795)* Switch trappable_error_type to take a fully-qualified type path* Print trappable error types from other interfaces with t
Resolve trappable error types with fully qualified package paths (#6795)* Switch trappable_error_type to take a fully-qualified type path* Print trappable error types from other interfaces with their module path
[wit-bindgen] provide more control over type ownership (#6648)* [wit-bindgen] provide more control over type ownershipThis replaces the `duplicate_if_necessary` parameter to`wasmtime::component:
[wit-bindgen] provide more control over type ownership (#6648)* [wit-bindgen] provide more control over type ownershipThis replaces the `duplicate_if_necessary` parameter to`wasmtime::component::bindgen` with a new `ownership` parameter which providesfiner-grained control over whether and how generated types own their fields.The default is `Ownership::Owning`, which means types own their fieldsregardless of how they are used in functions. These types passed by referencewhen used as parameters to guest-exported functions. Note that this alsoaffects how unnamed types (e.g. `list<list<string>>`) are passed: using areference only at the top level (e.g. `&[Vec<String>]` instead of `&[&[&str]]`,which is more difficult to construct when using non-`'static` data).The other option is `Ownership::Borrowing`, which includes a`duplicate_if_necessary` field, providing the same code generation strategy aswas used prior to this change.If we're happy with this approach, I'll open another PR in the `wit-bindgen`repo to match.This also fixes a bug that caused named types to be considered owned and/orborrowed when they shouldn't have been due to having fields with unnamed typeswhich were owned and/or borrowed in unrelated interfaces.Signed-off-by: Joel Dice <[email protected]>* fix test breakageSigned-off-by: Joel Dice <[email protected]>---------Signed-off-by: Joel Dice <[email protected]>
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
Update to latest wasm-tools crates (#6378)* Update to latest wasm-tools cratesThis commit pushes through the full update of the wasm-tools cratesthrough Wasmtime. There are two major features wh
Update to latest wasm-tools crates (#6378)* Update to latest wasm-tools cratesThis commit pushes through the full update of the wasm-tools cratesthrough Wasmtime. There are two major features which changed, bothrelated to components, which required updates in Wasmtime:* Resource types are now implemented in wasm-tools and they're not yet implemented in Wasmtime so I've stubbed out the integration point with panics as reminders to come back and implement them.* There are new validation rules about how aggregate types must be named. This doesn't affect runtime internals at all but was done on behalf of code generators. This did however affect a number of tests which have to ensure that types are exported.* Fix more tests* Add vet entries
Rework `only_interfaces` to the `interfaces` field (#6210)* Rework `only_interfaces` to the `interfaces` field* Fix the docs* Remove only_interfaces test from the component-macro package
Add `only_interfaces` and `with` to the `bindgen!` macro. (#6160)* Add `only_interfaces` and `with` to the `bindgen!` macro.* Add a version of the empty_error test for `only_interfaces` and `with
Add `only_interfaces` and `with` to the `bindgen!` macro. (#6160)* Add `only_interfaces` and `with` to the `bindgen!` macro.* Add a version of the empty_error test for `only_interfaces` and `with`* Review feedback* Add docs
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 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
component bindgen: accept strs as well as identifiers for wit identifiers (#5600)This is required because not all wit identifiers are Rust identifiers, so we can smuggle the invalid ones inside qu
component bindgen: accept strs as well as identifiers for wit identifiers (#5600)This is required because not all wit identifiers are Rust identifiers, so we can smuggle the invalid ones inside quotes.
12