Stream: git-wasmtime

Topic: wasmtime / PR #14135 Return is-directory when a directory...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:19):

SebTardif opened PR #14135 from SebTardif:fix/dir-read-is-directory to bytecodealliance:main:

Prior discussion: WebAssembly/wasi-libc#869 (@alexcrichton: fix this in Wasmtime instead of extra libc syscalls).

Why

read() on a directory must return EISDIR (POSIX). Wasmtime's Descriptor::file() mapped a directory to error-code::bad-descriptor. wasi-libc then had to stat/get_type just to remap EBADF. On wasip3, read-via-stream is a tuple import, so that host ? trapped instead of returning a guest error.

wasi:filesystem already documents is-directory as the EISDIR analog. Descriptor::dir() already returns not-directory for a file. This makes file() the dual.

Change

Tests

Red (unpatched host): p2 guest saw bad-descriptor (code 3). Green: is-directory (code 14).

References

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:19):

SebTardif requested dicej for a review on PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:19):

SebTardif requested wasmtime-core-reviewers for a review on PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:19):

SebTardif requested wasmtime-wasi-reviewers for a review on PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:21):

:thumbs_up: alexcrichton submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:21):

alexcrichton has enabled auto merge for PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:37):

alexcrichton has disabled auto merge for PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 22:37):

SebTardif updated PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 23:57):

github-actions[bot] added the label wasi on PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 14 2026 at 13:52):

dicej added PR #14135 Return is-directory when a directory fd is used as a file to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 14 2026 at 14:18):

:check: dicej merged PR #14135.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 14 2026 at 14:18):

dicej removed PR #14135 Return is-directory when a directory fd is used as a file from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC