Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .agents/docs/2026-06-29-mcpp-native-workspace-ci-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,22 @@ windows-runtime-dll(0.0.73)那次"mcpp 补能力 → recipe/CI 变简单"完全
**尚未收敛**(留待 §6 P2/P3):per-OS 成员差异仍可由 cfg 表承担而非驱动;环境隔离/缓存/产物断言仍在
各 smoke 脚本;`--workspace` 单命令(G1)仍是 mcpp 侧待加能力——当前驱动按成员循环。旧 smoke 脚本
**保留**,与 workspace 并行覆盖,等价验证充分后再逐个迁移/删除。

---

## 9. 零 shell 自包含(2026-06-30,mcpp 0.0.79)

承 §8,workspace 测试从「shell 驱动 build+run」升级为「`mcpp test --workspace` 真实断言」,
依赖 mcpp 0.0.79 的 workspace-aware test(`mcpp test -p <member>` / `--workspace`)+ build.mcpp
cwd 修复(见 mcpp `.agents/docs/2026-06-30-workspace-test-and-zero-shell-index-design.md`)。

- **成员=真实测试工程**:`tests/examples/<lib>/` 改为 `[dependencies] compat.<lib>` + `tests/*.cpp`
行为断言(cjson 解析取字段、eigen header-only 线代、nlohmann round-trip+ordered、openblas
cfg(windows) dgemm、build-mcpp 断言 build.mcpp 生成源+宏)。无 `src/`(纯测试工程,deps 头/库
照样进测试二进制)。
- **CI 去 shell**:`smoke-workspace` 跑 `mcpp test --workspace`;`smoke-examples` 跑
`mcpp test -p <lib>`;删 `tests/run_workspace.sh` + `tests/run_example.sh`。MCPP_VERSION→0.0.79。
- **仍保留**:`smoke_compat_{core,imgui,imgui_window,archive,portable}.sh`(imgui/glfw 需显示、
libarchive/zlib 更广矩阵)——迁成 headless `mcpp test` 成员是后续增量,本期先转 5 个 headless 成员。
- **发现**:feature 编出的依赖目标(eigen_blas 的 dgemm_)链不进 test 二进制(member 是 bin 时可以)
→ eigen 暂测 header-only,feature-link-into-tests 待 mcpp 侧修。
76 changes: 76 additions & 0 deletions .agents/docs/2026-06-30-complete-test-ci-rearchitecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# mcpp-index: complete test + CI rearchitecture (zero shell)

Supersedes the heredoc smoke scripts and their bespoke CI jobs. The index's
**entire** library-test surface becomes a mcpp `[workspace]` of real per-library
test projects, run by `mcpp test --workspace` per platform. No `.sh` drivers.

## Why now / what unblocks it

The old `smoke_compat_portable.sh` carried a bash harness only because it had to
synthesize per-OS toolchains + ldflags at runtime. **mcpp 0.0.74+ shipped
`[target.'cfg(...)']`** (conditional build flags 0.0.74, conditional deps 0.0.75),
and 0.0.79 added workspace-aware `mcpp test`. So per-OS config is now declarative
in static `mcpp.toml`, and the whole matrix runs as one command — the shell
harness has no remaining job.

## Member taxonomy (the complete test surface)

Each member is `tests/<name>/` = `[package]` + `[dependencies] compat.<lib>` +
`tests/*.cpp` behavioral assertions (no `src/`). Migrated faithfully from the
smoke scripts' heredoc projects.

| member | libraries (compat.*) | what it asserts | platforms |
|---|---|---|---|
| `cjson` | cjson | parse/serialize round-trip | all |
| `eigen` | eigen | header-only linear algebra | all |
| `nlohmann.json` | nlohmann.json (module) | dump/parse round-trip | all |
| `core` | gtest, ftxui, lua, mbedtls, opengl, khrplatform | gtest TEST, lua eval=42, mbedtls SHA256("abc"), ftxui in-memory render, GL constants | all (per-OS ldflags via cfg) |
| `archive` | libarchive, zlib, bzip2, lz4, xz, zstd | version probes + compress→decompress round-trip per codec | all |
| `imgui` | imgui (compat source) | in-memory ImGui frame → valid draw data | all |
| `imgui-module` | imgui (C++23 module) | `import imgui.core` + backend symbols + render | all (llvm pin) |
| `gui-stack` | glfw + xext/xrender/xfixes/xcursor/xinerama/xrandr/xi/xau/xdmcp/xcb/x11 | symbol linkage + `glfwInit` (tolerant) + version constants | linux (cfg) |
| `imgui-window` | imgui, glfw | **build+link only** (window run is opt-in, not headless CI) | linux (cfg) |
| `openblas` | openblas | cfg(windows) cblas_dgemm `[19 22;43 50]` | windows (cfg) |
| `build-mcpp` | — | build.mcpp generated source + define | all |

### Cross-platform via cfg (no bash)
- **Toolchain**: cross-platform members **omit `[toolchain]`** → mcpp auto-selects
the platform default (linux→gcc, macOS/Windows→llvm). `imgui-module` keeps an
llvm pin (C++23 modules). `gui-stack`/`imgui-window` are gcc-on-linux.
- **Per-OS link flags**: `[target.'cfg(linux)'.build] ldflags = ["-ldl","-lm"]`,
`[target.'cfg(macos)'.build] ldflags = ["-lm"]` (was `write_build_ldflags()`).
- **Platform-only members**: linux-only (`gui-stack`, `imgui-window`) gate their
deps under `[target.'cfg(linux)'.dependencies]` and compile a no-op `main()`
off-linux — the same pattern `openblas` uses for windows. So one
`mcpp test --workspace` runs everywhere; each member self-selects.

## CI (validate.yml) — rebuilt around `mcpp test`

Replace `smoke-full-linux` / `smoke-portable` / `smoke-examples` / `smoke-workspace`
with **one matrix job per OS**, each:
```yaml
- run: mcpp test --workspace # members self-gate by cfg
```
- **linux / macOS / windows** runners each run the whole workspace; platform-only
members no-op where inapplicable.
- **`detect`** still narrows PRs: a changed `pkgs/<lib>.lua` or `tests/<member>/**`
→ `mcpp test -p <member>` for just that member; push/schedule → full `--workspace`.
- **`smoke_compat_*.sh` deleted**; the registry/smoke download caches stay (keyed
the same).
- The display/GL **window run** is not part of headless CI; `imgui-window` builds +
links (the recipe-build is the test). An opt-in job may later run it under xvfb.

## Migration provenance (faithful)
Every assertion is lifted from the corresponding smoke heredoc:
`core`←smoke_compat_core, `archive`←smoke_compat_archive (both sub-projects),
`imgui`+`gui-stack`←smoke_compat_imgui (6 sub-projects split by concern),
`imgui-window`←smoke_compat_imgui_window, `imgui-module`←smoke_imgui_module,
and `smoke_compat_portable` dissolves into the cross-platform members above
(its per-OS logic → cfg).

## Known follow-ups (recorded, not blocking)
- Feature-built dependency objects not linking into test binaries (eigen_blas
`dgemm_`) — eigen tests header-only until fixed in mcpp.
- The actual GLFW/OpenGL **window** run needs a display; kept opt-in.
- macOS/Windows `gui-stack` equivalents (Cocoa/Win32) are out of scope (the X11
stack is linux-specific by nature).
Loading
Loading