[M4] add exec::run subprocess wrapper

This commit is contained in:
2026-05-09 23:54:01 +00:00
parent 219254a1dd
commit 807158b8cc
6 changed files with 264 additions and 1 deletions

View File

@@ -78,6 +78,15 @@ All notable changes to cargoxx will be documented in this file.
and `[build]` honoring `warnings_as_errors` and `sanitizers`. Source
paths emitted relative to `build/` (i.e. prefixed with `../`).
Output is deterministic. `tests/codegen_cmake.cpp` covers 11 cases.
- `cargoxx.exec`: `ExecResult`, `ExecOptions`, and
`run(program, args, opts)` — argv-only subprocess wrapper around
reproc 14.2.4. Captures stdout/stderr (or inherits stdio when
`opts.inherit_stdio` is set), supports `cwd`, `env_overrides`, and a
`timeout` (enforced via `reproc_options.deadline` so drains return
`REPROC_ETIMEDOUT` instead of blocking on long-lived streams). On
destruction reproc terminates and then kills any still-running child.
Returns `ExecToolNotFound` for `ENOENT` and `ExecCommandFailed` for
other failures including timeouts. `tests/exec_run.cpp` covers 9 cases.
- `cargoxx build --no-build` end-to-end. Reads `Cargoxx.toml`,
discovers the layout, opens the curated linkdb, resolves a `Recipe`
per manifest dep, synthesizes a fresh `Cargoxx.lock`, and writes