Skip to content

Test harness for prototyping support for wasi-sockets in Tokio and CPython

Notifications You must be signed in to change notification settings

dicej/wasi-sockets-tests

Repository files navigation

wasi-sockets test harness

This is a test harness for prototyping support for wasi-sockets in tokio and CPython.

Directory structure

Building and running

Prerequisites

  • Unix-style host (e.g. Linux, MacOS, Mingw, WSL2)
  • Python
  • Rust (with the wasm32-wasip2 and wasm32-unknown-unknown targets installed)
    • As of this writing, the wasm32-wasip2 target is only available in Rust nightly

In order to build componentize-py, we need to use a temporary fork of wasi-sdk. In the commands that follow, replace with your host platform's target triple, and replace macos with linux or mingw (Windows) as appropriate. Note that if you're using e.g. Linux/ARM64, you'll need to build the wasi-sockets-alpha-5 branch of https://github.com/dicej/wasi-sdk from source since there are not yet any pre-built distributions for that platform.

curl -LO https://github.com/dicej/wasi-sdk/releases/download/wasi-sockets-alpha-5/wasi-sdk-20.46gf3a1f8991535-macos.tar.gz
tar xf wasi-sdk-20.46gf3a1f8991535-macos.tar.gz
export WASI_SDK_PATH=$(pwd)/wasi-sdk-20.46gf3a1f8991535

Also, as of this writing, the wasm-component-ld binary shipped with Rust nightly for the wasm32-wasip2 target has a bug, so you'll need to upgrade it manually, e.g. cargo install wasm-component-ld --force --version 0.5.10 --root $HOME/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu, adjusting the path according to where the bin directory containing wasm-component-ld is found.

Once the above is complete, you can switch to the server directory in your clone of this repo and run the tests:

cd server
cargo test --release

All tests should pass. If they don't, please open an issue on this repo.

About

Test harness for prototyping support for wasi-sockets in Tokio and CPython

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published