wingo opened PR #12169 from wingo:canonicalize-unlink-dir-errors to bytecodealliance:main:
When attempting to unlink a directory, POSIX specifies the result should be EPERM, but only MacOS implements that behavior. Paper over the differences. Also turn EACCESS into EPERM, to paper over Windows differences.
Related to https://github.com/WebAssembly/WASI/pull/852 and https://github.com/WebAssembly/wasi-testsuite/pull/137.
POSIX 2008 reference: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
wingo requested wasmtime-wasi-reviewers for a review on PR #12169.
wingo updated PR #12169.
Seems this fails wasip1 tests which do want to assert that the error is
ISDIR. Probably best to move this workaround to just the p3 bindings, because I don't want to touch p1 or p2.
wingo updated PR #12169.
wingo updated PR #12169.
alexcrichton submitted PR review:
Thanks! Could this have a test here as well? Also, could this be done around here to apply to wasip{1,2,3} uniformly instead of just wasip3?
I originally did it on
filesystem.rs, but then that caused the existing p1/p2 tests to fail as they were expectingEISDIR, so I moved it to p3 only. Sure, can do a test here, will be after the holidays tho :)
Last updated: Jan 09 2026 at 13:15 UTC