Stream: git-wasmtime

Topic: wasmtime / issue #8395 WASI semver compatibility should a...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 14:49):

alexcrichton added the wasi label to Issue #8395.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 14:49):

alexcrichton opened issue #8395:

In https://github.com/bytecodealliance/wasmtime/pull/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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 14:49):

alexcrichton added the wasmtime:api label to Issue #8395.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 18:23):

bjorn3 commented on issue #8395:

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?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 17 2024 at 19:04):

alexcrichton commented on issue #8395:

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

view this post on Zulip Wasmtime GitHub notifications bot (Jun 18 2024 at 18:23):

alexcrichton closed issue #8395:

In https://github.com/bytecodealliance/wasmtime/pull/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


Last updated: Nov 22 2024 at 16:03 UTC