Skip to content

ci: verify wasm32-wasi binding deps match @rolldown/browser before publish#9162

Merged
shulaoda merged 5 commits intomainfrom
04-20-ci_verify_wasm32-wasi_binding_deps_match_rolldown_browser_before_publish
Apr 21, 2026
Merged

ci: verify wasm32-wasi binding deps match @rolldown/browser before publish#9162
shulaoda merged 5 commits intomainfrom
04-20-ci_verify_wasm32-wasi_binding_deps_match_rolldown_browser_before_publish

Conversation

@shulaoda
Copy link
Copy Markdown
Member

closes #8974

Summary

  • Add scripts/misc/check-wasi-binding-deps.mjs to verify that the runtime dependencies (@napi-rs/wasm-runtime, @emnapi/core, @emnapi/runtime) declared in the generated @rolldown/binding-wasm32-wasi/package.json match the specifiers used by @rolldown/browser (resolved through the pnpm catalog when applicable).
  • Wire the check into both publish workflows (publish-to-npm.yml and publish-to-pkg.pr.new.yml) right after napi create-npm-dirs runs, so a mismatch fails the job before anything is published.

Why

napi create-npm-dirs pins the wasm32-wasi binding's runtime dependencies from its own sources — @napi-rs/wasm-runtime is fetched as the latest published version on npm, while @emnapi/core / @emnapi/runtime follow the version of emnapi resolved locally. These can silently drift from the specifiers used by @rolldown/browser, which bundles the binding's glue code and must load the same runtime versions at execution time.

The generated binding is the source of truth: its glue code was built against those exact runtime versions, so @rolldown/browser must stay aligned. When this check fails, the fix is to bump the corresponding entries in pnpm-workspace.yaml (for deps referenced via catalog:) or in packages/browser/package.json (for deps pinned directly) to match what the binding declares.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 6fb79c2
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69e720266ec3430008f3606b

@shulaoda shulaoda marked this pull request as draft April 20, 2026 04:12
@shulaoda shulaoda marked this pull request as ready for review April 20, 2026 08:14
@shulaoda shulaoda requested a review from sapphi-red April 20, 2026 08:14
Comment thread pnpm-workspace.yaml
Comment thread scripts/misc/check-wasi-binding-deps.mjs Outdated
@shulaoda shulaoda requested a review from sapphi-red April 21, 2026 02:29
@shulaoda shulaoda merged commit 6b184bd into main Apr 21, 2026
32 checks passed
@shulaoda shulaoda deleted the 04-20-ci_verify_wasm32-wasi_binding_deps_match_rolldown_browser_before_publish branch April 21, 2026 07:20
shulaoda added a commit that referenced this pull request Apr 21, 2026
See https://github.com/rolldown/rolldown/actions/runs/24709484698/job/72274455296

## Summary

- Replace `pnpm --dir <browser> ls ... --json` in `scripts/misc/check-wasi-binding-deps.mjs` with `vp pm list --filter @rolldown/browser --json -- ...`.
- Update the "did the install step run?" hint to reference `vp install`.

## Why

The publish workflows (`publish-to-npm.yml` / `publish-to-pkg.pr.new.yml`) set up the runner with `voidzero-dev/setup-vp`, which only puts `vp` on `PATH` — `pnpm` is not available. The check script added in #9162 shelled out to `pnpm`, so the step failed as soon as it ran:

```
Error: spawnSync pnpm ENOENT
    ...
    spawnargs: [
      '--dir',
      '/home/runner/work/rolldown/rolldown/packages/browser',
      'ls',
      '@napi-rs/wasm-runtime',
      '@emnapi/core',
      '@emnapi/runtime',
      '--json'
    ],
```

`vp pm list` is `pnpm ls`-compatible here: with `--filter @rolldown/browser --json -- <pkgs...>` it returns the same JSON shape (`[{ dependencies: { <pkg>: { version, ... } } }]`), so no parsing changes are needed.
@github-actions github-actions Bot mentioned this pull request Apr 22, 2026
This was referenced Apr 22, 2026
shulaoda added a commit that referenced this pull request Apr 22, 2026
## [1.0.0-rc.17] - 2026-04-22

### 🐛 Bug Fixes

- link: error on missing export between TS modules (#9197) by @IWANABETHATGUY
- rolldown_plugin_vite_import_glob: import path should not be affected by absolute base option (#9145) by @kermanx
- `this.resolve()` returns null for bare relative paths without importer (#9142) by @Copilot
- collect destructured bindings in HMR module exports (#9146) by @h-a-n-a
- esbuild-tests: handle 0.28.0 test cases (#9149) by @sapphi-red
- plugin/copy-module: honor external resolutions from other plugins (#9139) by @TheAlexLichter
- allow undefined in sourcesContent type (#9136) by @jurijzahn8019
- reduce false positives in chunk optimizer circular dependency detection (#9049) by @AlonMiz

### 🚜 Refactor

- chunk-optimizer: extract runtime-module placement into rehome_runtime_module (#9163) by @IWANABETHATGUY

### 📚 Documentation

- add design doc for sort_modules execution ordering (#9169) by @IWANABETHATGUY
- add document for `RenderedModule` (#9147) by @sapphi-red

### ⚡ Performance

- rolldown_plugin_vite_import_glob: skip self-import earlier using raw path comparison (#9193) by @shulaoda

### 🧪 Testing

- lazy: add `playground/lazy-compilation` (#7974) by @hyf0

### ⚙️ Miscellaneous Tasks

- use app token for release PR (#9198) by @Boshen
- upgrade oxc to 0.127.0 (#9194) by @Dunqing
- use oxc security action (#9196) by @Boshen
- esbuild-tests: remove some tests from ignored list as enum inline is now supported (#9184) by @sapphi-red
- deps: update dependency vite-plus to v0.1.19 (#9183) by @renovate[bot]
- use vp instead of pnpm in check-wasi-binding-deps (#9182) by @shulaoda
- verify wasm32-wasi binding deps match @rolldown/browser before publish (#9162) by @shulaoda
- deps: update esbuild for tests to 0.28.0 (#9172) by @sapphi-red
- deps: update rollup submodule for tests to v4.60.2 (#9173) by @sapphi-red
- deps: update test262 submodule for tests (#9174) by @sapphi-red
- sort_modules: fix stale async-entry sort key comment (#9170) by @IWANABETHATGUY
- deps: update npm packages (#9157) by @renovate[bot]
- deps: update dependency diff to v9 (#9158) by @renovate[bot]
- deps: update rust crates (#9156) by @renovate[bot]
- run Windows CI on PRs labeled with `ci: windows` (#9153) by @hyf0
- update-test-dependencies: run setup-rust before file changes (#9151) by @sapphi-red
- deps: update dependency rust to v1.95.0 (#9140) by @renovate[bot]

### ❤️ New Contributors

* @jurijzahn8019 made their first contribution in [#9136](#9136)
* @AlonMiz made their first contribution in [#9049](#9049)

---------

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

@rolldown/browser must have @emnapi/runtime and @emnapi/core as a dep

2 participants