Changes to wasmtime 14.0.0 WasiCtxBuilder stdout/stderr methods
I'm trying to migrate to v14 from v13 and am struggling getting the code I currently have to adopt.
Version 13 allowed me to pass an AsyncWriteStream to the stdout and stderr methods but v14 has changed the type from HostOutputStream to StdoutStream which AsyncWriteStream does not implement.
Does anyone have suggestions on how best to adopt allowing me to continue setting stdout and stderr to my own pathed files ?
Thanks
Here's what we did in Spin:
https://github.com/fermyon/spin/blob/12becdcc33b6e59bb3aea3dd511f24616a239852/crates/core/src/store.rs#L12-L14
https://github.com/fermyon/spin/blob/12becdcc33b6e59bb3aea3dd511f24616a239852/crates/core/src/store.rs#L445-L459
https://github.com/fermyon/spin/blob/12becdcc33b6e59bb3aea3dd511f24616a239852/crates/core/src/store.rs#L224-L226
Thanks !! That worked great.
Richard Backhouse has marked this topic as resolved.
Just a quick note that the MyStdoutStream
I linked to above doesn't work for composed components (i.e. components that have two or more subcomponents) since each one will need its own handle to each stdio stream. We just discovered this while experimenting with wasm-compose
and will update the code to allow MyStdoutStream::stream
to be called more than once.
Last updated: Nov 22 2024 at 16:03 UTC