-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump WASI version to 0.2.1 * Bump wasi-rs version to 0.13.2+wasi-0.2.1
- Loading branch information
Showing
41 changed files
with
4,354 additions
and
4,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,12 @@ jobs: | |
- name: Install Wasmtime | ||
uses: bytecodealliance/actions/wasmtime/setup@v1 | ||
with: | ||
version: "v19.0.0" | ||
version: "v23.0.1" | ||
- name: Install wasm-tools | ||
uses: bytecodealliance/actions/wasm-tools/setup@v1 | ||
with: | ||
version: "1.202.0" | ||
- run: curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.0/wasi_snapshot_preview1.command.wasm | ||
version: "1.215.0" | ||
- run: curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v23.0.1/wasi_snapshot_preview1.command.wasm | ||
|
||
- run: cargo build --examples --target wasm32-wasip1 --no-default-features | ||
|
||
|
@@ -59,22 +59,19 @@ jobs: | |
- run: wasm-tools component new ./target/wasm32-wasip1/debug/examples/rand.wasm --adapt ./wasi_snapshot_preview1.command.wasm -o component.wasm | ||
- run: wasmtime run component.wasm | ||
|
||
rustfmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: rustup update stable && rustup default stable && rustup component add rustfmt | ||
- run: cargo fmt -- --check | ||
|
||
generate: | ||
name: Ensure generated code up-to-date | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: rustup update stable && rustup default stable | ||
- run: cargo install [email protected] --locked | ||
# Re-vendor all WIT files and ensure that they're all up-to-date by ensuring | ||
# that there's no git changes. | ||
- name: Re-vendor WIT | ||
run: | | ||
./ci/vendor-wit.sh | ||
git diff --exit-code | ||
- run: cargo install [email protected] --locked | ||
- run: ./ci/regenerate.sh | ||
- run: git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,45 +5,46 @@ set -ex | |
generate() { | ||
file="$1" | ||
shift | ||
wit-bindgen rust wit --out-dir src --std-feature "$@" --rustfmt \ | ||
wit-bindgen rust wit --out-dir src --std-feature "$@" --format \ | ||
--runtime-path wit_bindgen_rt | ||
} | ||
|
||
# Generate the main body of the bindings which includes all imports from the two | ||
# worlds below. | ||
generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io | ||
generate src/bindings.rs --type-section-suffix rust-wasi-from-crates-io \ | ||
--generate-all | ||
|
||
# Generate bindings for the `wasi:cli/command` world specifically, namely the | ||
# macro `export_command`. | ||
# | ||
# Note that `--with` is used to point at the previously generated bindings. | ||
with="wasi:cli/[email protected].0=crate::cli::environment" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::exit" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::stdin" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::stdout" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::stderr" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::terminal_input" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::terminal_output" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::terminal_stdin" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::terminal_stdout" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::terminal_stderr" | ||
with="$with,wasi:clocks/[email protected].0=crate::clocks::monotonic_clock" | ||
with="$with,wasi:clocks/[email protected].0=crate::clocks::wall_clock" | ||
with="$with,wasi:filesystem/[email protected].0=crate::filesystem::types" | ||
with="$with,wasi:filesystem/[email protected].0=crate::filesystem::preopens" | ||
with="$with,wasi:io/[email protected].0=crate::io::error" | ||
with="$with,wasi:io/[email protected].0=crate::io::poll" | ||
with="$with,wasi:io/[email protected].0=crate::io::streams" | ||
with="$with,wasi:random/[email protected].0=crate::random::random" | ||
with="$with,wasi:random/[email protected].0=crate::random::insecure" | ||
with="$with,wasi:random/[email protected].0=crate::random::insecure_seed" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::network" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::instance_network" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::tcp" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::tcp_create_socket" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::udp" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::udp_create_socket" | ||
with="$with,wasi:sockets/[email protected].0=crate::sockets::ip_name_lookup" | ||
with="wasi:cli/[email protected].1=crate::cli::environment" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::exit" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::stdin" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::stdout" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::stderr" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::terminal_input" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::terminal_output" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::terminal_stdin" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::terminal_stdout" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::terminal_stderr" | ||
with="$with,wasi:clocks/[email protected].1=crate::clocks::monotonic_clock" | ||
with="$with,wasi:clocks/[email protected].1=crate::clocks::wall_clock" | ||
with="$with,wasi:filesystem/[email protected].1=crate::filesystem::types" | ||
with="$with,wasi:filesystem/[email protected].1=crate::filesystem::preopens" | ||
with="$with,wasi:io/[email protected].1=crate::io::error" | ||
with="$with,wasi:io/[email protected].1=crate::io::poll" | ||
with="$with,wasi:io/[email protected].1=crate::io::streams" | ||
with="$with,wasi:random/[email protected].1=crate::random::random" | ||
with="$with,wasi:random/[email protected].1=crate::random::insecure" | ||
with="$with,wasi:random/[email protected].1=crate::random::insecure_seed" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::network" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::instance_network" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::tcp" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::tcp_create_socket" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::udp" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::udp_create_socket" | ||
with="$with,wasi:sockets/[email protected].1=crate::sockets::ip_name_lookup" | ||
generate src/command.rs \ | ||
--world wasi:cli/command \ | ||
--with "$with" \ | ||
|
@@ -53,17 +54,17 @@ generate src/command.rs \ | |
--export-macro-name _export_command | ||
|
||
# Same as the `command` world, but for the proxy world. | ||
with="wasi:cli/[email protected].0=crate::cli::stdin" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::stdout" | ||
with="$with,wasi:cli/[email protected].0=crate::cli::stderr" | ||
with="$with,wasi:clocks/[email protected].0=crate::clocks::monotonic_clock" | ||
with="$with,wasi:clocks/[email protected].0=crate::clocks::wall_clock" | ||
with="$with,wasi:io/[email protected].0=crate::io::error" | ||
with="$with,wasi:io/[email protected].0=crate::io::poll" | ||
with="$with,wasi:io/[email protected].0=crate::io::streams" | ||
with="$with,wasi:random/[email protected].0=crate::random::random" | ||
with="$with,wasi:http/[email protected].0=crate::http::types" | ||
with="$with,wasi:http/[email protected].0=crate::http::outgoing_handler" | ||
with="wasi:cli/[email protected].1=crate::cli::stdin" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::stdout" | ||
with="$with,wasi:cli/[email protected].1=crate::cli::stderr" | ||
with="$with,wasi:clocks/[email protected].1=crate::clocks::monotonic_clock" | ||
with="$with,wasi:clocks/[email protected].1=crate::clocks::wall_clock" | ||
with="$with,wasi:io/[email protected].1=crate::io::error" | ||
with="$with,wasi:io/[email protected].1=crate::io::poll" | ||
with="$with,wasi:io/[email protected].1=crate::io::streams" | ||
with="$with,wasi:random/[email protected].1=crate::random::random" | ||
with="$with,wasi:http/[email protected].1=crate::http::types" | ||
with="$with,wasi:http/[email protected].1=crate::http::outgoing_handler" | ||
generate src/proxy.rs \ | ||
--world wasi:http/proxy \ | ||
--with "$with" \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Script to re-vendor the WIT files that wasi-rs uses as defined by a | ||
# particular tag in upstream repositories. | ||
# | ||
# This script is executed on CI to ensure that everything is up-to-date. | ||
set -ex | ||
|
||
# Space-separated list of wasi proposals that are vendored here along with the | ||
# tag that they're all vendored at. | ||
# | ||
# This assumes that the repositories all have the pattern: | ||
# https://github.com/WebAssembly/wasi-$repo | ||
# and every repository has a tag `v$tag` here. That is currently done as part | ||
# of the WASI release process. | ||
repos="cli clocks filesystem http io random sockets" | ||
tag=0.2.1 | ||
dst=wit/deps | ||
|
||
rm -rf $dst | ||
mkdir -p $dst | ||
|
||
for repo in $repos; do | ||
mkdir $dst/$repo | ||
curl -L https://github.com/WebAssembly/wasi-$repo/archive/refs/tags/v$tag.tar.gz | \ | ||
tar xzf - --strip-components=2 -C $dst/$repo wasi-$repo-$tag/wit | ||
rm -rf $dst/$repo/deps* | ||
done |
Oops, something went wrong.