WebAssembly / WebAssembly/WASI

Error code ambiguity

Open
#524 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-inactive
Dominant language
Rust
Stars
5.8k
Forks
333
Avg merge
2d 13h
Merged PRs (30d)
3

Description

Over in Wasmtime, the CLI binary rewrites certain exit codes from WASI's proc_exit in order to avoid issues on Windows; see here. This makes it difficult to write WASI tests (e.g., in wasi-testsuite) that reliably emit the same exit code across operating systems. I discovered this in https://github.com/bytecodealliance/wasmtime/pull/5907 and will temporarily disable the tests on Windows.

I propose that we decide whether the exit code translation that Wasmtime currently does is something that all WASI engines should do. If so, then we can document that translation here and then the wasi-testsuite can either: a) create test runners that understand the exit code translation or b) write tests that avoid the ambiguity entirely.

cc: @sunfishcode, who has more context on this decision.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Wasmtime code in crates/wasi/src/lib.rs#L102-L107 and review the exit-code behavior described for Windows. Then examine the temporarily disabled WASI tests and the wasi-testsuite context. Done means the cross-platform translation policy is decided, documented, and its test-suite implications are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
documentation, operating-systems
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.