Skip to content

fix(transpile): stop the debug bootstrap clobbering the release bindgen#1744

Merged
vados-cosmonic merged 2 commits into
bytecodealliance:mainfrom
GamePad64:fix/xtask-obj-component-collision
Jul 10, 2026
Merged

fix(transpile): stop the debug bootstrap clobbering the release bindgen#1744
vados-cosmonic merged 2 commits into
bytecodealliance:mainfrom
GamePad64:fix/xtask-obj-component-collision

Conversation

@GamePad64

Copy link
Copy Markdown
Contributor

transpile() writes the componentized module to
obj/<name>.component.wasm, then, on a clean obj/, runs a debug bootstrap (transpile_components(BuildType::Debug)) to build the wasm-tools transpiler that jco opt needs. That bootstrap transpiles all components, including the one currently being built, into the same obj/*.component.wasm paths, overwriting the release component with the 132 MiB debug build. jco opt and the final transpile then run on the debug component, so build:release emits the debug bindgen (wasm-opt'd to ~8.9 MiB / 17,688 funcs) instead of the release one (~3.1 MiB / 7,836 funcs).

Re-write the release component to component_path after the bootstrap so jco opt operates on the release build. The bootstrap only runs when obj/wasm-tools.js is absent (a clean checkout), which is exactly how the release workflow builds, so every published js-component-bindgen bindgen was the debug one.

`transpile()` writes the componentized module to
`obj/<name>.component.wasm`, then, on a clean `obj/`, runs a debug
bootstrap (`transpile_components(BuildType::Debug)`) to build the
`wasm-tools` transpiler that `jco opt` needs. That bootstrap transpiles
*all* components, including the one currently being built, into the same
`obj/*.component.wasm` paths, overwriting the release component with the
132 MiB debug build. `jco opt` and the final transpile then run on the
debug component, so `build:release` emits the debug bindgen (wasm-opt'd
to ~8.9 MiB / 17,688 funcs) instead of the release one
(~3.1 MiB / 7,836 funcs).

Re-write the release component to `component_path` after the bootstrap so
`jco opt` operates on the release build. The bootstrap only runs when
`obj/wasm-tools.js` is absent (a clean checkout), which is exactly how the
release workflow builds, so every published js-component-bindgen bindgen
was the debug one.

Signed-off-by: Alexander Shishenko <alex@shishenko.com>
@GamePad64 GamePad64 force-pushed the fix/xtask-obj-component-collision branch from 4d1546c to 5e685e4 Compare July 9, 2026 15:49
@GamePad64 GamePad64 changed the title fix(xtask): stop the debug bootstrap clobbering the release bindgen fix(transpile): stop the debug bootstrap clobbering the release bindgen Jul 9, 2026
@GamePad64 GamePad64 marked this pull request as ready for review July 9, 2026 23:04
vados-cosmonic
vados-cosmonic previously approved these changes Jul 10, 2026

@vados-cosmonic vados-cosmonic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀

Thanks @GamePad64 !

@vados-cosmonic vados-cosmonic enabled auto-merge July 10, 2026 02:34
@vados-cosmonic vados-cosmonic added this pull request to the merge queue Jul 10, 2026
Merged via the queue into bytecodealliance:main with commit c3f4d28 Jul 10, 2026
49 checks passed
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.

2 participants