Fix KiCad WASM build and runtime errors
Build improvements: - Change -O0 to -O1 to fix "local count too large" asyncify error - Add wasm-emscripten-finalize to host (Docker OOMs on large WASM) - Use -gseparate-dwarf for smaller main binary with debug info - Build native protoc for code generation - Add more functions to asyncify removelist Runtime fixes: - Add inject-dyncall-shims.sh to fix "dynCall_* is not defined" in Emscripten 4.x - Update wxwidgets with browserInfo.name fix New stubs and bindings: - Add Embind bindings for JavaScript interop - Add stubs for scripting, API plugin, PCB frame, navlib 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
898e079ef2
commit
9c271996c2
17 changed files with 699 additions and 13 deletions
|
|
@ -25,9 +25,18 @@ docker compose -f docker/docker-compose.yml exec kicad-wasm-builder \
|
|||
/workspace/scripts/kicad/build-pcbnew.sh "${ARGS[@]}"
|
||||
|
||||
# Copy output to host-accessible directory
|
||||
# Note: pcbnew.wasm.debug.wasm contains DWARF debug info (generated with -gseparate-dwarf)
|
||||
echo "Copying build output to ./output/..."
|
||||
docker compose -f docker/docker-compose.yml exec kicad-wasm-builder \
|
||||
bash -c "mkdir -p /workspace/output && cp /workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.{js,wasm,wasm.map,worker.js} /workspace/output/ 2>/dev/null || cp /workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.{js,wasm} /workspace/output/"
|
||||
bash -c "mkdir -p /workspace/output && cp /workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.{js,wasm,wasm.debug.wasm,wasm.map,worker.js} /workspace/output/ 2>/dev/null || cp /workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.{js,wasm} /workspace/output/"
|
||||
|
||||
# Inject dynCall shims into pcbnew.js
|
||||
# This fixes "dynCall_* is not defined" errors in Emscripten 4.x
|
||||
./scripts/common/inject-dyncall-shims.sh output/pcbnew.js
|
||||
|
||||
# Apply wasm-emscripten-finalize on host (skipped in Docker due to memory limits)
|
||||
# This is done on the host because finalize with DWARF needs significant RAM
|
||||
./scripts/common/apply-finalize.sh output/pcbnew.wasm output/pcbnew.wasm
|
||||
|
||||
# Apply asyncify transformation on host
|
||||
# This is done on the host because wasm-opt --asyncify needs significant RAM
|
||||
|
|
|
|||
Loading…
Reference in a new issue