Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ae948a8
feat(wasix): build wasm_tests Rust fixtures with cargo-wasix
Arshia001 Jun 10, 2026
fc05f6d
Potential fix for pull request finding
Arshia001 Jun 10, 2026
24b18eb
Fix style
Arshia001 Jun 10, 2026
815bb7d
Simplify wasm_tests cargo-wasix harness per review feedback.
Arshia001 Jun 11, 2026
aa21788
Merge remote-tracking branch 'origin/main' into feat/wasix-rust-wasm-…
Arshia001 Jun 11, 2026
ca66b23
Style fixes -.-
Arshia001 Jun 11, 2026
c4e49b4
fix compilation error
marxin Jun 11, 2026
f8514fc
Merge remote-tracking branch 'origin/main' into feat/wasix-rust-wasm-…
Arshia001 Jun 11, 2026
f6e793e
Install cargo-wasix in CI + pin rust toolchain tag
Arshia001 Jun 11, 2026
90150a9
test(wasix): drop Singlepass from the wasm_tests harness
Arshia001 Jul 17, 2026
24e4e88
test(wasix): prebuild Rust wasm_tests fixtures once in CI
Arshia001 Jul 17, 2026
ff0e519
ci: drop obsolete wasm32-wasip1 target install from test jobs
Arshia001 Jul 17, 2026
de687a7
Merge branch 'main' into feat/wasix-rust-wasm-tests
Arshia001 Jul 17, 2026
396e1cf
test(wasix): fix fixture edition clash, fmt, and smoke test in build-…
Arshia001 Jul 17, 2026
b313bfe
test(wasix): restore Singlepass via a wasip1 toolchain axis for Rust …
Arshia001 Jul 17, 2026
7572f54
chore: default WASM_TESTS_BUILD_ONLY_DIR in the fixtures make target
Arshia001 Jul 17, 2026
23d2d33
chore: bump WASIX rust toolchain pin, lint wasm_tests Rust fixtures
Arshia001 Jul 17, 2026
509259e
fix(ci): keep wasm_tests .stdin fixtures LF on Windows checkouts
Jul 20, 2026
3f6c917
Merge remote-tracking branch 'origin/main' into feat/wasix-rust-wasm-…
Arshia001 Aug 5, 2026
a2f3fa6
test(wasix): run Rust wasm_tests fixtures only where a toolchain exists
Arshia001 Aug 5, 2026
24e7cc9
chore: bump pinned WASIX rust toolchain to v2026-08-05.1+rust-1.97
Arshia001 Aug 5, 2026
c50b87a
Merge remote-tracking branch 'origin/main' into feat/wasix-rust-wasm-…
Arshia001 Aug 6, 2026
a1d61ae
Merge remote-tracking branch 'origin/main' into feat/wasix-rust-wasm-…
Arshia001 Aug 7, 2026
8dd2332
chore: bump pinned WASIX rust toolchain to v2026-08-06.1+rust-1.97
Arshia001 Aug 7, 2026
d31f4ca
test(wasix): address review on the Rust toolchain axis
Arshia001 Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CHANGELOG.md merge=union
*.wast linguist-vendored
*.wat linguist-vendored
scene*.txt -text
*.stdin -text
2 changes: 2 additions & 0 deletions .github/ci-constants.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Shared CI constants. Loaded into GITHUB_ENV by workflows that need them.
# Pinned wasix-libc sysroot (wasix-org/wasix-libc release tag).
WASIX_LIBC_SYSROOT_TAG=v2026-07-30.1
# Pinned WASIX rust toolchain (wasix-org/rust release tag).
WASIX_RUST_TOOLCHAIN_TAG=v2026-08-06.1+rust-1.97
6 changes: 6 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: WASIXCC_SYSROOT_PREFIX=~/.wasixcc/sysroot-v2026-05-12.1 wasixccenv download-sysroot v2026-05-12.1
- name: Install cargo-wasix
uses: wasix-org/cargo-wasix@main
with:
toolchain-version: ${{ env.WASIX_RUST_TOOLCHAIN_TAG }}
- name: Install wasm-tools
run: |
cargo install --locked wasm-tools
Expand All @@ -95,6 +99,8 @@ jobs:
wasm-tools --version
# Check wasixcc is installed
wasixcc --version
# Check cargo-wasix is installed
cargo wasix --version
# Check wasm-opt is available
wasm-opt --version
# Check that the repo exists
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ jobs:
echo "Pinned sysroot ($WASIX_LIBC_SYSROOT_TAG) is older than latest release ($latest)"
exit 1
fi
- name: Verify pinned wasix rust toolchain is up to date
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source .github/ci-constants.env
latest=$(gh release list --exclude-pre-releases --order desc -R wasix-org/rust --json tagName -q '.[0].tagName')
newest=$(printf '%s\n' "$latest" "$WASIX_RUST_TOOLCHAIN_TAG" | sort -V | tail -1)
if [ "$WASIX_RUST_TOOLCHAIN_TAG" != "$newest" ]; then
echo "Pinned rust toolchain ($WASIX_RUST_TOOLCHAIN_TAG) is older than latest release ($latest)"
exit 1
fi
cargo_deny:
name: cargo-deny
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -596,20 +608,26 @@ jobs:
- description: "CLI integ. tests"
make: test-integration-cli-ci
metadata:
# `wasix_rust_toolchain` marks the hosts wasix-org/rust publishes a
# toolchain for, i.e. the ones that collect the Rust wasm_tests
# fixtures (see lib/wasix/tests/wasm_tests/README.md).
- build: linux-x64
os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
exe: ""
wasix_rust_toolchain: true
llvm_url: "https://github.com/wasmerio/llvm-custom-builds/releases/download/22.x/llvm-linux-amd64.tar.xz"
- build: linux-arm64
os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
exe: ""
wasix_rust_toolchain: true
llvm_url: "https://github.com/wasmerio/llvm-custom-builds/releases/download/22.x/llvm-linux-aarch64.tar.xz"
- build: macos-arm
os: depot-macos-14
target: aarch64-apple-darwin
exe: ""
wasix_rust_toolchain: true
llvm_url: "https://github.com/wasmerio/llvm-custom-builds/releases/download/22.x/llvm-darwin-aarch64.tar.xz"
- build: windows-x64
os: windows-2022
Expand Down Expand Up @@ -696,6 +714,8 @@ jobs:
with:
toolchain: ${{ steps.load_toolchain.outputs.rust_toolchain }}
target: ${{ matrix.metadata.target }}
# For the wasip1-toolchain variants of the Rust wasm_tests fixtures, which
# build on every platform we support.
- name: Install Rust WASI targets
if: matrix.stage.make == 'test-all'
shell: bash
Expand All @@ -716,6 +736,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: WASIXCC_SYSROOT_PREFIX=~/.wasixcc/sysroot-v2026-05-12.1 wasixccenv download-sysroot v2026-05-12.1
if: matrix.metadata.build != 'windows-x64'
# For the wasix-toolchain variants of the Rust wasm_tests fixtures.
- name: Install cargo-wasix
if: matrix.stage.make == 'test-all' && matrix.metadata.wasix_rust_toolchain
uses: wasix-org/cargo-wasix@main
with:
toolchain-version: ${{ env.WASIX_RUST_TOOLCHAIN_TAG }}
- name: Install LLVM
shell: bash
if: matrix.metadata.llvm_url
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,9 @@ lint-package-crate:
lint-formatting:
cargo fmt --all -- --check
cargo fmt --manifest-path fuzz/Cargo.toml -- --check
# The wasm_tests Rust fixtures are not part of any crate, so `cargo fmt`
# does not cover them.
cd lib/wasix/tests/wasm_tests && find . -path ./build -prune -o -type f -name '*.rs' -exec rustfmt --edition 2024 --check {} +
Comment thread
Arshia001 marked this conversation as resolved.

lint: lint-yamlfmt lint-clang-format lint-formatting lint-packages lint-taplo

Expand Down
36 changes: 33 additions & 3 deletions lib/wasix/tests/wasm_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ The `wasix-wasm` integration test target discovers tests automatically from this
directory. Any subdirectory that contains one of these primary files is treated
as a test fixture:

- `build.sh` or other `*.sh` primary sources
- `Cargo.toml`
- `main.c`
- `main.cpp`
- `$name.sh`
- `*.rs`

Discovery precedence within a fixture directory is:

1. `*.sh` shell primary sources
2. `Cargo.toml` (full Cargo project)
3. `main.c` / `main.cpp`
4. `*.rs` (each Rust source is an independent test)

The harness builds each discovered fixture, runs the resulting `main` module through the WASIX runner,
and registers one test per configuration each of the enabled engines.
Expand All @@ -24,6 +33,9 @@ The supported directives are documented in [`../wasm_tests.rs`](../wasm_tests.rs
If a fixture has more than one `.sh` file, each shell file is treated as a
primary source, where `build.sh` is the default shell source name.

Fixtures with an explicit `Cargo.toml` are built as full Cargo projects. Directives
can be placed in `##Directive: Args` comments in the manifest.

The former `tests/wasi-fyi` shell suite now lives in [`wasi_fyi/`](./wasi_fyi/)
as Rust primary sources with inline directives.

Expand All @@ -34,7 +46,10 @@ The harness then builds them as follows:

- `main.c` is compiled with `CC`, or `wasixcc` if `CC` is unset.
- `main.cpp` is compiled with `CXX`, or `wasix++` if `CXX` is unset.
- `*.rs` is compiled with `rustc --target=wasm32-wasip1`.
- `*.rs` is built with `cargo wasix build` using an ephemeral `Cargo.toml` generated
in the build directory.
- `Cargo.toml` fixtures are built with `cargo wasix build` and the single binary
artifact is copied to `main`.
- `build.sh` and other shell primary sources are executed with `bash`; the
harness sets `CC=wasixcc`, `CXX=wasix++`, and
`WASIXCC_DISCARD_UNSUPPORTED_FLAGS=yes`.
Expand All @@ -50,7 +65,22 @@ the primary source, for example `//#BuildEnv: WASIXCC_PIC=1` in C/C++ sources or
These tests run through the normal `wasix` integration test target, so standard
Cargo and nextest filtering both work. Before running the suite, make sure
`wasixcc` is installed and available in your shell environment.
Rust `.rs` tests also require `rustc` with the `wasm32-wasip1` target installed.
Rust fixtures also require `cargo-wasix` on `PATH` (`cargo install cargo-wasix`).

Single-file Rust fixtures build with two Rust toolchains by default (see the
`Toolchains` directive): `wasix` (cargo-wasix), which runs on every engine
except Singlepass — the WASIX toolchain emits exception-handling opcodes
Singlepass does not support — and `wasip1` (`rustc --target wasm32-wasip1`,
nightly when the source uses `#![feature(...)]`), which runs on every engine.
The wasip1 variants need `rustup target add wasm32-wasip1` (plus the same
target on nightly).

We do not publish the WASIX Rust toolchain for every platform yet, so the
`wasix` variants are only collected on hosts that have one: gnu Linux on x86_64
and aarch64, and macOS on aarch64. They are skipped on musl, which has no
toolchain, and on Windows, which `wasixcc` does not cover either. The `wasip1`
variants build everywhere, so single-file Rust fixtures keep running on those
hosts.

On macOS, this suite collects and runs the LLVM variants only because Cranelift
exception-handling support is still incomplete there:
Loading
Loading