fix(xtask): stop the debug bootstrap clobbering the release bindgen#1744
Draft
GamePad64 wants to merge 1 commit into
Draft
fix(xtask): stop the debug bootstrap clobbering the release bindgen#1744GamePad64 wants to merge 1 commit into
GamePad64 wants to merge 1 commit into
Conversation
`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>
4d1546c to
5e685e4
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
transpile()writes the componentized module toobj/<name>.component.wasm, then, on a cleanobj/, runs a debug bootstrap (transpile_components(BuildType::Debug)) to build thewasm-toolstranspiler thatjco optneeds. That bootstrap transpiles all components, including the one currently being built, into the sameobj/*.component.wasmpaths, overwriting the release component with the 132 MiB debug build.jco optand the final transpile then run on the debug component, sobuild:releaseemits 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_pathafter the bootstrap sojco optoperates on the release build. The bootstrap only runs whenobj/wasm-tools.jsis absent (a clean checkout), which is exactly how the release workflow builds, so every published js-component-bindgen bindgen was the debug one.