WebAssembly / WebAssembly/WASI
Providing a wasip1 stat API on top of wasip2 is infeasible
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
In short, the problem is that it is difficult or impossible to implement a wasi preview1 adapter that consumes the wasip2 API (metadataHash and isSameObject) and provides the wasip1 API (st_dev/st_ino). Right now the adapter is using the lower word of metadataHash for st_ino, but this has two issues:
- Implementing
metadataHashto always return 0 is legal in wasip2, but this causes applications to conclude that all files they read are actually the same file, and breaks e.g. Clang. - Implementing
metadataHashto return something that can be the same for two different files that are not hard links to each other (e.g. hash of file contents) causes applications to conclude that these unrelated files are actually the same file, and breaks e.g. tar which will create an archive with a hard link where none exists on the filesystem.
See the prior discussion in bytecodealliance/wasmtime#8956.
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 the wasip1 stat API and the wasip2 metadataHash and isSameObject entry points described in the issue. Read the linked prior discussion in bytecodealliance/wasmtime#8956, then evaluate whether a mapping can avoid false file identity for cases such as Clang and tar. Done should establish a viable approach or clearly document why the API cannot be provided safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100