๐ Use on WASM โ
Use this path if you want to build and run Xila guest applications with WebAssembly.
Requirements โ
- Rust/Cargo
cargo-make(recommended for workspace tasks)wasm32-wasip1Rust target (required)wasm32-unknown-unknownRust target (optional, forwasm_example)nightlytoolchain (optional, forwasm_example)
WASM target setup โ
bash
rustup target add wasm32-wasip1Optional setup for the web example:
bash
rustup target add wasm32-unknown-unknown
rustup toolchain install nightlyExpected success signal:
rustup target list --installedincludeswasm32-wasip1.
Quickstart (command-first) โ
Build a guest executable from Core:
bash
git clone https://github.com/Xila-Project/Core.git
cd Core
cargo build -p calculator --target wasm32-wasip1Expected success signal:
- Build completes and produces a
.wasmartifact undertarget/wasm32-wasip1/....
App development path โ
In your own workspace, add Xila with the wasm feature:
toml
[dependencies]
xila = { git = "https://github.com/Xila-Project/Core.git", features = ["wasm"] }Then build in this order:
- Start with standard Rust WASM APIs (fs/time/process constraints in mind).
- Add Xila modules you need (graphics, networking, etc.).
- Compile early with
--target wasm32-wasip1to catch target-specific issues.
Expected success signal:
- Your app compiles for
wasm32-wasip1without missing target or feature errors.
Troubleshooting โ
target ... not found: rerunrustup target add wasm32-wasip1.can't find crate for std: ensure you are building with--target wasm32-wasip1and target is installed.- Nightly-only errors for web example: install nightly and retry with the expected toolchain.
- Not sure where guest/runtime boundaries are: review architecture maps before splitting crates.
Next steps โ
- For native execution, continue with Use on Host.
- For contribution workflows, go to Contribute.
- Review Executables architecture map and Crates architecture map.
- Review WASM executable architecture, Command line shell architecture, and Graphical shell architecture.
INFO
For more details, refer to the executables/calculator example application.