diff --git a/.gitignore b/.gitignore index 68cb3ec..8f1969c 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,6 @@ wxwidgets-clean/ /tests/apps/kicad/*.wasm # DOM-port test bundles (mirrored + built by scripts/build-wasm-test.sh --dom) -/tests/apps-dom/ # Worktree-local canvas reference snapshot for regression gating (see # features/wx-dom-port docs); derived from a local run, not a project asset diff --git a/CLAUDE.md b/CLAUDE.md index ac52184..f35090c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,7 @@ Always check screenshots for validating tests Run e2e tests from /tests folder: `npm run test:kicad` or `npm run test:e2e` (not playwright directly) Build kicad with docker/build.sh (includes wxwidgets build, runs in docker) -Build wxwidgets standalone with scripts/build-wxuniversal-wasm.sh (runs on machine, for wxwidgets-only changes) +Build wxwidgets standalone with scripts/build-wx-wasm.sh (runs on machine, for wxwidgets-only changes) Build CPP wxwidgets tests with scripts/builds-wasm-test.sh The build scripts pipe their outputs into log files so that they won't clog the LLM context. Don't pipe outputs, just run the scripts. Maybe with flex if you need that. diff --git a/README.md b/README.md index 63f1f1c..293ab12 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ git submodule update --init --recursive ./docker/build.sh # 3. Build wxWidgets for local testing -./scripts/build-wxuniversal-wasm.sh +./scripts/build-wx-wasm.sh # 4. Build wxWidgets test apps ./scripts/build-wasm-test.sh @@ -29,7 +29,7 @@ npm run test:kicad # KiCad tests (2 tests) ```bash # Requires: Node.js 18+ (Emscripten SDK auto-installed on first build) -./scripts/build-wxuniversal-wasm.sh +./scripts/build-wx-wasm.sh ./scripts/build-wasm-test.sh cd tests && npm install && npm test ``` @@ -48,7 +48,7 @@ kicad-wasm/ │ ├── shims/ # Runtime JavaScript shims │ └── stubs/ # Stub implementations (libgit2, curl) ├── scripts/ # Build scripts -│ ├── build-wxuniversal-wasm.sh # Build wxWidgets for WASM +│ ├── build-wx-wasm.sh # Build wxWidgets for WASM │ ├── build-wasm-test.sh # Build wxWidgets test apps │ ├── deps/ # Dependency build scripts │ ├── kicad/ # KiCad build scripts @@ -98,7 +98,7 @@ Build standalone wxWidgets test apps for feature testing: ```bash # Build wxWidgets for WASM -./scripts/build-wxuniversal-wasm.sh +./scripts/build-wx-wasm.sh # Build test apps ./scripts/build-wasm-test.sh diff --git a/docker/build.sh b/docker/build.sh index d5369eb..92c8f7a 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -178,20 +178,14 @@ compile_app() { echo "" echo "=== Building ${app} (${index}/${total}) ===" - # WX_PORT=dom builds against the DOM wxWidgets into separate build and - # output trees (kicad--dom, output/dom/). - local out_dir - out_dir=$(out_dir_for) + local out_dir="output" local kicad_build="kicad-${app}" - if [[ "${WX_PORT:-}" == "dom" ]]; then - kicad_build="kicad-${app}-dom" - fi # Run build inside the container. # -e EMSDK=/emsdk: `docker compose exec` bypasses the entrypoint that sources # emsdk_env.sh, so the build shell would lack emcc/embuilder on PATH. Setting # EMSDK lets scripts/common/env.sh source /emsdk/emsdk_env.sh and activate the toolchain. - docker compose -f docker/docker-compose.yml exec -e EMSDK=/emsdk -e WX_PORT="${WX_PORT:-}" \ + docker compose -f docker/docker-compose.yml exec -e EMSDK=/emsdk \ kicad-wasm-builder \ "/workspace/scripts/kicad/build-${app}.sh" "${ARGS[@]}" @@ -204,8 +198,8 @@ compile_app() { cp /workspace/build-wasm/${kicad_build}/${subdir}/${app}.{js,wasm,wasm.debug.wasm,wasm.map,worker.js} /workspace/${out_dir}/ 2>/dev/null || \ cp /workspace/build-wasm/${kicad_build}/${subdir}/${app}.{js,wasm} /workspace/${out_dir}/; \ cp /workspace/build-wasm/${kicad_build}/resources/images.tar.gz /workspace/${out_dir}/ 2>/dev/null || true; \ - cp /workspace/build-wasm/wxwidgets/build/wasm/wx.js /workspace/${out_dir}/ 2>/dev/null || true; \ - if [ -n \"${WX_PORT:-}\" ]; then cp /workspace/build-wasm/wxwidgets/build/wasm/wx-dom.js /workspace/${out_dir}/ 2>/dev/null || true; fi" + cp /workspace/wxwidgets/build/wasm/wx.js /workspace/${out_dir}/ 2>/dev/null || true; \ + cp /workspace/wxwidgets/build/wasm/wx-dom.js /workspace/${out_dir}/ 2>/dev/null || true" # The container runs as root, so files in the bind-mounted ./output land # root-owned on the host. macOS Docker Desktop remaps ownership to the host @@ -215,24 +209,13 @@ compile_app() { chown -R "$(id -u):$(id -g)" /workspace/output || true } -# Output dir for the current flavor: the DOM port (WX_PORT=dom) keeps its -# bundles in output/dom/ so the canvas bundles are never clobbered. -out_dir_for() { - if [[ "${WX_PORT:-}" == "dom" ]]; then - echo "output/dom" - else - echo "output" - fi -} - # Phase 2 of one app: host-side post-processing (dyncall shims, finalize, # asyncify + -O2). Pure host work on output/${app}.* — independent of the # container, which is what makes it safe to run in the background while the # next app compiles. postprocess_app() { local app="$1" - local out_dir - out_dir=$(out_dir_for) + local out_dir="output" # Inject dynCall shims (fixes "dynCall_* is not defined" errors in Emscripten 4.x) kw_stage dyncall-shims diff --git a/docs/build.md b/docs/build.md index eb4715a..daf2da3 100644 --- a/docs/build.md +++ b/docs/build.md @@ -143,7 +143,7 @@ Import patterns used: **Full rebuild removes:** - `build-wasm/stamps/*` - All build stamps - `build-wasm/deps/*` - All dependency builds -- `build-wasm/wxwidgets-universal` - wxWidgets build +- `build-wasm/wxwidgets` - wxWidgets build - `build-wasm/sysroot/*` - Installed headers/libraries - `build-wasm/kicad-pcbnew` - KiCad build @@ -208,7 +208,7 @@ After changing build flags (debug/release), use `--full` to force a complete reb |--------|---------| | `docker/build.sh` | Host entry point (starts Docker, runs build) | | `scripts/kicad/build-pcbnew.sh` | KiCad PCBnew build (runs inside Docker) | -| `scripts/build-wxuniversal-wasm.sh` | wxWidgets build | +| `scripts/build-wx-wasm.sh` | wxWidgets build | | `scripts/build-wasm-test.sh` | Build wxWidgets test apps | | `scripts/deps/build-all-deps.sh` | All dependencies | | `scripts/deps/build-*.sh` | Individual dependency builds | @@ -240,7 +240,7 @@ OpenCASCADE is the longest dependency to build (~30 minutes). ### Incremental build not picking up changes - For KiCad: use `--clean-kicad` to force rebuild -- For wxWidgets: delete `build-wasm/wxwidgets-universal/Makefile` to force reconfigure +- For wxWidgets: delete `build-wasm/wxwidgets/Makefile` to force reconfigure ### WASM exception with numeric error (e.g., `3788888`) - Build with debug symbols (default): No `--release` flag diff --git a/docs/features/wx-dom-port/README.md b/docs/features/wx-dom-port/README.md index f4359bd..1e806ab 100644 --- a/docs/features/wx-dom-port/README.md +++ b/docs/features/wx-dom-port/README.md @@ -1,65 +1,71 @@ # wxWidgets DOM port (`feature/wx-dom-port`) -A second WASM build mode where wxWidgets widgets are **real HTML elements** +THE wxWidgets WASM port: widgets are **real HTML elements** (`wxButton` → `