Skip to content

Commit ede7622

Browse files
committed
docs: update workspace/zero-shell design — cwd-spawn done in 0.0.79; Phase 2 findings
1 parent 7e5e4e8 commit ede7622

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.agents/docs/2026-06-30-workspace-test-and-zero-shell-index-design.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,21 @@ The index repo is simultaneously (a) the package index and (b) a mcpp workspace
160160
whose members really *use and test* every recipe — driven entirely by `mcpp`, no
161161
`.sh`. "基于 mcpp 自包含" achieved.
162162

163+
### Findings during Phase 2 (recorded)
164+
- **build.mcpp cwd bug** — fixed in 0.0.79 (see §6.1); the `build-mcpp` member
165+
drove it out (its `build.mcpp` wrote to the wrong dir under `-p`).
166+
- **Pure test projects work** — a member with only `[dependencies]` + `tests/*.cpp`
167+
(no `src/`) builds + tests cleanly; the dep's headers/lib reach the test binary.
168+
- **Feature-built dependency objects don't link into test binaries** — the eigen
169+
`eigen_blas` feature compiles Eigen's reference BLAS into compat.eigen's lib, but
170+
the test binary calling `dgemm_` fails to link it (worked when the member was a
171+
`bin`). The eigen member tests header-only Eigen for now; linking feature-gated
172+
dependency objects into `mcpp test` binaries is a separate mcpp follow-up.
173+
- **Display/GL smokes stay shell for now** — `smoke_compat_{imgui,imgui_window,
174+
glfw}` + the portable matrix need a display / broader libs; migrating them to
175+
headless `mcpp test` members is a later increment. Phase 2 converts the 5
176+
headless example members + switches their CI to `mcpp test`.
177+
163178
## 6. Typed `import mcpp;` library (task #20) — DEFERRED (own follow-up)
164179

165180
A typed module **bundled in the mcpp binary**, emitting the existing stdout
@@ -180,18 +195,17 @@ export namespace mcpp {
180195
**from the dir containing `gcm.cache/`**) → `import mcpp;` resolves; the binary
181196
emits the directives. No `import std;` needed.
182197

183-
**Why deferred (not in 0.0.79):** sound delivery needs two pieces this release
184-
won't rush:
185-
1. **cwd-capable spawn.** GCC C++ finds modules only via `gcm.cache/<m>.gcm`
186-
*relative to the compile CWD* — the named `-fmodule-file=mcpp=<path>` form is
187-
rejected ("valid for D but not for C++"), and `-fmodule-output=` is absent on
188-
GCC 16. So compiling `build.mcpp` must run with `cwd = target/.build-mcpp/`;
189-
`platform::process::capture_exec` has no `cwd` parameter yet (add one — child
190-
`chdir` after fork on POSIX / `lpCurrentDirectory` on Windows).
198+
**Why deferred (not in 0.0.79):** one remaining piece this release won't rush:
199+
1. ~~**cwd-capable spawn.**~~ **DONE in 0.0.79** — `capture_exec` gained a `cwd`
200+
parameter (Linux `posix_spawn_file_actions_addchdir_np`; else `cd … &&`), added
201+
for the build.mcpp-cwd correctness fix. This is exactly what the typed lib needs
202+
to stage `gcm.cache/<m>.gcm` (GCC C++ finds modules only relative to the compile
203+
CWD — the named `-fmodule-file=mcpp=<path>` form is rejected "valid for D not
204+
C++"; `-fmodule-output=` is absent on GCC 16). So the GCC path is now unblocked.
191205
2. **Clang path.** Clang uses `.pcm` + `--precompile` + `-fmodule-file=mcpp=<pcm>`
192206
(different ABI/flags), untested here. Without it, `build.mcpp` using
193207
`import mcpp;` on a Clang host (macOS/Windows) would fail to compile — a partial
194-
feature. Both compiler paths must land together.
208+
feature. Both compiler paths must land together → still a focused 0.0.80.
195209

196210
Plus: embed the module source in the binary, compile it **once** into
197211
`target/.build-mcpp/` keyed on the toolchain (cache; don't rebuild), then convert

0 commit comments

Comments
 (0)