Stream: wasmtime

Topic: ✔ WASI Rights after 9.0


view this post on Zulip CryZe (May 27 2023 at 11:15):

wasmtime removed the rights system in 9.0. So for example WasiCtx::push_dir doesn't take any capabilities arguments anymore. However I still want to push a directory that is read only. How am I supposed to do this with 9.0?

view this post on Zulip Pat Hickey (May 27 2023 at 18:02):

huh, there was supposed to be a ReadOnlyDir(Box<dyn WasiDir>) which impl'd WasiDir in a manner that made the tree read-only

view this post on Zulip Pat Hickey (May 27 2023 at 18:03):

but i dont know where it has gone to

view this post on Zulip Pat Hickey (May 27 2023 at 18:04):

apparently that was never in the wasmtime repo, it was just in the preview2-prototyping repo and i had assumed it had originated upstream

view this post on Zulip Pat Hickey (May 27 2023 at 18:11):

we'll have to add these to wasi-common for the next release, but in the meantime you should be able to define and impl these in your own crate https://github.com/bytecodealliance/preview2-prototyping/commit/486fbeec74e039984333657b0f5f34e6bc009ae6

These are useful for giving guests read-only access to a directory and its contents. Signed-off-by: Joel Dice <joel.dice@fermyon.com>

view this post on Zulip Pat Hickey (May 27 2023 at 18:11):

that source text might not be literally compatible anymore, though

view this post on Zulip Pat Hickey (May 27 2023 at 18:12):

and also you may want to add checks to e.g. open_file and open_dir to fail early if its trying to create

view this post on Zulip Pat Hickey (May 27 2023 at 18:18):

also please beware that there is probably still a filesystem bug lurking in 9.0.2. i discovered something late on friday and then it was time to go have a weekend, so itll have to wait until tuesday.

view this post on Zulip Pat Hickey (May 27 2023 at 18:19):

sorry. this has not been a shining release for our wasi work. in focusing on the new shiny stuff (the preview 2 implementation) i have messed up the old stuff.

view this post on Zulip CryZe (May 28 2023 at 08:58):

Thanks for the very detailed reply :)

Great to hear that a solution is meant to be in place / will be added. I think adding the type myself is probably too error prone, so I think I'll stay on 8.0 for now and skip over 9.0.

view this post on Zulip Notification Bot (May 28 2023 at 08:59):

CryZe has marked this topic as resolved.


Last updated: Nov 22 2024 at 16:03 UTC