Skip to content

Generated guest export bindings are insufficient to call concurrent functions #11249

@rvolosatovs

Description

@rvolosatovs

Since #11238 has been merged, calling an async export requires an Accessor, however, the only way to get an Accessor is to use an Instance.

Users relying uniquely on generated instantiate_async bindings do not have access to one and so can never call the async export.

Steps to Reproduce

  • checkout feat: begin wasip3 implementation #11221
  • cargo doc -p wasmtime-wasi --features p3 --open --document-private-items
  • take a look at docs generated for target/doc/wasmtime_wasi/p3/bindings/struct.Command.html
Image Image

Expected Results

Either a way to run an export without manual instantiation or removal of these bindings

Actual Results

"dead end" from user's perspective with seemingly no way of constructing an Accessor using the public API

Versions and Environment

Wasmtime version or commit: 326795f (latest main)

Operating system: MacOS

Architecture: aarch64-darwin

Extra Info

Without changing wasmtime API, there seem to be two ways to fix this issue:

  • return a tuple from instantiate_async e.g. (Command, Instance) (and similar for other worlds)
  • simply remove the instantiate_async generated functions and require users to always instantiate manually and rely on Command::new (and similar for other worlds)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions