| 1 |
# WASI integration test gaps |
| 2 |
|
| 3 |
Tests annotated with `#[cfg_attr(wasi_runner, ignore = "...")]` are skipped when running integration tests against a WASI binary via wasmtime. This document tracks the reasons so that gaps in WASI support are visible in one place. |
| 4 |
|
| 5 |
To find all annotated tests: `grep -rn 'wasi_runner, ignore' tests/` |
| 6 |
|
| 7 |
## Tools not yet covered by integration tests |
| 8 |
|
| 9 |
arch, b2sum, cat, cksum, cp, csplit, date, dir, dircolors, fmt, join, ls, md5sum, mkdir, mv, nproc, pathchk, pr, printenv, ptx, pwd, readlink, realpath, rm, rmdir, seq, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, shred, sleep, sort, split, tail, touch, tsort, uname, uniq, vdir, yes |
| 10 |
|
| 11 |
## WASI sandbox: host paths not visible |
| 12 |
|
| 13 |
The WASI guest only sees directories explicitly mapped with `--dir`. Host paths like `/proc`, `/sys`, and `/dev` are not accessible. Affected tests include those that read `/proc/version`, `/proc/modules`, `/proc/cpuinfo`, `/proc/self/mem`, `/sys/kernel/profiling`, `/dev/null`, `/dev/zero`, `/dev/full`, and tests that rely on anonymous pipes or Linux-specific I/O error paths. |
| 14 |
|
| 15 |
## WASI: argv/filenames must be valid UTF-8 |
| 16 |
|
| 17 |
The WASI specification requires that argv entries and filenames are valid UTF-8. Tests that pass non-UTF-8 bytes as arguments or create files with non-UTF-8 names cannot run under WASI. |
| 18 |
|
| 19 |
## WASI: no FIFO/mkfifo support |
| 20 |
|
| 21 |
WASI does not support creating or opening FIFOs (named pipes). Tests that use `mkfifo` are skipped. |
| 22 |
|
| 23 |
## WASI: no pipe/signal support |
| 24 |
|
| 25 |
WASI does not support Unix signals or pipe creation. Tests that rely on `SIGPIPE`, broken pipe detection, or pipe-based I/O are skipped. |
| 26 |
|
| 27 |
## WASI: no subprocess spawning |
| 28 |
|
| 29 |
WASI does not support spawning child processes. Tests that shell out to other commands or invoke a second binary are skipped. |
| 30 |
|
| 31 |
## WASI: stdin file position not preserved through wasmtime |
| 32 |
|
| 33 |
When stdin is a seekable file, wasmtime does not preserve the file position between the host and guest. Tests that validate stdin offset behavior after `head` reads are skipped. |
| 34 |
|
| 35 |
## WASI: read_link on absolute paths fails under wasmtime via spawned test harness |
| 36 |
|
| 37 |
`fs::read_link` on an absolute path inside the sandbox (e.g. `/file2`) returns `EPERM` when the WASI binary is launched through `std::process::Command` from the test harness, even though the same call works when wasmtime is invoked directly. This breaks `uucore::fs::canonicalize` for symlink sources, so tests that rely on following a symlink to compute a relative path are skipped. |