Skip to content

Remove system-interface from wasmtime-wasi#13109

Merged
alexcrichton merged 7 commits intobytecodealliance:mainfrom
alexcrichton:remove-system-interface
Apr 16, 2026
Merged

Remove system-interface from wasmtime-wasi#13109
alexcrichton merged 7 commits intobytecodealliance:mainfrom
alexcrichton:remove-system-interface

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton commented Apr 15, 2026

This commit removes the system-interface dependency from wasmtime-wasi, reimplementing necessary functionality within the crate itself as appropriate. The goal of this commit is to trim our dependency tree. The system-interface crate has not received an update in over a year and continues to pull in an older rustix dependency for example. Additionally I've personally found it confusing and surprising in the past to trace through all the layers of abstractions from wasmtime-wasi to the OS, and I'd like to start slimming this down to be more local within Wasmtime rather than depending on a tree of crates.

The system-interface crate is a relatively thin wrapper around cap-std-style crates providing a platform-agnostic API. This sometimes fits what WASI wants, and sometimes doesn't. For example all reads/writes to files within WASI currently require that Wasmtime maintains a file cursor itself meaning that the underlying OS file cursor doesn't actually matter. Reads and writes through the system-interface abstraction, however, keep the cursor up-to-date to have the same semantics across Unix and Windows which differ in the behavior of the underlying syscalls. This is unnecessarily adds overhead to Wasmtime's implementation of these APIs where they're otherwise not required.

Effectively system-interface is not receiving much maintenance (old dependency on rustix has persisted for ~1 year), its an extra layer of abstraction to debug when issues arise, and its abstractions are not always the best fit for WASI's semantics meaning that it can add performance overhead. The replacement of inlining implementations within Wasmtime is not too too costly and, personally, I view as worth it.

I'll note that this doesn't delete the system-interface crate entirely. That would require removing it from wasi-common as well, which is the subject of #13108.

@alexcrichton alexcrichton requested review from a team as code owners April 15, 2026 17:39
@alexcrichton alexcrichton requested review from dicej and removed request for a team April 15, 2026 17:39
@alexcrichton alexcrichton force-pushed the remove-system-interface branch from 811aa01 to 9af284c Compare April 15, 2026 17:40
@pchickey pchickey changed the title Remove system-interface from wasi-common Remove system-interface from wasmtime-wasi Apr 15, 2026
@alexcrichton alexcrichton added this pull request to the merge queue Apr 15, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2026
@alexcrichton alexcrichton requested a review from a team as a code owner April 15, 2026 20:11
@github-actions github-actions bot added the wasi Issues pertaining to WASI label Apr 15, 2026
@alexcrichton alexcrichton force-pushed the remove-system-interface branch from 1f0e535 to 5e8b6bf Compare April 16, 2026 01:23
@alexcrichton alexcrichton enabled auto-merge April 16, 2026 01:23
This commit removes the `system-interface` dependency from
`wasi-common`, reimplementing necessary functionality within the crate
itself as appropriate. The goal of this commit is to trim our dependency
tree. The `system-interface` crate has not received an update in over a
year and continues to pull in an older `rustix` dependency for example.
Additionally I've personally found it confusing and surprising in the
past to trace through all the layers of abstractions from
`wasmtime-wasi` to the OS, and I'd like to start slimming this down to
be more local within Wasmtime rather than depending on a tree of crates.

The `system-interface` crate is a relatively thin wrapper around
`cap-std`-style crates providing a platform-agnostic API. This sometimes
fits what WASI wants, and sometimes doesn't. For example all
reads/writes to files within WASI currently require that Wasmtime
maintains a file cursor itself meaning that the underlying OS file
cursor doesn't actually matter. Reads and writes through the
`system-interface` abstraction, however, keep the cursor up-to-date to
have the same semantics across Unix and Windows which differ in the
behavior of the underlying syscalls. This is unnecessarily adds overhead
to Wasmtime's implementation of these APIs where they're otherwise not
required.

Effectively `system-interface` is not receiving much maintenance (old
dependency on `rustix` has persisted for ~1 year), its an extra layer of
abstraction to debug when issues arise, and its abstractions are not
always the best fit for WASI's semantics meaning that it can add
performance overhead. The replacement of inlining implementations within
Wasmtime is not too too costly and, personally, I view as worth it.

I'll note that this doesn't delete the `system-interface` crate
entirely. That would require removing it from `wasi-common` as well,
which is the subject of bytecodealliance#13108.
prtest:full
@alexcrichton alexcrichton force-pushed the remove-system-interface branch from 2397167 to b2ee1bb Compare April 16, 2026 19:55
@alexcrichton alexcrichton disabled auto-merge April 16, 2026 20:22
@alexcrichton alexcrichton enabled auto-merge April 16, 2026 20:22
@alexcrichton alexcrichton added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@alexcrichton alexcrichton added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@alexcrichton alexcrichton added this pull request to the merge queue Apr 16, 2026
Merged via the queue into bytecodealliance:main with commit 362f857 Apr 16, 2026
352 of 354 checks passed
@alexcrichton alexcrichton deleted the remove-system-interface branch April 16, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasi Issues pertaining to WASI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants