Add two-phase build with host asyncify transformation
- Move asyncify from Docker to host to avoid memory issues - Auto-download Binaryen v121 (v125 has regression bug) - Use -O1 for debug builds (V8 local count limit) - Remove asyncify flags from linker (handled by wasm-opt) - Document two-phase build in build.md 🤖 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
0c48855191
commit
b70f098ae2
6 changed files with 187 additions and 19 deletions
|
|
@ -1,23 +1,40 @@
|
|||
#!/bin/bash
|
||||
# Copies KiCad WASM build output from Docker volume to test directory
|
||||
# Copies KiCad WASM build output to test directory
|
||||
#
|
||||
# Priority: Use local output/ directory (populated by docker/build.sh)
|
||||
# Fallback: Copy from Docker volume directly
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
KICAD_TEST="$PROJECT_ROOT/tests/wasm-app/kicad"
|
||||
OUTPUT_DIR="$PROJECT_ROOT/output"
|
||||
|
||||
mkdir -p "$KICAD_TEST"
|
||||
|
||||
echo "Copying KiCad WASM files from Docker build..."
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.js "$KICAD_TEST/"
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.wasm "$KICAD_TEST/"
|
||||
|
||||
# Worker file for pthreads (if exists)
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.worker.js "$KICAD_TEST/" 2>/dev/null || true
|
||||
# Check if output directory has the build files
|
||||
if [ -f "$OUTPUT_DIR/pcbnew.js" ] && [ -f "$OUTPUT_DIR/pcbnew.wasm" ]; then
|
||||
echo "Copying KiCad WASM files from output directory..."
|
||||
cp "$OUTPUT_DIR/pcbnew.js" "$KICAD_TEST/"
|
||||
cp "$OUTPUT_DIR/pcbnew.wasm" "$KICAD_TEST/"
|
||||
# Source map for debug symbols (optional)
|
||||
cp "$OUTPUT_DIR/pcbnew.wasm.map" "$KICAD_TEST/" 2>/dev/null || true
|
||||
# Worker file for pthreads (optional)
|
||||
cp "$OUTPUT_DIR/pcbnew.worker.js" "$KICAD_TEST/" 2>/dev/null || true
|
||||
else
|
||||
echo "Output directory not found, copying from Docker build..."
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.js "$KICAD_TEST/"
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.wasm "$KICAD_TEST/"
|
||||
# Source map for debug symbols (optional)
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.wasm.map "$KICAD_TEST/" 2>/dev/null || true
|
||||
# Worker file for pthreads (optional)
|
||||
docker compose -f "$PROJECT_ROOT/docker/docker-compose.yml" cp \
|
||||
kicad-wasm-builder:/workspace/build-wasm/kicad-pcbnew/pcbnew/pcbnew.worker.js "$KICAD_TEST/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# wxWidgets WASM JavaScript glue code (defines JS functions called from WASM)
|
||||
echo "Copying wxWidgets WASM glue code..."
|
||||
|
|
|
|||
Loading…
Reference in a new issue