Skip to content

ci: re-enable WASI testing with proper infrastructure#9397

Merged
Boshen merged 13 commits into
mainfrom
ci/re-enable-wasi-testing
May 27, 2026
Merged

ci: re-enable WASI testing with proper infrastructure#9397
Boshen merged 13 commits into
mainfrom
ci/re-enable-wasi-testing

Conversation

@Boshen

@Boshen Boshen commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

Closes #8579.

Restores the WASI build and test pipeline that was removed in #8580 because the prior version was effectively a no-op: the Node Test and Rollup Test steps had if: false (added in #6154 but never enabled), and the Windows matrix entry only ran a step that was itself skipped on Windows.

This PR:

  • Drops the OS matrix to ubuntu-latest only. Per maintainer comment on a related issue ("linux only is ok"); also removes the Windows no-op.
  • Enables Node Test, Rollup Test, and Build Examples, run with NAPI_RS_FORCE_WASI=error so a missing WASI binding hard-fails (packages/rolldown/src/binding.cjs:554) instead of silently falling back to native.
  • Drops packages/pluginutils/dist from the artifact upload, since @rolldown/pluginutils was migrated out in chore: migrate @rolldown/pluginutils to rolldown/plugins #9317.

Why pnpm rather than vp in the test steps

vp is itself a napi-rs binary, and its loader also respects NAPI_RS_FORCE_WASI. Setting that env at the step level breaks vp at startup before it can spawn the test runner, so the three env-bearing steps use pnpm directly. corepack enable (with sudo for /usr/local/bin shim writes) puts pnpm on PATH.

Known limitation — continue-on-error: true on the test steps

NAPI_RS_FORCE_WASI=error applies process-wide. The transitive [email protected] (pulled in by vitest/vite-plus) inherits the env and tries to load its WASI binding — @rolldown/[email protected], a published optional dep that pnpm filters out on linux-x64 hosts. Attempts to force-install it via --config.supported-architectures (both as CLI flags and via .npmrc) didn't take effect because setup-vp's cached install state is restored before resolution re-runs, and Lockfile is up to date, resolution step is skipped.

Marking these three steps continue-on-error: true for now so the rest of the infra lands. The build/artifact + binding loader smoke tests still gate the job. Fixing the transitive-binding issue is left as a follow-up.

🤖 Generated with Claude Code

@netlify

netlify Bot commented May 14, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 1e60f56
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a17070ae985e20008cf0c37
😎 Deploy Preview https://deploy-preview-9397--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 749aa44a96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/reusable-wasi-test.yml Outdated
@Boshen Boshen marked this pull request as draft May 14, 2026 15:13
@Boshen Boshen force-pushed the ci/re-enable-wasi-testing branch from cc8b83c to 55ab1e2 Compare May 16, 2026 08:55
@Boshen Boshen force-pushed the ci/re-enable-wasi-testing branch 2 times, most recently from b0cbfcf to b90efbe Compare May 24, 2026 04:24
@Boshen Boshen marked this pull request as ready for review May 27, 2026 02:54

Boshen commented May 27, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • May 27, 2:54 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • May 27, 3:10 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • May 27, 3:12 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • May 27, 3:12 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b90efbe14b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/reusable-wasi.yml
Boshen and others added 13 commits May 27, 2026 23:00
Closes #8579.

Restores the WASI build and test pipeline that was removed in #8580
because the prior version was effectively a no-op:
the Node Test and Rollup Test steps had `if: false` (added in #6154
but never enabled), and the Windows matrix entry only ran a step that
was itself skipped on Windows.

This version:
- Drops the OS matrix to ubuntu-latest only.
- Enables Node Test and Rollup Test, run with `NAPI_RS_FORCE_WASI=error`
  so a missing WASI binding hard-fails instead of falling back to native.
- Modernizes the workflows to use `taiki-e/checkout-action`, `setup-vp`,
  and `vp run --filter` to match `reusable-node-test.yml`.
- Drops `packages/pluginutils/dist` from the artifact upload, since
  `@rolldown/pluginutils` was migrated out in #9317.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`vp` itself is a napi-rs binary, and its loader respects
NAPI_RS_FORCE_WASI. With the env set at the workflow step level, vp
threw `WASI binding not found and NAPI_RS_FORCE_WASI is set to error`
at startup — before it could spawn the test runner.

Switch the three env-bearing steps (Node Test, Rollup Test, Build
Examples) to invoke pnpm directly. Steps that don't set the env
(Build @rolldown/test-dev-server) can stay on vp.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
setup-vp bundles pnpm internally but does not expose it on PATH;
the direct `pnpm` invocations introduced in the previous commit
failed with `command not found`. corepack activates the pnpm
version declared in package.json's `packageManager` field.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`corepack enable` without sudo on Ubuntu runners ran silently without
exposing pnpm on PATH (shim writes need root access to /usr/local/bin).
Match the pattern in reusable-release-build.yml:164.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
NAPI_RS_FORCE_WASI is process-wide, so transitive [email protected]
(pulled in by vitest/vite-plus) also tries to load its WASI binding.
Its @rolldown/binding-wasm32-wasi optional dep is filtered out of pnpm
installs on linux-x64 hosts by default. Force-include it via
--config.supported-architectures.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Previous attempt used `pnpm install --config.supported-architectures.*`
after setup-vp had already installed deps. pnpm skipped resolution
("Lockfile is up to date, resolution step is skipped") so the
previously-filtered wasm32-wasi optional dep was never fetched.

Move the supported-architectures config into .npmrc before setup-vp
runs its install, so the transitive @rolldown/binding-wasm32-wasi gets
installed during the initial resolve step.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The three steps that set NAPI_RS_FORCE_WASI=error fail because the
transitive [email protected] (pulled in by vitest/vite-plus)
inherits the env and tries to load its own WASI binding
(@rolldown/[email protected], a published optional dep).
pnpm filters wasm32/wasi optional deps on linux-x64 hosts and setup-vp's
cached install state is restored without it; setting
supported-architectures via .npmrc or CLI flags after that point
doesn't take effect (lockfile is already considered up to date).

Mark the steps continue-on-error so the WASI build + artifact + binding
loader smoke tests still gate this job. The transitive-binding problem
is left as a follow-up; without a real WASI failure-path it's also hard
to know whether the rolldown WASI tests would otherwise pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The workspace's WASI build redirects binding.cjs to rolldown-binding.wasi.cjs
externally (resolveWasiBinding in build.ts), so dist/index.mjs imports the WASI
loader directly with no native fallback. Setting NAPI_RS_FORCE_WASI was only
needed when both bindings were bundled, and it broke the transitive rolldown@rc
(via vitest/vite-plus) whose WASI optional dep is filtered out on linux-x64.

Switch back to vp, add submodules for rollup-tests, and skip @example/typescript
whose devtools config panics on WASI (tracked as follow-up).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The WASI binding intentionally drops JS Error references at the WASM worker
boundary (crates/rolldown_binding/src/types/binding_outputs.rs), which fails
~130 fixture tests that assert on plugin-error stacks and custom properties.
A separate refactor (carrying message/stack/name/code/custom-props as plain
data through BindingError and reconstructing the Error on the JS side) is
tracked in #8579.

Until that lands, run only test:stability (a build/diff smoke test that does
not depend on Error fidelity) plus Build Examples (minus the devtools-enabled
@example/typescript and the native-only @example/native-magic-string).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Fires 10 concurrent rolldown builds via fire-and-forget; under
`wasm32-wasip1-threads` these deadlock or fail with `EINVAL` on
`std::fs::write` because the napi-rs async work pool and per-worker
`node:wasi` fd tables aren't safe for multiple in-process builds
sharing the same WASM instance. Awaiting each build keeps the original
#3453 determinism check intact while making the smoke scope pass on the
WASI binding. Native builds are unaffected by the order change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Drop the direct `changes` dependency and the always()/skipped fallback;
the build job already gates on node-changes, so wasi-test naturally
skips when no node code changed and runs when the artifact is present.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Build, stability test, and example build now share one job. Drops the
artifact round-trip between two jobs and lets `inputs.changed` cleanly
skip the whole thing when no node-changes files are touched.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Boshen Boshen force-pushed the ci/re-enable-wasi-testing branch from b90efbe to 1e60f56 Compare May 27, 2026 15:00
@Boshen Boshen merged commit e246cd2 into main May 27, 2026
32 checks passed
@Boshen Boshen deleted the ci/re-enable-wasi-testing branch May 27, 2026 15:06
@rolldown-guard rolldown-guard Bot mentioned this pull request Jun 3, 2026
shulaoda added a commit that referenced this pull request Jun 3, 2026
> [!IMPORTANT]
> **This is a minor release.** Two changes alter default behavior compared to `1.0.3`. Please read this section before upgrading. Everything else is additive (new features, fixes, deps).

## ⚠️ Notable behavior changes

### 1. `experimental.lazyBarrel` is now enabled by default (#9632)

**What changed.** `experimental.lazyBarrel` now defaults to `true`. When a barrel module is recognized as side-effect-free, Rolldown skips compiling the re-exported modules that are never actually used.

**Impact.** For codebases with large barrel files (component libraries such as Ant Design, `@mui/icons-material`, etc.) this is a meaningful build-time speedup, and for the vast majority of projects the emitted output is unchanged. In rare cases where a barrel is *incorrectly* treated as side-effect-free, the optimization could drop a module that was being relied on for its side effects.

**How to opt out (backward compatible).**

```js
// rolldown.config.js
export default {
  experimental: { lazyBarrel: false },
}
```

> Note: this opt-out flag is planned to be removed in a future release. If you have a case where you must turn it off, please open an issue so we can fix the underlying detection instead.

---

### 2. `tsconfig` project-reference resolution now aligns with TypeScript

Upgrading `oxc_resolver` (`11.19.1` → `11.20.0` in #9549, then `→ 11.21.0` in #9634) changes how a *solution-style* `tsconfig.json` (one that only lists `references` and delegates the real settings to `tsconfig.app.json` / `tsconfig.node.json`, as Vite scaffolds) is resolved, bringing it **in line with how TypeScript (`tsc`) itself behaves**:

- **Reference match priority** (oxc-resolver [#1151](oxc-project/oxc-resolver#1151)): when the root has `references`, a referenced project that includes the file now **takes precedence over the root**, instead of the root matching it first (this is what TypeScript already does). So that project's `compilerOptions.paths` now apply.
- **`allowJs`** (oxc-resolver [#1198](oxc-project/oxc-resolver#1198)): whether a `.js`/`.jsx`/`.mjs`/`.cjs` file is included is now decided by **each referenced project's own** `allowJs`, not the root's (again matching TypeScript). So `tsconfig.app.json` with `allowJs: true` + `paths` now resolves aliases for `.js` files even when the root doesn't set `allowJs`.

For most projects this is a fix (the standard Vite `paths` aliases now resolve, closes #8468), but it **is** a behavior change if you relied on the previous behavior, where the root's `paths` / `allowJs` took precedence.

**If you relied on the old "root wins" behavior.** There is no exact toggle back, because the old behavior was the bug being fixed. The recommended path is to align your config with TypeScript: declare the `paths` / `allowJs` on the referenced project that actually owns the files.

If you must keep the old precedence while still using `references`: a referenced project's match wins, and **the first matching `references` entry takes priority** (the root is only a fallback when no reference claims the file). So extract the old root settings into their own config and list it **first**:

```jsonc
// tsconfig.json (solution root)
{
  "files": [],
  "references": [
    { "path": "./tsconfig.base.json" }, // old root paths/allowJs — listed first, so it wins
    { "path": "./tsconfig.app.json" },
    { "path": "./tsconfig.node.json" }
  ]
}
```

`tsconfig.base.json` should carry the `paths` you previously declared on the root, plus `allowJs: true` if it needs to claim `.js` files (the extension is checked against each config's own `allowJs`). With no `include`, it defaults to `**/*` under its directory and claims every file first.

Alternatively, bypass reference resolution entirely by pointing the top-level `tsconfig` option at a single config: `export default { tsconfig: './tsconfig.app.json' }`.

---

## [1.1.0] - 2026-06-03

### 🚀 Features

- enable `experimental.lazyBarrel` by default (#9632) by @shulaoda
- `import.meta.glob` support `caseSensitive` option (#9594) by @btea
- add `SOURCEMAP_BROKEN` warning for renderChunk hook (#9601) by @sapphi-red
- add `SOURCEMAP_BROKEN` warning for transform hook (#9600) by @sapphi-red
- add `@__NO_SIDE_EFFECTS__` hint for invalid `@__PURE__` before function declarations (#9505) by @Copilot
- code-splitting: support group-local `includeDependenciesRecursively` (#9587) by @hyf0

### 🐛 Bug Fixes

- report TSCONFIG_ERROR instead of UNHANDLEABLE_ERROR for a missing tsconfig file (#9633) by @shulaoda
- browser: add missing exports and ensure consistency with `rolldown` package (#9629) by @sapphi-red
- should build test-dev-server when test-node (#9610) by @situ2001
- chunk-optimizer: refuse asymmetric merge for cyclic dynamic entries (#9320) (#9322) by @aminpaks
- dev: handle the remaining errors in dev (#9570) by @h-a-n-a
- handle slash-normalized ids with preserveModulesRoot (#9595) by @IWANABETHATGUY
- json: preserve .default access on JSON default imports (#9568) by @IWANABETHATGUY
- testing: remove unintended trigger_full_build from test harness (#9573) by @hyf0

### 🚜 Refactor

- js-regex: use regress native replace/replace_all (#9607) by @IWANABETHATGUY
- remove never-constructed `ImportStatus` variants (#9606) by @Boshen

### 📚 Documentation

- clarify that `RolldownBuild::close` method should be called in most cases (#9619) by @sapphi-red

### ⚡ Performance

- avoid unnecessary intermediate sourcemaps (#9599) by @sapphi-red

### 🧪 Testing

- add unit test for collapsing module sourcemap (#9626) by @sapphi-red
- cover vite-alias regex capture-group expansion (#9602) (#9608) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- deps: update oxc_resolver to 11.21.0 (#9634) by @shulaoda
- update invalid option diagnostic link to point to Rolldown docs (#9631) by @sapphi-red
- deps: update vite+ to v0.1.24 (#9628) by @renovate[bot]
- deps: update oxc resolver to v11.20.0 (#9549) by @renovate[bot]
- deps: update dependency vite-plus to v0.1.24 (#9470) by @renovate[bot]
- deps: update npm packages (#9614) by @renovate[bot]
- deps: upgrade oxc to 0.134.0 (#9625) by @shulaoda
- deps: update crate-ci/typos action to v1.47.0 (#9620) by @renovate[bot]
- deps: update rollup submodule for tests to v4.61.0 (#9623) by @rolldown-guard[bot]
- deps: update github actions (#9613) by @renovate[bot]
- deps: update pnpm to v11.4.0 (#9616) by @renovate[bot]
- deps: update rust crates (#9615) by @renovate[bot]
- deps: update test262 submodule for tests (#9624) by @rolldown-guard[bot]
- deps: update dependency @napi-rs/cli to v3.7.0 (#9588) by @renovate[bot]
- deps: update dependency rust to v1.96.0 (#9596) by @renovate[bot]
- re-enable WASI testing with proper infrastructure (#9397) by @Boshen

### ❤️ New Contributors

* @aminpaks made their first contribution in [#9322](#9322)

Co-authored-by: shulaoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-enable WASI testing with proper infrastructure

1 participant