Stream: git-wasmtime

Topic: wasmtime / issue #111 Order of preopened directories matters


view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2026 at 20:25):

alexcrichton closed issue #111:

Hello, while investigating wasmerio/wasmer#372 I tried to reproduce what the submitter said and found:

wasmtime --dir=../ --dir=./ ~/etc/hello-wasi/copy.wasm ../LICENSE ./LICENSE
error opening input ../LICENSE: Capabilities insufficient

fails.

However, changing the order of the --dir flags to:

wasmtime --dir=./ --dir=../ ~/etc/hello-wasi/copy.wasm ../LICENSE ./LICENSE

works.

The way I'm approaching this so far for Wasmer is to canonicalize all the preopen dir paths, sort them lexicographically (ensuring parent directories come before child directories (assuming symlinks have been resolved away(1) (which is WIP currently))), then each path is reduced until it's empty or it matches a directory we've already seen and then they're connected (creating intermediate directory entries as necessary).

I'm not entirely clear on the desired behavior, but this seems correct from what I've read so far.

I'd be curious to hear your thoughts on this!

(1): which seems to be the desired behavior anyways, pre-opened FDs seem like they should be snapshotted at the moment of FS instantiation rather than relying on symlinks that could change during execution

view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2026 at 20:25):

alexcrichton commented on issue #111:

I'm going to close this issue because this is nowadays an issue for upstream WASI itself. We're sort of doing all that we can in Wasmtime by passing a list of things to a guest at this point, and how the guest interprets it is up to it. It's true that the guest can't really feasibly make sense of the input today, and that's the subject of a number of upstream WASI issues.


Last updated: Jul 29 2026 at 05:03 UTC