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

feat(wasi): add support for wasi:[email protected] #10061

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rvolosatovs
Copy link
Member

@rvolosatovs rvolosatovs commented Jan 21, 2025

Blocked on #10073

This adds support for wasi:[email protected] 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:[email protected]. 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

@rvolosatovs rvolosatovs marked this pull request as ready for review January 21, 2025 15:02
@rvolosatovs rvolosatovs requested review from a team as code owners January 21, 2025 15:02
@rvolosatovs rvolosatovs requested review from pchickey and removed request for a team January 21, 2025 15:02
@rvolosatovs rvolosatovs force-pushed the feat/random-0-3-0 branch 4 times, most recently from 6366fd2 to 38c0f34 Compare January 21, 2025 15:37
Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Signed-off-by: Roman Volosatovs <[email protected]>
@rvolosatovs
Copy link
Member Author

rvolosatovs commented Jan 22, 2025

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

@rvolosatovs rvolosatovs marked this pull request as draft January 22, 2025 11:13
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
@rvolosatovs rvolosatovs force-pushed the feat/random-0-3-0 branch 2 times, most recently from 630e330 to 14298eb Compare January 22, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants