Documentation
Language Guide
Rust
Usage

Rust Wasix Usage

📦

Currenly, Wasix is only supported by the Wasmer runtime. So, you need to install the Wasmer (opens in a new tab) runtime.

cargo wasix

cargo wasix can be used to run, test, and build Rust programs for the Wasix

Running a binary

$ cargo wasix run <path-to-wasm-file>

Testing a binary

$ cargo wasix test <path-to-wasm-file>

Building a binary

$ cargo wasix build <path-to-wasm-file>

Benchmarking a binary

$ cargo wasix bench <path-to-wasm-file>

wasmer

wasmer-cli can also be used to run wasix binaries. As well as provide additional flags such as --enable-bulk-memory, --enable-threads and --net.

Additional flags

ℹ️

Some wasm files need extra flags that can be provided while running the file with the runtime. For example, wasmer run --enable-threads --net ./target/wasix/debug/hello.wasm. Learn more about Wasmer's runtime flags (opens in a new tab)

Patched Repos

📦

Some crates require patches to work. We have assembled a list of patched repos here