Skip to content

feat(compiler): add built-in ASC, Go, and Rust language plugins#74

Merged
anistark merged 3 commits into
mainfrom
fix/examples
May 20, 2026
Merged

feat(compiler): add built-in ASC, Go, and Rust language plugins#74
anistark merged 3 commits into
mainfrom
fix/examples

Conversation

@anistark
Copy link
Copy Markdown
Owner

The Examples CI workflow was failing on 13 of 14 jobs due to several compounding issues. This commit addresses them all.

New built-in language plugins so wasmrun compile works without requiring external plugin installation:

  • AscPlugin: detects asconfig.json or assemblyscript in package.json, runs npm run build, copies output .wasm
  • GoPlugin: detects go.mod/.go files, runs tinygo build -target wasi
  • RustPlugin: detects Cargo.toml, runs cargo build --target wasm32-unknown-unknown + wasm-bindgen

Additional bug fixes driving the CI failures:

  • detect.rs: ASC detection now checks asconfig.json first (neither asc-hello nor web-asc had the "asc" string the old check required); broadened to match assemblyscript in package.json; removed plugin-URL strings from Go/Rust tool lists
  • metadata.rs: infer_plugin_details now recognises "waspy" and "python", returning ["py"] extensions so the waspy plugin's can_handle_project matches Python projects correctly

CI workflow changes (examples.yml):

  • Remove nodejs-express-api (OS-mode example, not a WASM compile target)
  • Add TinyGo install steps (Linux tarball, Windows zip) for go-hello
  • Split waspy plugin install into OS-specific steps using the correct binary name (wasmrun.exe on Windows)
  • Add emscripten dir to GITHUB_PATH so bash subprocesses spawned by make can find emcc on Windows (fixes c-hello Windows)
  • Replace [ -f *.wasm ] glob check with find-based count
  • Increase compile timeout to 120s/5min for Rust builds

anistark added 3 commits May 20, 2026 11:59
The Examples CI workflow was failing on 13 of 14 jobs due to several
compounding issues. This commit addresses them all.

New built-in language plugins so `wasmrun compile` works without
requiring external plugin installation:

- `AscPlugin`: detects `asconfig.json` or `assemblyscript` in
  `package.json`, runs `npm run build`, copies output `.wasm`
- `GoPlugin`: detects `go.mod`/`.go` files, runs
  `tinygo build -target wasi`
- `RustPlugin`: detects `Cargo.toml`, runs `cargo build
  --target wasm32-unknown-unknown` + `wasm-bindgen`

Additional bug fixes driving the CI failures:

- `detect.rs`: ASC detection now checks `asconfig.json` first
  (neither `asc-hello` nor `web-asc` had the `"asc"` string the old
  check required); broadened to match `assemblyscript` in
  `package.json`; removed plugin-URL strings from Go/Rust tool lists
- `metadata.rs`: `infer_plugin_details` now recognises `"waspy"` and
  `"python"`, returning `["py"]` extensions so the waspy plugin's
  `can_handle_project` matches Python projects correctly

CI workflow changes (`examples.yml`):
- Remove `nodejs-express-api` (OS-mode example, not a WASM compile
  target)
- Add TinyGo install steps (Linux tarball, Windows zip) for go-hello
- Split waspy plugin install into OS-specific steps using the correct
  binary name (`wasmrun.exe` on Windows)
- Add emscripten dir to `GITHUB_PATH` so bash subprocesses spawned by
  `make` can find `emcc` on Windows (fixes c-hello Windows)
- Replace `[ -f *.wasm ]` glob check with `find`-based count
- Increase compile timeout to 120s/5min for Rust builds
@anistark anistark merged commit a56af46 into main May 20, 2026
2 checks passed
@anistark anistark deleted the fix/examples branch May 20, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant