Repository navigation
feat(runtime): build perry-runtime for wasm32-wasip2 (WASI phase 2a) #11390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: WASI Check | ||
|
|
||
| # Keeps `perry-runtime` building for the standalone WASI target | ||
| # (wasm32-wasip2). Tracking issue #11375; this gate is phase 2a (#11377). | ||
| # The check itself is `scripts/wasi_check.sh` — run it locally the same way. | ||
| # | ||
| # Checked against CLAUDE.md's "four ways a gate can be unable to fail": | ||
| # | ||
| # 1. no `continue-on-error`, no `|| true`: the script runs under | ||
| # `set -euo pipefail`, so a cargo failure is the job's failure. | ||
| # 2. NOT a required context, and not part of test.yml's `pr-gate` or | ||
| # `full-suite-gate`, by design of the change that adds it: a new gate has | ||
| # never been green, and WASI must not block unrelated PRs or releases | ||
| # while the target is being brought up. Promotion is a maintainer action | ||
| # after it has been green on `main`. | ||
| # 3. `concurrency` below cancels `pull_request` runs only; main-line runs are | ||
| # keyed on `github.run_id` (#7966) so they queue instead of superseding. | ||
| # 4. The subject is asserted live: the script fails unless cargo reports a | ||
| # perry-runtime artifact under the wasm32-wasip2 target directory, so a | ||
| # green run cannot be a host build or a silently skipped check. | ||
|
|
||
| on: | ||
| pull_request: | ||
| # Opt-in via the `run-extended-tests` label, like the other satellite | ||
| # gates (docs/src/testing/ci-tiers.md), and only when something that can | ||
| # break the WASI build changed. | ||
| types: [opened, synchronize, reopened, labeled] | ||
| paths: | ||
| - "crates/perry-runtime/**" | ||
| - "crates/perry-dispatch/**" | ||
| - "Cargo.lock" | ||
| - "rust-toolchain.toml" | ||
| - "scripts/wasi_check.sh" | ||
| - ".github/workflows/wasi-check.yml" | ||
| # Main-line arm: one daily sweep, not one run per merge — see | ||
| # docs/src/testing/ci-gate-scheduling.md before adding `push: branches: [main]`. | ||
| schedule: | ||
| - cron: "41 2 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: wasi-check-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| wasi-check: | ||
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-extended-tests') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Rust toolchain with the WASI target | ||
| run: rustup toolchain install nightly-2026-08-20 --profile minimal --target wasm32-wasip2 | ||
|
|
||
| - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 | ||
| with: | ||
| shared-key: "${{ runner.os }}-wasi-check" | ||
| save-if: ${{ github.ref == 'refs/heads/main' }} | ||
|
|
||
| - name: perry-runtime builds for wasm32-wasip2 | ||
| run: ./scripts/wasi_check.sh | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| `perry-runtime` builds for the standalone WASI target, `wasm32-wasip2` (phase | ||
| 2a of #11375, #11377). Every platform-specific path has a WASI branch, and on | ||
| every other target the code is unchanged. On WASI: | ||
|
|
||
| - `child_process` fails through its ordinary spawn-error path (WASI has no | ||
| process spawning). | ||
| - Local time is UTC. | ||
| - `os.hostname()` is `"localhost"`. | ||
| - Native plugins fail to load with a clear message. | ||
| - `fs.symlink` uses WASI's own call. | ||
| - `parallelMap`/`parallelFilter` run sequentially. | ||
| - `perry/thread` `spawn()` rejects with "not supported on WASI yet". | ||
|
|
||
| Timers ride the existing wasm32 park, which on single-threaded WASI is a timed | ||
| sleep. The exception trampoline `perry_sjlj.c` is not built for WASI until the | ||
| wasm EH link lands (#11378/#11379). `scripts/wasi_check.sh` checks the core | ||
| runtime and every default feature except the named WASI exclusions: | ||
|
|
||
| - `bun-cli-utils`: zstd needs wasi-sdk; | ||
| - `mod-dgram`: turnloop; | ||
| - `alloc-mimalloc`: 64-bit only. | ||
|
|
||
| The new `wasi-check` workflow runs it daily and on labelled PRs; it is | ||
| intentionally not a required context yet. |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.