Skip to content

Commit

Permalink
Update to resources.
Browse files Browse the repository at this point in the history
Convert `tcp-socket`, `udp-socket`, `network`, and `resolve-address-stream`
to resources.

This also updates the dependencies to account for the changes in
WebAssembly/wasi-io#46.
  • Loading branch information
sunfishcode committed Sep 13, 2023
1 parent 2534b91 commit 68a519b
Show file tree
Hide file tree
Showing 14 changed files with 1,273 additions and 1,211 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ jobs:
name: Check ABI files are up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: ensure `./wit/deps` are in sync
run: |
curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.0/wit-deps-x86_64-unknown-linux-musl
chmod +x wit-deps
./wit-deps lock
git add -N wit/deps
git diff --exit-code
- uses: WebAssembly/wit-abi-up-to-date@v13
with:
wit-abi-tag: wit-abi-0.11.0
- uses: WebAssembly/wit-abi-up-to-date@v14
993 changes: 514 additions & 479 deletions example-world.md → imports.md

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions wit/deps.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
sha256 = "eeb4701c2becafa40a7ee3bf0d2c94e2170e15806b25abdcd1de1ed94f2c1036"
sha512 = "89be853b2acae211570cd6ad0ec9d8132881dafbdea83ac7b4cad600f0627003c61f310427379bf47ecf862724367bd5d6e976db70069f6f90a3c2d9c20dbfb7"

[poll]
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
sha256 = "9f8bb4d9994e9b0684859bb1e8bee2a8b873e04d40695f260446760fc44d0c58"
sha512 = "aa8da395ba6e189ec113296996da5abf28bdc4460e4eb2aacc786698ced892e08f7054fb590fc8809c05554d5c83a11494d4ab68c755746f57d151e212415cfb"
url = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz"
sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d"
sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9"
5 changes: 3 additions & 2 deletions wit/deps.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
# Temporarily use the resources branches.
#io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
io = "https://github.com/sunfishcode/wasi-io/archive/resources.tar.gz"
34 changes: 34 additions & 0 deletions wit/deps/io/poll.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package wasi:io

/// A poll API intended to let users wait for I/O events on multiple handles
/// at once.
interface poll {
/// A "pollable" handle.
resource pollable

/// Poll for completion on a set of pollables.
///
/// This function takes a list of pollables, which identify I/O sources of
/// interest, and waits until one or more of the events is ready for I/O.
///
/// The result `list<u32>` contains one or more indices of handles in the
/// argument list that is ready for I/O.
///
/// If the list contains more elements than can be indexed with a `u32`
/// value, this function traps.
///
/// A timeout can be implemented by adding a pollable from the
/// wasi-clocks API to the list.
///
/// This function does not return a `result`; polling in itself does not
/// do any I/O so it doesn't fail. If any of the I/O sources identified by
/// the pollables has an error, it is indicated by marking the source as
/// being reaedy for I/O.
poll-list: func(in: list<borrow<pollable>>) -> list<u32>

/// Poll for completion on a single pollable.
///
/// This function is similar to `poll-list`, but operates on only a single
/// pollable. When it returns, the handle is ready for I/O.
poll-one: func(in: borrow<pollable>)
}
Loading

0 comments on commit 68a519b

Please sign in to comment.