Skip to content

feat: add mcpplibs.grpc 1.83.0 (Form A, grpc-m) - #151

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/add-grpc
Aug 4, 2026
Merged

feat: add mcpplibs.grpc 1.83.0 (Form A, grpc-m)#151
Sunrisepeak merged 1 commit into
mainfrom
feat/add-grpc

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The end of the gRPC track that #147 (abseil, protobuf), #148 (re2, the protobuf upb
feature) and #149 (c-ares) built toward. gRPC itself lands as a Form A descriptor
pointing at mcpplibs/grpc-m.

Why this one cannot be a compat descriptor

Every other heavy library here points at an upstream tarball. gRPC publishes none:

v1.83.0 release assets none at all
tag archive third_party/abseil-cpp 1 entry (empty submodule placeholder)
protobuf / re2 / boringssl-with-bazel / zlib 1 entry each

So there is nothing for url + sha256 to address. grpc-m's release tarball is that
artifact
: upstream's src/ and include/ vendored with zero patches, plus the two
third_party pieces gRPC really ships (address_sorting, xxhash).

What it does not vendor is why it belongs on this index rather than standing alone:
abseil, protobuf(+upb), re2, c-ares, OpenSSL and zlib all come from the packages here,
so a consumer that also uses protobuf or abseil directly links one copy instead of
colliding with a second vendored set.

No CMake, no Bazel, no configure — checked, not assumed

gRPC's tree contains no .h.in or config.h.cmake, and its generated upb code is
checked in upstream, so mcpp needs only include paths. All 1001 TUs are compiled by
the resolved toolchain, so nothing inherits a foreign C++ ABI the way an
install()-driven CMake build would — which is exactly what ruled that route out for
gRPC (.agents/docs/2026-08-04-grpc-feasibility-analysis.md §2.1).

The source list is upstream's own — the union of add_library(gpr), grpc, grpc++
and address_sorting — and grpc-m's tools/gen_sources.py --check runs in that repo's CI
to prove the manifest has not drifted from the vendored tree. One file is excluded:
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c, byte-for-byte
identical
to the bootstrap copy compat.protobuf's upb feature compiles.

linux + macOS only

The reason is a dependency, not gRPC: compat.openssl has no windows xpm entry, so
resolution there fails with E_NOT_FOUND before anything compiles, and gRPC's secure
build cannot drop TLS. The member is gated the way tests/examples/openssl already is —
cfg-gated dependency, no-op main() on windows. #150 is the fix for the underlying
gap
, and grpc-m already carries its windows flags for the day it lands.

The member

It drives import grpc; only and carries no protoc output: gRPC's codegen needs host
tools mcpp cannot hand a consumer (mcpp::dep_dir() gives a package's source dir, and
kind = "bin" targets are not exposed), so grpc-m's own examples/helloworld covers the
generated-stub path while this member covers the module surface. It asserts the error path
too — a Status that is not ok — so an always-OK stub could not pass.

Verification

Pinned mcpp 2026.8.3.3, gcc@16.1.0, MCPP_BUILD_CACHE=local, target/ and .mcpp/
removed first. The package downloads from the descriptor's real release tarball and sha:

Compiling mcpplibs.grpc v1.83.0
grpc::Version() = 1.83.0
grpc module: OK
test result ok. 1 passed; 0 failed; finished in 247.85s

grpc-m's own CI is green on both platforms for the tagged commit (linux 54m21s, macOS
29m49s), where examples/helloworld stands a real server on a loopback port and makes a
real unary RPC — including the error path, which crosses the wire as INVALID_ARGUMENT.

CN mirror published and closed-loop checked: mcpp-res/grpc@1.83.0 returns http=200 and
is byte-identical to GLOBAL.

Full write-up: .agents/docs/2026-08-05-add-grpc-plan.md.

The end of the gRPC track that #147 (abseil, protobuf), #148 (re2, the protobuf
`upb` feature) and #149 (c-ares) built toward. gRPC itself lands as a Form A
descriptor pointing at mcpplibs/grpc-m.

WHY THIS ONE CANNOT BE A COMPAT DESCRIPTOR. Every other heavy library here
points at an upstream tarball. gRPC publishes none: v1.83.0 has no release
assets at all, and its tag archive carries abseil, protobuf, re2, boringssl and
zlib as EMPTY submodule placeholders — one directory entry each — so there is
nothing for url+sha256 to address. grpc-m's release tarball IS that artifact:
upstream's src/ and include/ vendored with zero patches, plus the two
third_party pieces gRPC really ships (address_sorting, xxhash).

What it does NOT vendor is why it belongs on this index rather than standing
alone: abseil, protobuf(+upb), re2, c-ares, OpenSSL and zlib all come from the
packages here, so a consumer that also uses protobuf or abseil directly links
ONE copy instead of colliding with a second vendored set.

No CMake, no Bazel, no configure step — checked, not assumed: gRPC's tree
contains no .h.in or config.h.cmake, and its generated upb code is checked in
upstream, so mcpp needs only include paths. All 1001 TUs are compiled by the
resolved toolchain, so nothing inherits a foreign C++ ABI the way an
install()-driven CMake build would (which is what ruled that route out for
gRPC in the first place).

The source list is upstream's own — the union of add_library(gpr), grpc, grpc++
and address_sorting — and grpc-m's tools/gen_sources.py --check runs in that
repo's CI to prove the manifest has not drifted from the vendored tree. One file
is excluded: src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c,
byte-for-byte identical to the bootstrap copy compat.protobuf's `upb` feature
compiles.

LINUX + MACOS ONLY, and the reason is a dependency rather than gRPC:
compat.openssl has no windows xpm entry, so resolution there fails with
E_NOT_FOUND before anything compiles, and gRPC's secure build cannot drop TLS.
The member is gated the way tests/examples/openssl already is — cfg-gated
dependency, no-op main() on windows. #150 is the fix for the underlying gap.

The member drives `import grpc;` only and carries no protoc output: gRPC's
codegen needs host tools mcpp cannot hand a consumer, so grpc-m's own
examples/helloworld covers the generated-stub path while this member covers the
module surface. It asserts the error path too (a Status that is NOT ok), so an
always-OK stub could not pass.

Verified with the pinned mcpp 2026.8.3.3, gcc@16.1.0, MCPP_BUILD_CACHE=local,
target/ and .mcpp/ removed first — the package downloads from the descriptor's
real release tarball and sha:

  Compiling mcpplibs.grpc v1.83.0
  grpc::Version() = 1.83.0
  grpc module: OK
  test result ok. 1 passed; 0 failed; finished in 247.85s

grpc-m's own CI is green on both platforms for the tagged commit (linux 54m21s,
macOS 29m49s), where examples/helloworld stands a real server on a loopback
port and makes a real unary RPC. CN mirror published and closed-loop checked:
mcpp-res/grpc@1.83.0 returns http=200 and is byte-identical to GLOBAL.
@Sunrisepeak
Sunrisepeak merged commit 3331eb1 into main Aug 4, 2026
5 checks passed
Sunrisepeak added a commit that referenced this pull request Aug 6, 2026
* feat: 包身份规范化 —— 上游库归上游命名空间,版本对齐上游

判据两条:**命名空间说的是这个库是谁的,不是谁打的包;版本说的是你拿到的是哪一版
上游。** 规则与全量迁移表见 #163。

    mcpplibs:imgui@0.0.6     → ocornut:imgui@1.92.8
    mcpplibs:ffmpeg@0.0.3    → ffmpeg:ffmpeg@8.1.2
    mcpplibs:opencv@0.0.10   → opencv:opencv@5.0.0
    mcpplibs:llamacpp@0.1.0  → ggml-org:llamacpp@b10069
    mcpplibs:grpc@1.83.0     → grpc:grpc@1.83.0

新增两个包(gRPC codegen 链路):`grpc:grpc-plugin`(上游 src/compiler/*,作为 host
tool)与 `mcpplibs:grpcgen`(本生态自己写的构建规则,故留在 mcpplibs)。两者的
manifest 在归档子目录里,默认查找够不到两级,用显式 `mcpp = "*/…/mcpp.toml"` 指针。

**旧条目冻结保留而非删除** —— 已在用它们的消费者继续解析得到,新版本只在新条目下
发布。grpc 是例外:它 2026-08-05 才进索引(#151),满打满算一天,唯一消费者是本仓成
员,为一天的历史留永久重复条目不划算,故就地迁移。

`mcpplibs` 只剩名副其实的那些(cmdline / tinyhttps / llmapi 等)。

## MCPP_VERSION 抬到 2026.8.6.1 是前置,不是顺手升级

本次对齐把 module 层与 compat 的版本变成相同,于是踩到了 mcpp 的一个既有 bug:
`install_path` 的 legacy 扫描匹配任何 `-x-<shortName>` 结尾的目录、不看命名空间,查
`ocornut:imgui@1.92.8` 会拿到 `compat-x-imgui/1.92.8`。mcpp#364 修掉了它。

`index.toml` 的 min_mcpp **不动**:会撞的两个 compat 邻居都是 Form B,旧客户端撞上
时是响亮报错而不是静默用错包;下限是让整个索引对旧客户端失效的闸门(#349),只该在
描述符真的读不动时抬。

## 成员

五个成员的 `[indices]` 键与依赖段跟着迁 —— 索引表按命名空间取键,包搬走了而键没搬,
被测的就不再是这个 checkout(静默回落到线上索引)。

## 已知缺口

`grpc-plugin` 与 `grpcgen` 没有成员覆盖。它们需要 `grpc` 与 `mcpplibs` 两个命名空间
同时从 checkout 解析,而"每个成员至多一个项目索引"是硬约束(#238)。描述符发布之后
再补一个 codegen 成员;在此之前该链路由 grpc-m 自己的 CI 覆盖(examples/greeter 经
grpcgen 生成 stub 并跑通真实 RPC)。

* fix: 表形式的依赖版本没跟着迁,并补上整个漏掉的 llamacpp-metal

CI 抓到三个分片红在 `opencv.opencv@0.0.10` / `@0.0.9` —— 命名空间迁了、版本没迁。
原因是我的替换只写了裸字符串形式 `opencv = "0.0.10"`,而这两个成员用的是表形式
`opencv = { version = "0.0.10", features = ["dnn"] }`。**为一种语法形式写替换,却假
设它覆盖了全部。**

于是不再逐个猜,改用全量扫描找残留 —— 结果比 CI 报的更多:`llamacpp-metal` 根本
不在我上一轮的成员清单里,`[indices]` 键、依赖段、版本三处都没迁。

修复过程中我自己又引入一个:那条 `version = "0.1.0"` 的无差别替换把成员**自身**的包
版本也改成了 b10069。是靠"每个成员的 [indices] 键必须与其依赖段命名空间一致"这条普
查发现的,不是靠信任修复。已还原为 0.1.0。

复核:
* 残留扫描清零
* 全成员 indices 键与依赖命名空间逐一对齐
* 三个被改文件的包自身版本均为 0.1.0
* lint(语法 / 身份形态 / mirror urls)PASS
* 七个迁移描述符的版本键覆盖三平台;grpc 是 2 平台,这是它 compat.openssl 无
  windows 条目的既有例外,不是遗漏
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant