refactor(cmake): batch F (gerbview/pl_editor #5 + navlib #6) + docs

Bumps kicad to 6f82742e68 (in-place CMake de-dup pass A-F complete) and updates
the fork-cleanup docs: CMake churn 1,702 -> 1,019, build-graph proven byte-identical
pre/post (zero behavior change), only Phase-B cmake/wasm relocation remaining.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Istvan Matejcsok 2026-06-22 18:41:11 +02:00
commit c35005589d
4 changed files with 13 additions and 4 deletions

View file

@ -41,6 +41,7 @@ excluded** — additive new files do not hurt a rebase.
| `kiglew.h` +189 GLEW-stub revert | 01 | ~190 | `c39e8f8689`; pristine vs upstream |
| `opengl_gal.cpp` Connect→Bind refactor revert | 01 | ~63 | `c39e8f8689`; pristine |
| `KI_DIAG_*` / `wxFprintf` diag call-site deletion | 01 | ~41 | `c39e8f8689`; **zero** `KI_DIAG` call sites remain (diag flags now inert even though `-DKICAD_DIAG_*=1` is still passed) |
| CMake de-churn batches AF (16 files) | 02 | ~683 (CMake churn 1,702→1,019) | Kicad `6f82742e68` (F) on `b5ac6dcbe4` (AE); root `0b4d830`. `-O1` WASM build (pcbnew/eeschema/calculator) + 9/9 e2e, no screenshot change; **build-graph proven byte-identical pre/post for the whole tree** (compile+link+custom commands) → zero behavior change. Moves: `KICAD_WASM_LAYER` var, early-return guards, `list(REMOVE_ITEM)`, `add_shader` redefine via new `wasm/cmake/WasmShaderOverride.cmake`, additive `BUILD_KIWAY_DLL` sets, pcb_calculator restructure, gerbview/pl_editor #5, navlib #6 (behavior-preserving stub de-churn). **The in-place de-dup pass is complete; only Phase-B `cmake/wasm/` relocation remains.** |
| Tooltips implemented in wx fork | 05 | enables ~19 revert | `wxwidgets/include/wx/wasm/tooltip.h` + `src/wasm/tooltip.cpp`, `wxUSE_TOOLTIPS=1` |
| `GetCurrentSelection`/`IsEmpty` already base behavior in wx wasm | 05 | enables ~11 revert | wasm `wxChoice` inherits base `GetCurrentSelection(){return GetSelection();}` |
| Symbol-lib asset pipeline | 09 | 0 (new files) | `boot.ts` seeds `sym-lib-table`; PCBJAM_LIB/FP plugins are additive new files |
@ -166,7 +167,7 @@ Hours → days at 6 productive h/day.
| Doc | Theme | Current churn | Residual | Reduction | Effort (h / days) | Risk | Verdict |
|---|---|---|---|---|---|---|---|
| [01](01-revert-dead-code.md) | Revert dead code | 0 | 0 | 0 | 00.5 / ~0d | low | **DONE** (`c39e8f8689`) |
| [02](02-cmake-dechurn.md) | CMake de-churn | ~1,399 | ~175250 | **~1,1501,225** | 2238 / 3.76.3d | med | **Biggest lever** |
| [02](02-cmake-dechurn.md) | CMake de-churn | ~1,702 → 1,019 | ~175250 | **683 so far** | 2238 / 3.76.3d | med | **AF (in-place de-dup) DONE** (`6f82742e68`); only Phase-B `cmake/wasm/` relocation remains. Build graph proven identical → zero behavior change |
| [03](03-config-not-code.md) | Config-not-code | ~60 | ~3 | ~57 | 715 / 1.22.5d | lowmed | 4/5 → runtime config |
| [04](04-stub-tu-relocation.md) | Stub-TU relocation | ~571 | ~2031 | **~540551** | 917 / 1.52.8d | lowmed | **2nd-biggest lever** |
| [05](05-wx-layer-fixes.md) | wx-layer fixes | ~37 | ~3 | ~34 | 37 / 0.51.2d | low | Mostly revertable now |
@ -188,7 +189,7 @@ Cumulative removed is from the live 2,795 baseline (doc 01's ~401 already gone).
| # | Action | Doc | Reduction | Effort (h) | Cumulative removed | Risk |
|---|---|---|---|---|---|---|
| 1 | Stub-TU relocation (libcontext + fontconfig) | 04 | ~540 | 511 | ~540 | lowmed |
| 2 | CMake de-dup pass (guards + `REMOVE_ITEM`, no relocation yet) | 02 | ~700 | 814 | ~1,240 | lowmed |
| 2 | CMake de-dup pass (guards + `REMOVE_ITEM`, no relocation yet)**batches AF DONE** (`6f82742e68`, 683; in-place de-dup complete) | 02 | ~700 | 814 | ~1,240 | lowmed |
| 3 | Importer re-enable (delete gates) | 08 | ~95 | 514 | ~1,335 | lowmed |
| 4 | `KICAD_SCRIPTING` reverts | 03/06 | ~64 | 24 | ~1,399 | low |
| 5 | wx-layer + tooltip reverts | 05 | ~30 | 24 | ~1,429 | low |

View file

@ -1,5 +1,13 @@
# 02 — CMake de-churn
> **Status — the in-place de-dup pass (batches AF) is COMPLETE** (kicad `6f82742e68` on `b5ac6dcbe4`,
> root `0b4d830`): Move 0 (`KICAD_WASM_LAYER` var) + moves #1#7 across all apps, incl. #5 for
> gerbview/pl_editor and #6 (navlib, behavior-preserving stub de-churn). **Not yet done:** only the
> `cmake/wasm/` **relocation (Phase B)**. CMake churn: **1,702 → 1,019** (683), validated by an `-O1`
> WASM build (pcbnew/eeschema/calculator) + 9/9 e2e with no screenshot change, **and a build-graph
> equivalence proof** (compile + link + custom commands byte-identical pre/post across the whole tree) →
> zero behavior change. The recipes below describe the full design (Phase-B relocation still pending).
> The build-system diff is **~1,600 changed lines across 17 `CMakeLists.txt` files**, and
> **3540% of it (~600 lines) is reindentation and duplication** — not logic. The logic
> that *is* there (single-binary kiface linking, stub injection, the WebGL GAL) is mostly

View file

@ -113,7 +113,7 @@ Every disabled/divergent item, with verdict. Detail + recipes in the linked docs
|---|---|
| [00-effort-and-current-state.md](00-effort-and-current-state.md) | **Current state (2026-06-17): per-change revert/relocate/re-enable verdict, effort, and resulting diff math reconciled against a live file ledger. Read this first.** |
| [01-revert-dead-code.md](01-revert-dead-code.md) | Diff that compiles only in unused configs: IPC-API gates, `kiglew.h`, `opengl_gal.cpp`, diagnostics. ~480 lines, zero behavior change. **(DONE — `c39e8f8689`.)** |
| [02-cmake-dechurn.md](02-cmake-dechurn.md) | ~600 lines of CMake reindent/duplication → early-return guards, `list(REMOVE_ITEM)`, shader-hook, relocate `if(EMSCRIPTEN)` to `cmake/wasm/`. |
| [02-cmake-dechurn.md](02-cmake-dechurn.md) | ~600 lines of CMake reindent/duplication → early-return guards, `list(REMOVE_ITEM)`, shader-hook, relocate `if(EMSCRIPTEN)` to `cmake/wasm/`. **(In-place de-dup AF done — `6f82742e68`; CMake churn 1,702→1,019, build graph proven identical. Only Phase-B `cmake/wasm/` relocation remains.)** |
| [03-config-not-code.md](03-config-not-code.md) | Patches that re-implement existing settings: zoom pref, hotkeys file, `HAVE_CLOCK_GETTIME`, kiface init from the shell. |
| [04-stub-tu-relocation.md](04-stub-tu-relocation.md) | Move in-file `#else` stubs to new translation units: fontconfig, libcontext, SpaceMouse. |
| [05-wx-layer-fixes.md](05-wx-layer-fixes.md) | KiCad patches that belong in the wxWidgets wasm port: scale factor, selection, header self-sufficiency, **tooltips**. |