Skip to content

Add poll_oneoff ABI types to WASI.swift #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MaxDesiatov
Copy link
Collaborator

@MaxDesiatov MaxDesiatov commented Jun 18, 2025

Testing Swift Concurrency for WebAssembly requires presence of poll_oneoff, which is absent in WasmKit. This change provides a stub according to the ABI specified in WebAssembly System Interface standard https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#poll_oneoff

The stub has no concrete implementation, but provides placeholders that map to clock and file descriptor value that can be polled as specified in the standard.

rdar://149935761

The change declares a clock subscription type in according with the WebAssembly System Interface standard ABI, which is required for testing clocks and timers in Embedded Swift for WebAssembly.

The ABI for this type is specified publicly in corresponding ABI documentation: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#subscription_clock

rdar://149935761
Testing Swift Concurrency with WebAssembly System Interface requires a missing `subscription` record per the corresponding standard specification: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-subscription-record

This change adds a subscription union type, with the ABI described in this standard document.
To test Swift Concurrency with WebAssembly System Interface, an Event API is missing from WasmKit runtime, as specified in the standard specification https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-event-record

This change adds Event with the ABI as prescribed in the standard, allowing Swift Concurrency tests to utilize timer events.
Testing Swift Concurrency for WebAssembly requires presence of `epoll_oneoff`, which is absent in WasmKit. This change provides a stub according to the ABI specified in WebAssembly System Interface standard https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#poll_oneoff

The stub has no concrete implementation, but provides placeholders that map to clock and file descriptor value that can be polled as specified in the standard.
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