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
51 changes: 51 additions & 0 deletions .agents/docs/2026-08-30-add-cmp-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Add mcpplibs.cmp 0.1.0

## Scope

- Register `mcpplibs.cmp@0.1.0` for Linux, macOS, and Windows.
- Add one import-only workspace consumer that executes a scheduled coroutine.
- Keep the upstream package manifest authoritative; do not duplicate its build graph in the index.

## Release evidence

- Release: `https://github.com/mcpplibs/cmp/releases/tag/v0.1.0`
- Tag commit: `31db013e85262e9688d69d5abca34d152d7430d2`
- Archive: `https://github.com/mcpplibs/cmp/releases/download/v0.1.0/cmp-0.1.0.tar.gz`
- Size: 207,197 bytes
- SHA-256: `17ab5e1e8fdef278d1e82eb62f0387a04e4e6d01f35408af1295de80304de1b9`

The release archive was downloaded independently twice; both downloads were byte-identical and had the recorded digest.
It contains `mcpp.toml`, `LICENSE`, and the `mcpplibs.cmp` module sources.

## Package shape and mirror

CMP is an external Form A module package: its release owns the C++23 module sources, dependency on
`chriskohlhoff.asio`, and its standalone default LLVM selection. The index descriptor therefore contains only package
metadata and the three-platform release location. There is no index-level optional source component, so no feature is added.

No separately authorized `mcpp-res` mirror exists for this release. Following the repository's documented fallback and
the `tensorvia-cpu` precedent, all platforms use the same plain-string GitHub Release URL. A maintainer can add a
byte-identical CN mirror later without changing the version or digest.

## Consumer and verification

`tests/examples/cmp-module` redirects the default namespace to this checkout, imports `mcpplibs.cmp`, schedules a lazy
`Task<int>` through `RunLoop`, and fails unless the result is 42. It performs no external network access.

Required gates:

- descriptor Lua syntax, mirror policy, package identity, platform parity, duplicate-version lint, and
`mcpp xpkg parse` with CI-pinned mcpp `2026.8.27.2`;
- a clean `mcpp test -p cmp-module` with the same mcpp version and `MCPP_INDEX_MIRROR=GLOBAL`;
- GitHub Actions lint and Linux, macOS, and Windows selective workspace checks.

Local verification on 2026-08-30:

- all descriptor Lua, mirror, identity, cross-reference, platform-parity, duplicate-version, and CI-pinned resolver
checks passed;
- the cold GCC 16.1.0 run downloaded the release through this checkout, built CMP and the consumer, and passed
`runtime` (`1 passed; 0 failed`); its expected fresh-home runtime-binding warning disappeared on the repeat run;
- the matching Linux LLVM leg resolved LLVM 22.1.8, rebuilt CMP and the consumer, and passed `runtime`
(`1 passed; 0 failed`).

The three-platform GitHub Actions result remains pending until the PR runs.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A few descriptors worth opening first, one per common shape:

| Shape | Example | What it shows |
|------|------|------|
| Native module library (Form A) | [`mcpplibs.tinyhttps`](pkgs/t/tinyhttps.lua) · [`gzj-creator.galay`](pkgs/g/gzj-creator.galay.lua) | Upstream carries its own `mcpp.toml`; Galay also demonstrates a multi-module package with feature-scoped protocol layers |
| Native module library (Form A) | [`mcpplibs.cmp`](pkgs/c/cmp.lua) · [`mcpplibs.tinyhttps`](pkgs/t/tinyhttps.lua) · [`gzj-creator.galay`](pkgs/g/gzj-creator.galay.lua) | Upstream carries its own `mcpp.toml`; CMP demonstrates a coroutine runtime, while Galay demonstrates a multi-module package with feature-scoped protocol layers |
| C-source compat | [`compat.cjson`](pkgs/c/compat.cjson.lua) | One `.c` compiled into a lib; the optional extension sits behind a `features` gate |
| Header-only | [`compat.gtl`](pkgs/c/compat.gtl.lua) | Nothing to compile — `include_dirs` and an anchor TU |
| Whole-source build + generated config | [`compat.c-ares`](pkgs/c/compat.c-ares.lua) | The config header configure would have produced is snapshotted into `generated_files` |
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mcpp self config --mirror CN # 切换至国内镜像,默认使用 GLOBAL 上

| 形态 | 示例 | 看点 |
|------|------|------|
| 原生模块库(Form A) | [`mcpplibs.tinyhttps`](pkgs/t/tinyhttps.lua) · [`gzj-creator.galay`](pkgs/g/gzj-creator.galay.lua) | 上游自带 `mcpp.toml`;Galay 还展示了多模块包与按 feature 开启协议层 |
| 原生模块库(Form A) | [`mcpplibs.cmp`](pkgs/c/cmp.lua) · [`mcpplibs.tinyhttps`](pkgs/t/tinyhttps.lua) · [`gzj-creator.galay`](pkgs/g/gzj-creator.galay.lua) | 上游自带 `mcpp.toml`;CMP 展示协程运行时,Galay 展示多模块包与按 feature 开启协议层 |
| C 源码 compat | [`compat.cjson`](pkgs/c/compat.cjson.lua) | 单个 `.c` 编成库;可选扩展由 `features` 门控 |
| header-only | [`compat.gtl`](pkgs/c/compat.gtl.lua) | 没有可编译内容 —— `include_dirs` 加一个 anchor TU |
| 全源码直编 + 生成 config | [`compat.c-ares`](pkgs/c/compat.c-ares.lua) | 把 configure 本该生成的 config 头快照进 `generated_files` |
Expand Down
1 change: 1 addition & 0 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
"tests/examples/capi-lua",
"tests/examples/cjson",
"tests/examples/cmdline",
"tests/examples/cmp-module",
"tests/examples/cli11",
"tests/examples/concurrentqueue",
"tests/examples/concurrentqueue-c-api",
Expand Down
32 changes: 32 additions & 0 deletions pkgs/c/cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- Form A: the release ships its own mcpp.toml and module sources.
-- No mcpp-res mirror exists yet, so the upstream URL intentionally stays a string.
package = {
spec = "1",
namespace = "mcpplibs",
name = "cmp",
description = "A C++23 coroutine runtime project built with mcpp and C++ Modules",
licenses = {"Apache-2.0"},
repo = "https://github.com/mcpplibs/cmp",
type = "package",

xpm = {
linux = {
["0.1.0"] = {
url = "https://github.com/mcpplibs/cmp/releases/download/v0.1.0/cmp-0.1.0.tar.gz",
sha256 = "17ab5e1e8fdef278d1e82eb62f0387a04e4e6d01f35408af1295de80304de1b9",
},
},
macosx = {
["0.1.0"] = {
url = "https://github.com/mcpplibs/cmp/releases/download/v0.1.0/cmp-0.1.0.tar.gz",
sha256 = "17ab5e1e8fdef278d1e82eb62f0387a04e4e6d01f35408af1295de80304de1b9",
},
},
windows = {
["0.1.0"] = {
url = "https://github.com/mcpplibs/cmp/releases/download/v0.1.0/cmp-0.1.0.tar.gz",
sha256 = "17ab5e1e8fdef278d1e82eb62f0387a04e4e6d01f35408af1295de80304de1b9",
},
},
},
}
11 changes: 11 additions & 0 deletions tests/examples/cmp-module/mcpp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# A member-level redirect replaces the workspace root's compat redirect, so
# this test resolves mcpplibs.cmp from the current checkout.
[indices]
default = { path = "../../.." }

[package]
name = "cmp-module-tests"
version = "0.1.0"

[dependencies]
cmp = "0.1.0"
15 changes: 15 additions & 0 deletions tests/examples/cmp-module/tests/runtime.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import std;
import mcpplibs.cmp;

using mcpplibs::cmp::RunLoop;
using mcpplibs::cmp::Task;

Task<int> scheduled_answer(RunLoop::Scheduler scheduler) {
co_await scheduler.schedule();
co_return 42;
}

int main() {
RunLoop loop {};
return loop.run(scheduled_answer(loop.get_scheduler())) == 42 ? 0 : 1;
}
Loading