angelnereira opened PR #13468 from angelnereira:wasi-initial-cwd to bytecodealliance:main:
This implements the missing configuration path for wasi:cli/environment.initial-cwd discussed in #9695.
Summary:
- add WasiCtxBuilder::initial_cwd to configure the value reported by wasi:cli/environment.initial-cwd
- add -Scwd=<path> and wire it into the CLI's WASIp2 context setup
- add an end-to-end CLI test component that verifies the guest observes the configured cwd
Tests:
- cargo fmt --all -- --check
- cargo test -p wasmtime-cli-flags from_toml
- cargo test -p wasmtime-wasi --lib initial_cwd
- cargo test -p test-programs --target=wasm32-wasip1 --no-run --bin p2_cli_initial_cwd
- cargo test -p wasmtime-cli --test all p2_cli_initial_cwd
- cargo check -p wasmtime-cli
- cargo clippy -p wasmtime-cli-flags -p wasmtime-wasi --lib
angelnereira requested pchickey for a review on PR #13468.
angelnereira requested wasmtime-wasi-reviewers for a review on PR #13468.
angelnereira requested wasmtime-core-reviewers for a review on PR #13468.
github-actions[bot] added the label wasi on PR #13468.
:thumbs_up: alexcrichton submitted PR review:
Thanks!
:speech_balloon: alexcrichton created PR review comment:
There's no need to add these tests, we don't typically test at this micro-level of granularity. The end-to-end tests are fine. (it becomes extremely onerous to refactor if tests are there for every possible behavior and implementation detail of a function)
:speech_balloon: alexcrichton created PR review comment:
For this it's best to skip the test here and rely on testing in
cli_tests.rsinstead. Given that, can you remove this?
:memo: angelnereira submitted PR review.
:speech_balloon: angelnereira created PR review comment:
Makes sense, thanks for the guidance. I’ll remove these low-level checks and keep the coverage at the CLI/end-to-end level.
:memo: angelnereira submitted PR review.
:speech_balloon: angelnereira created PR review comment:
thanks. I’ll remove these micro-level tests and keep the behavior covered at the end-to-end level.
angelnereira updated PR #13468.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #13468 Implement WASI initial cwd configuration to the merge queue.
:check: alexcrichton merged PR #13468.
alexcrichton removed PR #13468 Implement WASI initial cwd configuration from the merge queue.
Last updated: Jun 01 2026 at 09:49 UTC