pchickey edited PR #8053.
pchickey has marked PR #8053 as ready for review.
pchickey requested fitzgen for a review on PR #8053.
pchickey requested wasmtime-core-reviewers for a review on PR #8053.
pchickey requested elliottt for a review on PR #8053.
pchickey edited PR #8053:
This PR adds wasmtime_wasi::WasiP1Ctx, which is a WasiCtx for just using WASI P1 (and P0).
This simplifies user experience for users migrating from wasi-common's P1 support - it means they dont have to know about the View traits or the WasiPreview1Adapter.
The p1/p0 add_to_linker functions now take a closure that is the lens for the T in Store<T>, to be consistent with wasi-common and in general what wasmtime::Linker users expect.
WasiCtxBuilder now has a convenient function
build_p1(&mut self) -> WasiP1Ctx
that can be used in the place ofbuild(&mut self) -> WasiCtx
for users targeting a P1 embedding.This PR also adds two trivial methods to WasiCtxBuilder to reflect ones that existed in wasi-common;s:
inherit_env
andinherit_args
.Finally, this PR adds
AsyncStdinStream
andAsyncStdoutStream
as wrappers onAsyncReadStream
andAsyncWriteStream
to provide implementations ofStdinStream
andStdoutStream
. (This could be separated into a totally different PR, but it doesnt seem worth the e-paperwork overhead to bother.) These provide parity with the wasi-common affordances for piping stdio to/from files, which happen to be used in the c-api.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
pchickey edited PR #8053:
This PR adds
wasmtime_wasi::WasiP1Ctx
, which is aWasiCtx
for just using WASI P1 (and P0).This simplifies user experience for users migrating from wasi-common's P1 support - it means they dont have to know about the
*View
traits or theWasiPreview1Adapter
, which are just implementation details to a P1 embedder.The p1/p0 add_to_linker functions now take a closure that is the lens for the T in Store<T>, to be consistent with wasi-common and in general what wasmtime::Linker users expect.
WasiCtxBuilder now has a convenient function
build_p1(&mut self) -> WasiP1Ctx
that can be used in the place ofbuild(&mut self) -> WasiCtx
for users targeting a P1 embedding.This PR also adds two trivial methods to WasiCtxBuilder to reflect ones that existed in wasi-common;s:
inherit_env
andinherit_args
.Finally, this PR adds
AsyncStdinStream
andAsyncStdoutStream
as wrappers onAsyncReadStream
andAsyncWriteStream
to provide implementations ofStdinStream
andStdoutStream
. (This could be separated into a totally different PR, but it doesnt seem worth the e-paperwork overhead to bother.) These provide parity with the wasi-common affordances for piping stdio to/from files, which happen to be used in the c-api.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
pchickey edited PR #8053:
This PR adds
wasmtime_wasi::WasiP1Ctx
, which is aWasiCtx
for just using WASI P1 (and P0).This simplifies user experience for users migrating from wasi-common's P1 support - it means they don't have to know about the
*View
traits or theWasiPreview1Adapter
, which are just implementation details to a P1 embedder.The p1/p0 add_to_linker functions now take a closure that is the lens for the T in Store<T>, to be consistent with wasi-common and in general what wasmtime::Linker users expect.
WasiCtxBuilder now has a convenient function
build_p1(&mut self) -> WasiP1Ctx
that can be used in the place ofbuild(&mut self) -> WasiCtx
for users targeting a P1 embedding.This PR also adds two trivial methods to WasiCtxBuilder to reflect ones that existed in wasi-common;s:
inherit_env
andinherit_args
.Finally, this PR adds
AsyncStdinStream
andAsyncStdoutStream
as wrappers onAsyncReadStream
andAsyncWriteStream
to provide implementations ofStdinStream
andStdoutStream
. (This could be separated into a totally different PR, but it doesnt seem worth the e-paperwork overhead to bother.) These provide parity with the wasi-common affordances for piping stdio to/from files, which happen to be used in the c-api.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
pchickey edited PR #8053:
This PR adds
wasmtime_wasi::WasiP1Ctx
, which is aWasiCtx
for just using WASI P1 (and P0).This simplifies user experience for users migrating from wasi-common's P1 support - it means they don't have to know about the
*View
traits or theWasiPreview1Adapter
, which are just implementation details to a P1 embedder.The p1/p0
add_to_linker_{a?}sync
functions now take a closure that is the lens for the T in Store<T>, to be consistent with wasi-common and in general whatwasmtime::Linker
users expect.WasiCtxBuilder now has a convenient function
build_p1(&mut self) -> WasiP1Ctx
that can be used in the place ofbuild(&mut self) -> WasiCtx
for users targeting a P1 embedding.This PR also adds two trivial methods to WasiCtxBuilder to reflect ones that existed in wasi-common;s:
inherit_env
andinherit_args
.Finally, this PR adds
AsyncStdinStream
andAsyncStdoutStream
as wrappers onAsyncReadStream
andAsyncWriteStream
to provide implementations ofStdinStream
andStdoutStream
. (This could be separated into a totally different PR, but it doesnt seem worth the e-paperwork overhead to bother.) These provide parity with the wasi-common affordances for piping stdio to/from files, which happen to be used in the c-api.The top-level tests and examples that were using
wasi-common
are updated to usewasmtime-wasi::WasiP1Ctx
.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
elliottt submitted PR review:
:tada:
pchickey commented on PR #8053:
This PR should be backported to the release-19.0.0 branch
elliottt merged PR #8053.
Last updated: Dec 23 2024 at 13:07 UTC