Skip to content

Run the Rust corpus programs end to end through WasiPreview2 - #72

Open
andreaTP wants to merge 1 commit into
roastedroot:mainfrom
andreaTP:corpus-command-harness
Open

andreaTP wants to merge 1 commit into
roastedroot:mainfrom
andreaTP:corpus-command-harness

Conversation

@andreaTP

@andreaTP andreaTP commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Runs every Rust command program from the component corpus through WasiPreview2 and checks its exit code, stdout and stderr against the spec beside it. Each spec was recorded by running its program on wasmtime with the corpus's verify.sh, so a pass means the same result wasmtime gave.

All 11 programs pass: hello, args, env, exiting with success and with failure, an empty stdin, file read/write, directory listing, random and clocks. This is the first time real wasm32-wasip2 programs built by a stock Rust toolchain run end to end on endive-cm.

The spec format has no field for stdin, so stdin is always empty. Rust's standard library only reports success or failure, so the exit codes checked are 0 and 1.

CorpusCommandTest mirrors Endive's WASI test runner:

  • it copies the spec's root fixture into an in-memory ZeroFS preopened as /;
  • it passes [name, args...] and env;
  • it captures stdout and stderr, calls run, and compares the exit code and output.

The programs rely on the corpus (#71), wasi:cli (#70) and version-compatible linking (#69), since they import @0.2.6. All three are on main, so this is now the single test commit on top.

@andreaTP
andreaTP force-pushed the corpus-command-harness branch from a144cfb to e999b59 Compare October 27, 2026 18:10
@andreaTP
andreaTP marked this pull request as ready for review October 28, 2026 12:45
@andreaTP

Copy link
Copy Markdown
Contributor Author

This is now ready for review 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant