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

WASI semver compatibility should apply to exports #8395

Open
alexcrichton opened this issue Apr 17, 2024 · 2 comments
Open

WASI semver compatibility should apply to exports #8395

alexcrichton opened this issue Apr 17, 2024 · 2 comments
Labels
wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself

Comments

@alexcrichton
Copy link
Member

In #7994 the component::Linker type in Wasmtime was made aware of semver by enabling loading a component that requires 0.2.0 of an interface with a supplied 0.2.1 of an interface. This enables us to update WASI in Wasmtime without breaking the ability to load older components.

This support, however, does not work for exports. If a component exports 0.2.0 and the runtime is generating bindings for 0.2.1 then loading the export will fail currently, there's no logic anywhere to probe for older verions.

This represents a snag in our story of WASI compatibility in Wasmtime and is something we should address before updating WASI to 0.2.1

@alexcrichton alexcrichton added wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself labels Apr 17, 2024
@bjorn3
Copy link
Contributor

bjorn3 commented Apr 17, 2024

Removing exports in a new interface version should be trivially fine? Adding non-optional exports shouldn't be allowed as the host may attempt to call them. Adding optional exports would be fine, but the component model doesn't have a way to represent them, right?

@alexcrichton
Copy link
Member Author

Correct yeah, the problem here has to do with bindgen! and how exports are looked up. Currently they're done with exact string matches so if we were to update to WASI 0.2.1 then we'd look for a wasi:cli/run@0.2.1 exported interface but wouldn't be able to find that on an older component where it's called wasi:cli/run@0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

No branches or pull requests

2 participants