feat(compiler): add built-in ASC, Go, and Rust language plugins#74
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 compileworks without requiring external plugin installation:AscPlugin: detectsasconfig.jsonorassemblyscriptinpackage.json, runsnpm run build, copies output.wasmGoPlugin: detectsgo.mod/.gofiles, runstinygo build -target wasiRustPlugin: detectsCargo.toml, runscargo build --target wasm32-unknown-unknown+wasm-bindgenAdditional bug fixes driving the CI failures:
detect.rs: ASC detection now checksasconfig.jsonfirst (neitherasc-hellonorweb-aschad the"asc"string the old check required); broadened to matchassemblyscriptinpackage.json; removed plugin-URL strings from Go/Rust tool listsmetadata.rs:infer_plugin_detailsnow recognises"waspy"and"python", returning["py"]extensions so the waspy plugin'scan_handle_projectmatches Python projects correctlyCI workflow changes (
examples.yml):nodejs-express-api(OS-mode example, not a WASM compile target)wasmrun.exeon Windows)GITHUB_PATHso bash subprocesses spawned bymakecan findemccon Windows (fixes c-hello Windows)[ -f *.wasm ]glob check withfind-based count