Stream: git-wasmtime

Topic: wasmtime / PR #10061 feat(wasi): add support for `wasi:ra...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 14:35):

rvolosatovs opened PR #10061 from rvolosatovs:feat/random-0-3-0 to bytecodealliance:main:

This adds support for wasi:random@0.3.0 from https://github.com/WebAssembly/wasi-random/tree/3e99124e81d0f80872b826d161bef077ee37d241/wit-0.3.0-draft

The change is fully backwards-compatible from the guest's perspective.

The only breaking change is the wasmtime_wasi::bindings structure, where wasmtime_wasi::bindings::random is now located at wasmtime_wasi::bindings::random0_2_3.

The interface versions are almost identical apart from the @since gates.

This PR is intentionally small and well-scoped to enable further (mostly) backwards-compatible development and testing for WASI 0.3

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 14:36):

rvolosatovs edited PR #10061:

This adds support for wasi:random@0.3.0 from https://github.com/WebAssembly/wasi-random/tree/3e99124e81d0f80872b826d161bef077ee37d241/wit-0.3.0-draft

The change is fully backwards-compatible from the guest's perspective.

The only breaking change is the wasmtime_wasi::bindings structure, where wasmtime_wasi::bindings::random is now located at wasmtime_wasi::bindings::random0_2_3.

The interface versions are almost identical apart from the @since gates.

This PR is intentionally small and well-scoped to establish the approach and enable further (mostly) backwards-compatible development and testing for WASI 0.3

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 14:50):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 14:50):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:01):

rvolosatovs edited PR #10061:

This adds support for wasi:random@0.3.0 from https://github.com/WebAssembly/wasi-random/tree/3e99124e81d0f80872b826d161bef077ee37d241/wit-0.3.0-draft

The change is fully backwards-compatible from the guest's perspective.

The only breaking change is the wasmtime_wasi::bindings structure, where wasmtime_wasi::bindings::random is now located at wasmtime_wasi::bindings::random0_2_3.

The interface versions are almost identical apart from the @since gates.

This PR is intentionally small and well-scoped to establish the approach and enable further (mostly) backwards-compatible development and testing for WASI 0.3

For now, the existing command world is simply extended with wasi:random@0.3.0. In the future we'll probably want to decouple the component export and import binding generation and instead generate:

This way we will be able to accommodate 2 different versions of wasi:cli/command exported by components

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:02):

rvolosatovs has marked PR #10061 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:02):

rvolosatovs requested pchickey for a review on PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:02):

rvolosatovs requested wasmtime-core-reviewers for a review on PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:02):

rvolosatovs requested wasmtime-default-reviewers for a review on PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:26):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:31):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:37):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 15:37):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 21 2025 at 20:33):

pchickey submitted PR review:

Thanks for getting this started!

I think that, until 0.3 is released, we should keep the existing bindings to 0.2.x at their current position in the module tree, because they have "real" users whereas 0.3 should not yet. We also don't want to bake the patch version into the module paths of the public API, since it changes regularly and upgrades are supposed to be transparent to users.

I'd support a PR that moves the canonical definition of the 0.2 bindings to bindings::p2 with a pub use at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those at bindings::p3 and behind an off-by-default cargo feature p3. The module and cargo feature should have a comment indicating these implementations are unstable and pre-standardization, and that bug/security fixes limited to p3 won't be given patch releases.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 11:11):

rvolosatovs commented on PR #10061:

Thanks for getting this started!

I think that, until 0.3 is released, we should keep the existing bindings to 0.2.x at their current position in the module tree, because they have "real" users whereas 0.3 should not yet. We also don't want to bake the patch version into the module paths of the public API, since it changes regularly and upgrades are supposed to be transparent to users.

I'd support a PR that moves the canonical definition of the 0.2 bindings to bindings::p2 with a pub use at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those at bindings::p3 and behind an off-by-default cargo feature p3. The module and cargo feature should have a comment indicating these implementations are unstable and pre-standardization, and that bug/security fixes limited to p3 won't be given patch releases.

I've moved the existing WASI implementations to p2 modules with a pub use::* as suggested in #10073. Let me know what you think!

I'll meanwhile mark this PR as draft and rebase it on top of #10073

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 11:11):

rvolosatovs edited a comment on PR #10061:

Thanks for getting this started!

I think that, until 0.3 is released, we should keep the existing bindings to 0.2.x at their current position in the module tree, because they have "real" users whereas 0.3 should not yet. We also don't want to bake the patch version into the module paths of the public API, since it changes regularly and upgrades are supposed to be transparent to users.

I'd support a PR that moves the canonical definition of the 0.2 bindings to bindings::p2 with a pub use at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those at bindings::p3 and behind an off-by-default cargo feature p3. The module and cargo feature should have a comment indicating these implementations are unstable and pre-standardization, and that bug/security fixes limited to p3 won't be given patch releases.

I've moved the existing WASI implementations to p2 modules with a pub use::* as suggested: #10073. Let me know what you think!

I'll meanwhile mark this PR as draft, rebase it on top of #10073 and introduce the p3 module for wasmtime-wasi

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 12:24):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 12:30):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 12:32):

rvolosatovs updated PR #10061.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 12:34):

rvolosatovs edited PR #10061:

Blocked on #10073

This adds support for wasi:random@0.3.0 from https://github.com/WebAssembly/wasi-random/tree/3e99124e81d0f80872b826d161bef077ee37d241/wit-0.3.0-draft

The change is fully backwards-compatible from the guest's perspective.

The only breaking change is the wasmtime_wasi::bindings structure, where wasmtime_wasi::bindings::random is now located at wasmtime_wasi::bindings::random0_2_3.

The interface versions are almost identical apart from the @since gates.

This PR is intentionally small and well-scoped to establish the approach and enable further (mostly) backwards-compatible development and testing for WASI 0.3

For now, the existing command world is simply extended with wasi:random@0.3.0. In the future we'll probably want to decouple the component export and import binding generation and instead generate:

This way we will be able to accommodate 2 different versions of wasi:cli/command exported by components


Last updated: Jan 24 2025 at 00:11 UTC