fix(build): host postprocess silently no-ops when emsdk tools are stubbed
build-kicad-target.sh swaps emsdk's wasm-opt/wasm-emscripten-finalize for no-op stubs (real binaries preserved as *.real) so emcc skips in-link asyncify — intended for the CONTAINER emsdk, but a host-mode run left the host tools/emsdk stubbed (since Jun 9). The stub fakes --version and exits 0, so every local build's host-side finalize/asyncify/-O2 "succeeded" while doing nothing: output wasm shipped non-asyncified and aborts at boot with "asyncify_stop_unwind is not a function" (and stayed 122M vs the correct 187M). get-wasm-opt.sh and apply-finalize.sh now prefer the *.real binary whenever it exists, making the resolution immune to a stubbed emsdk. Found while validating the CI e2e fix: pcbnew.wasm built this morning could not boot in any browser. Local artifacts built since Jun 9 may need their postprocess re-run (apply-finalize.sh + apply-asyncify.sh). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
f37ddc454d
commit
380206dcfc
2 changed files with 15 additions and 0 deletions
|
|
@ -13,6 +13,12 @@ PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
|||
WASM_OPT=$("${SCRIPT_DIR}/get-wasm-opt.sh")
|
||||
BINARYEN_BIN=$(dirname "${WASM_OPT}")
|
||||
FINALIZE="${BINARYEN_BIN}/wasm-emscripten-finalize"
|
||||
# Same stub hazard as wasm-opt (see get-wasm-opt.sh): a host-mode kicad build
|
||||
# leaves the emsdk finalize stubbed with the real binary at .real — prefer it,
|
||||
# the stub exits 0 having done nothing.
|
||||
if [ -x "${FINALIZE}.real" ]; then
|
||||
FINALIZE="${FINALIZE}.real"
|
||||
fi
|
||||
|
||||
INPUT_WASM="${1:-output/pcbnew.wasm}"
|
||||
OUTPUT_WASM="${2:-${INPUT_WASM}}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue