Skip to content

Commit

Permalink
Convert to resources. (#24)
Browse files Browse the repository at this point in the history
* Convert to resources.

Convert terminal-input and terminal-output to resources, and update the
dependencies to account for:
 - WebAssembly/wasi-io#46
 - WebAssembly/wasi-clocks#50
 - WebAssembly/wasi-filesystem#132
 - WebAssembly/wasi-random#34
 - WebAssembly/wasi-sockets#61

* Update to the latest filesystem/types.wit.

* Update to wit-abi-up-to-date@v15 and wit-deps 0.3.3.

* Update to the latest main branches of the upstream repos.

* Update to the latest dependencies.
  • Loading branch information
sunfishcode committed Sep 29, 2023
1 parent 4fe2acb commit f3a4209
Show file tree
Hide file tree
Showing 23 changed files with 2,531 additions and 2,731 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ 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
curl -Lo 'wit-deps' https://github.com/bytecodealliance/wit-deps/releases/download/v0.3.3/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@v14
- uses: WebAssembly/wit-abi-up-to-date@v15
with:
worlds: "command reactor"
1,339 changes: 636 additions & 703 deletions command.md

Large diffs are not rendered by default.

1,339 changes: 636 additions & 703 deletions reactor.md

Large diffs are not rendered by default.

25 changes: 10 additions & 15 deletions wit/deps.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
[clocks]
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
sha256 = "1ed7e35b3f9738663854f0dd92a95bfadc410ea07170501f5c2fec0cc24e3d57"
sha512 = "ef1e23704a8a8436fd3718593d4c4d8b6d1c64dad3595b7496c0888ca14b725046f2900109800faca1bc8c14f237cdcaca791dba8284e1ad50105ab2d036825b"
sha256 = "ea955af7a152f85941b651c5b07345c4f077ae7f9e996c909ab8cc0a68c0120e"
sha512 = "114bc4f583a487cf1ccfdd6efa25c4c60cf637d4501a189eebd4b1d52aec2c8eb63ae14ce494db53dfd25bc20f6c4b533dc6f2143537e5cd14ca80d5d4b6a49d"

[filesystem]
url = "https://github.com/WebAssembly/wasi-filesystem/archive/main.tar.gz"
sha256 = "dc170645d8aa52f2f94ab8f71093fa0c101e509ed1a07318995dc0395e9d6cf2"
sha512 = "3195a3e0f9ec52c3a91c4b4fde0547694236c7b29bceecb7f38634894fafd809c69ed1c1c9acbf225b2d5d00f5036d70371c9fed121d85028162b202035cabef"
sha256 = "f8602f2929fe149b0e2e904fe53b98e3a0ba0a42089253c9a738caf9ccb06c1d"
sha512 = "53f3d7c494ea6ad0687f91994f3af8c5f55bdddeb14cc47b30ff263cdb1ee6c7893ad425d1dc75a8da72d9bb5f82a46fcd566e0c2463fda102a22529e2d83f19"

[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
sha256 = "6e18239b0e20d1a3e6343cb961ebfd2c663ba7feb4c1aa3744b756fbdd1fb5b8"
sha512 = "53169b6e4fba0b2cf5fcf808f76e7fbb7cabb6ed66ab53f77d0966e7448312ccbe8571880ef4fc2ee86fbd6ba19bc48d46e10d22dcac6c51d217e8d7127c32db"

[poll]
url = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
sha256 = "d4c27124f4c137eb538b5c92ba5858ed9042e11b24a2eef85d14becd0b7f55de"
sha512 = "422c01b273b4b1377ece6f2e4ba0dfc609ca8ef30a3e0be0e172e1303fcf7b3ca4c470f4dea6c51bdf114b0f5c871ebc4934dfe3bf217d66ea689748df2b1e55"
sha256 = "6e20bcf4d4f5466b60c05ea8da7289ca361a7febdd22ab1a531e5ef7e394ab8d"
sha512 = "21f6689bce6ed6d9e3bd96372e5c7ed003a7aefbf8d49b4eea949dfbd265cf57a0d7dc67aa71e3de75d48fcc2c0cfe5f06f7e9e7959a23bc98f77da85f4161b9"

[random]
url = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
sha256 = "9b622463e597b9ca94f41e4eaae589a77be38f71b4723142b60246ffed8eaae4"
sha512 = "21f03ca1e595b80d7ced522de1a47446526b49b900e2fb26fcbf410ce6aa267dbf247aebf3fbfa8123b46fc1a828e2fd64fb1e0198b40161a3257e8d86fd4546"
sha256 = "2f718c9909fcc95dc8d7f9fc3a17a30d7da715eaa9fa70af3c89f0f9439abc8a"
sha512 = "7580d79d0f01d4fb65ff85f76d52d420fdbc7406959a34c2b1cad4398dc34d2610f8b6b4e22bcea9db2f3d70242d356e961d843bfc4d2c4956c4f5e5ca3811f9"

[sockets]
url = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
sha256 = "871c211b12d87a5da87c42353338b652260840897efcd37e2afba3b9290058fc"
sha512 = "e436a5ff3145ca85d702a086499c03488523483dd3addc8d71e4946e9c186355291551bb6d38b157173836fcc318182403e6dba970de4512f6cfb3374ccad6b9"
sha256 = "85b872b5af12d3010c20a5f4bf6d334a09c1a42ef7f7703c2949c0598ed8ebee"
sha512 = "238bbeea140eba0774cf5ce5abfdc93f03617a2fc30b497e104cc6a23fdf7bd496c61d3c962ca6718255ea5c96a9277bddae1fc4a6b6f7544de2be2649752eac"
5 changes: 2 additions & 3 deletions wit/deps.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
io = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
poll = "https://github.com/WebAssembly/wasi-poll/archive/main.tar.gz"
random = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
clocks = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
random = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
filesystem = "https://github.com/WebAssembly/wasi-filesystem/archive/main.tar.gz"
sockets = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
sockets = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
2 changes: 1 addition & 1 deletion wit/deps/clocks/monotonic-clock.wit
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
///
/// It is intended for measuring elapsed time.
interface monotonic-clock {
use wasi:poll/poll.{pollable}
use wasi:io/poll.{pollable}

/// A timestamp in nanoseconds.
type instant = u64
Expand Down
17 changes: 2 additions & 15 deletions wit/deps/clocks/timezone.wit
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
interface timezone {
use wall-clock.{datetime}

/// A timezone.
///
/// In timezones that recognize daylight saving time, also known as daylight
/// time and summer time, the information returned from the functions varies
/// over time to reflect these adjustments.
///
/// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources).
type timezone = u32

/// Return information needed to display the given `datetime`. This includes
/// the UTC offset, the time zone name, and a flag indicating whether
/// daylight saving time is active.
///
/// If the timezone cannot be determined for the given `datetime`, return a
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
/// saving time.
display: func(this: timezone, when: datetime) -> timezone-display
display: func(when: datetime) -> timezone-display

/// The same as `display`, but only return the UTC offset.
utc-offset: func(this: timezone, when: datetime) -> s32

/// Dispose of the specified input-stream, after which it may no longer
/// be used.
drop-timezone: func(this: timezone)
utc-offset: func(when: datetime) -> s32

/// Information useful for displaying the timezone of a specific `datetime`.
///
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wasi:clocks

world example-world {
world imports {
import monotonic-clock
import wall-clock
import timezone
Expand Down
Loading

0 comments on commit f3a4209

Please sign in to comment.