ctaggart opened issue #9695:
For https://github.com/WebAssembly/wasi-cli/blob/main/wit/environment.wit, the
initial-cwdimplementation currently just returnsNone. Adding this issue highlighted by theFIXME:
alexcrichton commented on issue #9695:
This'd perhaps be a good first issue for someone to get their feet wet if they're interested. The general idea to implement this would probably be something like:
- Add a builder method to
WasiCtxBuilder.- Fill in
initial_cwdlinked above to read theWasCtx"built value"- This'll still be
Noneby default for backwards-compat- The
wasmtimeCLI can probably grow a few new options:
-S cwd=<path>- explicitly setting the path to the cwd- (if you're adventurous)
-S inherit-fs- inherit the whole filesystem and set the cwd to the process's cwd- (if you're extra adventurous) unify
-S inherit-*under-S inherit[=fs,network,...]where-S inheritcan be "inherit the whole shebang" while-S inherit-fscould be-S inherit=fs.
alexcrichton added the good first issue label to Issue #9695.
stephenmuss commented on issue #9695:
@alexcrichton I'd be keen to have a crack at this.
I have a wip branch and commit at https://github.com/stephenmuss/wasmtime/commit/af44736104b2803b451faa0e783461ab88515c29, would be good to know I'm heading down the right path.
alexcrichton commented on issue #9695:
Looking good! That's mostly just missing a test and should be good to land :+1:
efJerryYang commented on issue #9695:
This issue seems already implemented in main branch:
https://github.com/search?q=repo%3Abytecodealliance%2Fwasmtime%20initial_cwd&type=code
Related PR and issues may need to be closed.
alexcrichton commented on issue #9695:
Ah unfortunately not quite, there's no actual way to configure the field via
WasiCtxBuildernor is there a way to configure the cwd from the CLI, so those will need to be implemented before this is done.
efJerryYang commented on issue #9695:
Ah I see, thanks for your clarification! I will take a closer look at current progress of this issue.
Last updated: Dec 13 2025 at 19:03 UTC