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-draftThe change is fully backwards-compatible from the guest's perspective.
The only breaking change is the
wasmtime_wasi::bindings
structure, wherewasmtime_wasi::bindings::random
is now located atwasmtime_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
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-draftThe change is fully backwards-compatible from the guest's perspective.
The only breaking change is the
wasmtime_wasi::bindings
structure, wherewasmtime_wasi::bindings::random
is now located atwasmtime_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
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
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-draftThe change is fully backwards-compatible from the guest's perspective.
The only breaking change is the
wasmtime_wasi::bindings
structure, wherewasmtime_wasi::bindings::random
is now located atwasmtime_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 withwasi:random@0.3.0
. In the future we'll probably want to decouple the component export and import binding generation and instead generate:
- bindings for a world, that includes both
wasi:cli/imports@0.2.3
andwasi:cli/imports@0.3.0
(https://github.com/WebAssembly/wasi-cli/blob/1311434b3440621a5b5fda55378587d971f0c783/wit-0.3.0-draft/imports.wit), but does not export anything- bindings for
wasi:cli/command@0.2.3
- bindings for
wasi:cli/command@0.3.0
This way we will be able to accommodate 2 different versions of
wasi:cli/command
exported by components
rvolosatovs has marked PR #10061 as ready for review.
rvolosatovs requested pchickey for a review on PR #10061.
rvolosatovs requested wasmtime-core-reviewers for a review on PR #10061.
rvolosatovs requested wasmtime-default-reviewers for a review on PR #10061.
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
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 apub use
at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those atbindings::p3
and behind an off-by-default cargo featurep3
. 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.
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 apub use
at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those atbindings::p3
and behind an off-by-default cargo featurep3
. 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 apub 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
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 apub use
at their current location that we can eventually (as 0.3 release approaches) mark as deprecated. When introducing new bindings, lets put those atbindings::p3
and behind an off-by-default cargo featurep3
. 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 apub 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 forwasmtime-wasi
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
rvolosatovs updated PR #10061.
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-draftThe change is fully backwards-compatible from the guest's perspective.
The only breaking change is the
wasmtime_wasi::bindings
structure, wherewasmtime_wasi::bindings::random
is now located atwasmtime_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 withwasi:random@0.3.0
. In the future we'll probably want to decouple the component export and import binding generation and instead generate:
- bindings for a world, that includes both
wasi:cli/imports@0.2.3
andwasi:cli/imports@0.3.0
(https://github.com/WebAssembly/wasi-cli/blob/1311434b3440621a5b5fda55378587d971f0c783/wit-0.3.0-draft/imports.wit), but does not export anything- bindings for
wasi:cli/command@0.2.3
- bindings for
wasi:cli/command@0.3.0
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