wasi-testsuite icon indicating copy to clipboard operation
wasi-testsuite copied to clipboard

wasip3: descriptor#open-at(".") behavior when WRITE flag passed differs between Windows and Unix

Open wingo opened this issue 3 months ago • 3 comments

On Linux, with wasmtime, if you open a directory with the WRITE flag (but no read flag), it fails with EISDIR. On Windows, it succeeds. This occurs in the wasip3 filesystem-flags-and-type test. Is this something that should be made consistent on the wasmtime side @alexcrichton @sunfishcode @pchickey or do we need to document it in the spec ?

wingo avatar Oct 07 '25 12:10 wingo

The test log on Windows:

Test filesystem-flags-and-type failed
  [exit_code] 0 == 3
STDOUT:

STDERR:

thread '<unnamed>' (1) panicked at src/bin/filesystem-flags-and-type.rs:55:14:
called `Result::unwrap_err()` on an `Ok` value: Descriptor { handle: Resource { handle: 3 } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `tests\rust\testsuite\wasm32-wasip3\filesystem-flags-and-type.wasm`

wingo avatar Oct 07 '25 12:10 wingo

The file: https://github.com/WebAssembly/wasi-testsuite/blob/main/tests/rust/wasm32-wasip3/src/bin/filesystem-flags-and-type.rs

wingo avatar Oct 07 '25 12:10 wingo

I suspect this would be simple enough to handle in Wasmtime to have the same behavior across platforms

alexcrichton avatar Oct 07 '25 16:10 alexcrichton