bytecodealliance / bytecodealliance/wasmtime
wasip1 path_remove_directory fails with paths with trailing slashes
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
### Test Case
For the wasi-testsuite test [remove_directory_trailing_slashes](https://github.com/WebAssembly/wasi-testsuite/blob/main/tests/rust/src/bin/remove_directory_trailing_slashes.rs#L19), we mkdir `dir.cleanup`, then try to rrmdir `dir.cleanup/` (note trailing slash). This fails because it uses the "get the parent then remove the leaf" strategy, and the parent of `dir.cleanup/` is `dir.cleanup`, and the leaf is `.`.
A trace: https://github.com/WebAssembly/wasi-testsuite/issues/101#issuecomment-3214123363
I would expect that the rmdir removes trailing slashes.
Filing this bug here as I am not sure if this is a failure of cap-std or if callers are required to remove trailing slashes already.
### Versions and Environment
Wasmtime version or commit: 1a88c70a6ec088ee213658488549306f8951405d (august 19)
Contributor guide
Assessment
This issue has not been assessed yet.