Conversation
Signed-off-by: Till Schneidereit <till@tillschneidereit.net>
bf9e781 to
3e82f5c
Compare
|
@tschneidereit I think you'll need to update https://github.com/fermyon/spin-componentize and https://github.com/fermyon/wit-bindgen-backport as well. I'll take a closer look later today. |
I'll send a PR for updating the upstream APIs to be more amenable to patterns like this |
|
|
||
| /// A builder of a `WasiCtx` for all versions of Wasi | ||
| #[allow(clippy::large_enum_variant)] | ||
| enum WasiCtxBuilder { |
There was a problem hiding this comment.
The conclusion of bytecodealliance/wasmtime#6770 was that this should probably use a WasiCtxBuilder in both arms to use the move-style everywhere instead of on just one half to avoid some of the weirdness here. Otherwise the other possible fix is to update to &mut-style builders but that has other API drawbacks that aren't a clear win at this time.
The major difference from preview1 is that the preview2 WasiCtx doesn't have the mutators that preview1's context has I believe.
There was a problem hiding this comment.
I commented over there, because I'm still not entirely convinced, but we can certainly live with things as they are now
There was a problem hiding this comment.
I'm also not too sure how using a builder in both arms would actually make things easier, but I'm probably missing something there
Signed-off-by: Till Schneidereit <till@tillschneidereit.net>
Thanks Ryan! I had updated the wit-bindgen backport, but missed spin-componentize. That's fermyon/spin-componentize#16 now. |
|
Closing this as I believe we want to wait until wasmtime 13 to upgrade. @tschneidereit let me know if that's not a mistake and we can reopen this. |
Mostly this update was uneventful. However there's a change to the WasiCtxBuilder for Preview2 that made using it much more annoying. @alexcrichton, maybe you have ideas for how to do this in a better way?