[WASI] Consistency Issue with io::ErrorKind in wasm32-wasip1-threads
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I have code in a wasm32-wasip1-threads environment that uses std::fs to check if a file exists.
If the file does not exist, as you can see in this code snippet: https://github.com/rust-lang/rust/blob/acaf0aeed0dfbfc4be9f996344e2c5f294cf5794/library/std/src/sys/pal/wasi/fs.rs#L713-L727, it returns io::ErrorKind::Uncategorized when it cannot find the file descriptor.
In other environments, it provides io::ErrorKind::NotFound. Therefore, I would like this to be consistent.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with library/std/src/sys/pal/wasi/fs.rs at lines 713-727 and trace how a missing file descriptor becomes an io::ErrorKind. Compare the wasm32-wasip1-threads behavior with the other environments described in the issue, then verify that a missing file produces NotFound consistently with a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100