Skip to content

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

Draft
GamePad64 wants to merge 1 commit into
bytecodealliance:mainfrom
GamePad64:fix/xtask-obj-component-collision
Draft

fix(xtask): stop the debug bootstrap clobbering the release bindgen#1744
GamePad64 wants to merge 1 commit 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
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.

1 participant