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
41 changes: 33 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ env:
# and `rerun_if_changed_glob`, without which generate_all()
# would not re-run when a .proto is ADDED (no declared file's
# hash changes), silently never generating it
MCPP_VERSION: "2026.10.24.1"
MCPP_VERSION: "2026.11.18.1"
# Until mcpp-index publishes compat.openssl 3.5.9 (mcpplibs/mcpp-index#845),
# this revision resolves against that PR's candidate commit: the complete,
# unchanged index layout becomes the built-in index of the run's home.
# Drop the pin (and the step that reads it) once the index has published it.
MCPP_INDEX_CANDIDATE: "7359195426993b43217bd07d02454e61c15abf31"

jobs:
build:
Expand All @@ -45,12 +50,8 @@ jobs:
include:
- { name: "linux x86_64", os: ubuntu-latest, suffix: linux-x86_64, ext: tar.gz, mcpp: bin/mcpp }
- { name: "macos arm64", os: macos-latest, suffix: macosx-arm64, ext: tar.gz, mcpp: bin/mcpp }
# No windows leg: compat.openssl has no windows xpm entry yet, so
# dependency resolution fails there before anything is compiled
# ("E_NOT_FOUND: package 'compat:openssl@3.5.1' not found"). gRPC's
# secure build cannot drop TLS, so this package is linux + macOS
# until that package gains windows support. Re-add this line then —
# the windows flags in mcpp.toml are already in place.
# No windows leg yet: the package builds and links there, but the
# runtime aborts at startup (see the platforms comment in mcpp.toml).
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -82,6 +83,17 @@ jobs:
run: |
"$MCPP" index update

- name: Candidate index (mcpp-index#845)
shell: bash
run: |
# No early exit in awk: mcpp would take SIGPIPE, and pipefail report it.
home=$("$MCPP" self env | awk -F'= *' '/^MCPP_HOME/ && !h {h = $2} END {print h}')
test -n "$home"
git init -q "$RUNNER_TEMP/index"
git -C "$RUNNER_TEMP/index" fetch -q --depth 1 https://github.com/mcpplibs/mcpp-index "$MCPP_INDEX_CANDIDATE"
git -C "$RUNNER_TEMP/index" checkout -q FETCH_HEAD
python3 "$RUNNER_TEMP/index/tests/prepare_builtin_index.py" --home "$home"

# The pinned client includes the object-layout cache fix (2026.8.3.4).
# Reuse SDK objects between actual consumers; every example still builds
# its own generated sources and executes its runtime checks.
Expand Down Expand Up @@ -151,6 +163,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# The plugin generates code that calls gRPC internals, so a plugin built
# from a different release than the runtime being linked is exactly the
# mismatch this whole design exists to make impossible. The rule package
Expand All @@ -167,11 +181,22 @@ jobs:
plugin = tomllib.loads(Path("plugin/mcpp.toml").read_text())["package"]
rule = tomllib.loads(Path("rules/mcpp.toml").read_text())["package"]
upstream = runtime["metadata"]["mwrap"]["upstream-version"]
assert runtime["version"] == upstream == "1.83.0"
# The runtime carries its own wrapper revisions (1.83.0.1: compat.openssl
# 3.5.9). The host tools stay 1.83.0.1, the entries the index already
# serves from the mwrap-1.83.0 archive, so their directories must not
# change: the step below proves it.
assert upstream == "1.83.0"
assert runtime["version"] in (upstream, upstream + ".1"), runtime["version"]
assert plugin["version"] == rule["version"] == upstream + ".1"
print("runtime", runtime["version"], "host tools", plugin["version"], "same pinned source")
PYVERS

- name: host tools unchanged since the archive the index serves them from
shell: bash
run: |
git diff --exit-code mwrap-1.83.0 -- plugin rules
echo "plugin/ and rules/ are byte-identical to mwrap-1.83.0"

# rules/mcpp.toml states that the package name and the module name are
# kept EQUAL, and that this is what makes the package work on every
# engine. Nothing enforced it: the check above compares versions.
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ concurrency:
group: templates-${{ github.ref }}
cancel-in-progress: true
env:
MCPP_VERSION: "2026.10.24.1"
MCPP_VERSION: "2026.11.18.1"
# See ci.yml: compat.openssl 3.5.9 from mcpp-index#845 until it is published.
MCPP_INDEX_CANDIDATE: "7359195426993b43217bd07d02454e61c15abf31"
jobs:
templates:
runs-on: ubuntu-latest
Expand All @@ -37,6 +39,11 @@ jobs:
run: |
mcpp toolchain install gcc 16.1.0
mcpp toolchain install llvm 23.1.3
- name: Candidate index (mcpp-index#845)
run: |
git init -q "$RUNNER_TEMP/index"
git -C "$RUNNER_TEMP/index" fetch -q --depth 1 https://github.com/mcpplibs/mcpp-index "$MCPP_INDEX_CANDIDATE"
git -C "$RUNNER_TEMP/index" checkout -q FETCH_HEAD
- name: Actual scaffold, strict build and runtime behavior
run: |
python3 tools/test_template.py --toolchain llvm@23.1.3 --namespace grpc
python3 tools/test_template.py --toolchain llvm@23.1.3 --namespace grpc --index "$RUNNER_TEMP/index"
2 changes: 1 addition & 1 deletion .xlings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"workspace": {
"xim:mcpp": "2026.10.24.1"
"xim:mcpp": "2026.11.18.1"
}
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
## Quick Start

```sh
mcpp new greeter --template mcpplibs.mwrap.grpc@1.83.0
mcpp new greeter --template mcpplibs.mwrap.grpc@1.83.0.1
cd greeter
mcpp run
```

```toml
[dependencies]
mcpplibs.mwrap.grpc = { version = "1.83.0", features = ["codegen"] }
mcpplibs.mwrap.grpc = { version = "1.83.0.1", features = ["codegen"] }
```

## Two ways to use it
Expand All @@ -50,7 +50,7 @@ Use `grpcgen::generate_all`, `plan_all` and `submit` for import paths, plugins a

## Platform support

Runtime: Linux/macOS. Windows runtime is unavailable through the current OpenSSL provider; host tools are tested separately.
Linux and macOS. TLS comes from compat.openssl 3.5.9 (since 1.83.0.1), the OpenSSL that `mcpplibs.mwrap.openssl` wraps, so a program using both links one OpenSSL. On Windows the package builds and links, but the runtime aborts at startup; Windows is not supported yet.

## Features

Expand Down
6 changes: 3 additions & 3 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
## 快速开始

```sh
mcpp new greeter --template mcpplibs.mwrap.grpc@1.83.0
mcpp new greeter --template mcpplibs.mwrap.grpc@1.83.0.1
cd greeter
mcpp run
```

```toml
[dependencies]
mcpplibs.mwrap.grpc = { version = "1.83.0", features = ["codegen"] }
mcpplibs.mwrap.grpc = { version = "1.83.0.1", features = ["codegen"] }
```

## 两种使用方式
Expand All @@ -50,7 +50,7 @@ import mcpplibs.mwrap.grpc;

## 平台支持

运行时支持 Linux/macOS;当前 OpenSSL 供应者未支持 Windows 运行时,宿主工具单独测试。
Linux、macOS。TLS 来自 compat.openssl 3.5.9(自 1.83.0.1 起),即 `mcpplibs.mwrap.openssl` 封装的同一 OpenSSL,两者同用时只链接一份。Windows 上可以编译并链接,但运行时在启动时中止,暂不支持。

## 特性

Expand Down
15 changes: 8 additions & 7 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,13 @@ Three properties this buys, none of which hand-managed codegen can offer:

## Platform support

**linux and macOS.** Not a gRPC limitation: `compat.openssl` has no windows entry yet
("windows deferred — requires prebuilt MSVC libs"), so on windows dependency resolution
fails with `E_NOT_FOUND: package 'compat:openssl@3.5.1' not found` before anything is
compiled. gRPC's secure build cannot drop TLS, so this package's coverage is exactly
that dependency's. The windows compile/link flags are already in `mcpp.toml`, ready for
the day that entry lands.
**linux and macOS.** gRPC's secure build cannot drop TLS, so this package's coverage
starts from `compat.openssl`'s, which now includes windows (VC-WIN64A + nmake). On
windows this package compiles and links (clang, MSVC ABI), but the runtime aborts at
startup (exit 133, a breakpoint trap) before the first line of the module test, so
windows is not claimed until that is diagnosed on a windows host. Since 1.83.0.1 the
OpenSSL is compat.openssl 3.5.9 (3.5 LTS), the same one `mcpplibs.mwrap.openssl` wraps,
so a program that uses both links one OpenSSL.

## Features

Expand Down Expand Up @@ -253,7 +254,7 @@ The module layer and build glue are Apache-2.0, matching vendored gRPC
## Current-client quickstart candidate

The wrapper revision is `1.83.0.1`; the upstream C/C++ API and published module
identity stay unchanged. Development tooling uses mcpp `2026.10.24.1`. Templates
identity stay unchanged. Development tooling uses mcpp `2026.11.18.1`. Templates
now write one qualified dependency from `self.name`, without repeating a namespace.

```sh
Expand Down
10 changes: 5 additions & 5 deletions docs/usage.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ GENERATE protoc:orders (+grpc +mock, -Iproto -I../shared-proto)

## 平台支持

**linux 与 macOS。** 这不是 gRPC 的限制:`compat.openssl` 目前没有 windows 条目
(其描述符写着 "windows deferred —— 需要预编译的 MSVC 库"),因此在 windows 上依赖解析
会直接失败 —— `E_NOT_FOUND: package 'compat:openssl@3.5.1' not found`,还没开始编译。
gRPC 的 secure 构建无法去掉 TLS,所以本包的平台覆盖面就等于该依赖的覆盖面。
windows 所需的编译/链接选项已经写在 `mcpp.toml` 里,等那个条目落地即可启用。
**linux 与 macOS。** gRPC 的 secure 构建无法去掉 TLS,本包的覆盖面以 `compat.openssl`
为起点;后者现已支持 windows(VC-WIN64A + nmake)。本包在 windows 上可以编译并链接
(clang、MSVC ABI),但运行时在启动时中止(exit 133,断点陷阱),模块测试连第一行都未输出,
因此在 windows 主机上查明原因前不声明支持。自 1.83.0.1 起 OpenSSL 为 compat.openssl
3.5.9(3.5 LTS),与 `mcpplibs.mwrap.openssl` 封装的是同一份,两者同用时只链接一份 OpenSSL。

## Features

Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"mcpplibs.mwrap.grpc" = { path = "../.." }
mcpplibs.mwrap.grpc = { path = "../.." }
grpc-plugin = { path = "../../plugin", tools = ["grpc_cpp_plugin"] }

[dependencies.mcpplibs]
Expand Down
2 changes: 1 addition & 1 deletion examples/greeter/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"mcpplibs.mwrap.grpc" = { path = "../.." }
mcpplibs.mwrap.grpc = { path = "../.." }
# The gRPC C++ codegen plugin — a package of its own rather than a target
# inside gRPC, because a code generator needs a .proto parser and a C++
# emitter, not TLS, DNS and a regex engine.
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"mcpplibs.mwrap.grpc" = { path = "../.." }
mcpplibs.mwrap.grpc = { path = "../.." }
# The two host tools. `grpc-plugin` is a package separate from `grpc` on
# purpose: a code generator needs a .proto parser and a C++ emitter, not TLS,
# DNS and a regex engine — see the design doc §2.
Expand Down
26 changes: 14 additions & 12 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
[package]
namespace = "mcpplibs.mwrap"
name = "grpc"
version = "1.83.0"
version = "1.83.0.1"
standard = "c++23"
description = "gRPC 1.83.0 for mcpp — upstream C++ source vendored and built by this manifest, with abseil / protobuf / re2 / c-ares / OpenSSL taken from mcpp-index instead of re-vendored."
license = "Apache-2.0"
authors = ["mcpp-community"]
repo = "https://github.com/mcpplibs/grpc-m"

# linux + macOS only, and the reason is a dependency rather than gRPC itself:
# compat.openssl has no windows xpm entry ("windows deferred — requires prebuilt
# MSVC libs"), so resolution fails there with
# E_NOT_FOUND: package 'compat:openssl@3.5.1' not found
# before a single TU is compiled. gRPC's secure build cannot drop TLS, so this
# package's platform coverage is exactly compat.openssl's. The
# [target.'cfg(windows)'] flags below are kept and correct — they are what this
# package will need the day that entry lands.
# linux + macOS. compat.openssl now builds on Windows (VC-WIN64A + nmake), and
# so does this package: every TU compiles and the tests link there (CI run
# 44529764177, clang 23.1.3, MSVC ABI). But the runtime aborts at startup on
# Windows (exit 133, a breakpoint trap, before the module test prints a line),
# so Windows is not claimed until that is diagnosed on a Windows host. The
# [target.'cfg(windows)'] flags below are upstream's MSVC set.
#
# 1.83.0.1 (wrapper revision): compat.openssl 3.5.9 (3.5 LTS) instead of 3.5.1,
# the same OpenSSL as mcpplibs.mwrap.openssl 3.5.9, so a program that uses
# both links one OpenSSL. The gRPC source, modules and API are unchanged.
platforms = ["linux", "macos"]

# ─────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -1102,7 +1104,7 @@ kind = "lib"
compat.abseil = "20250512.1"
compat.protobuf = { version = "35.1", features = ["upb"] }
compat.re2 = "2022-04-01"
compat.openssl = "3.5.1"
compat.openssl = "3.5.9"
# gRPC's own message compression (src/core/lib/compression/message_compress.cc
# calls deflate/inflate directly), NOT protobuf's optional gzip streams — this
# is why the dependency is here rather than compat.protobuf's `gzip` feature.
Expand Down Expand Up @@ -1142,7 +1144,7 @@ compat.c-ares = "1.34.5"
# Turning it on gives the consumer the whole toolchain — protoc, the
# gRPC C++ plugin, and the rule that drives them — so its mcpp.toml says
#
# grpc = { version = "1.83.0", features = ["codegen"] }
# grpc = { version = "1.83.0.1", features = ["codegen"] }
#
# and its build.mcpp says `grpcgen::generate_all()`. Nothing else. Which tools
# gRPC codegen needs is this package's knowledge, not its user's; before
Expand Down Expand Up @@ -1173,7 +1175,7 @@ grpc.grpc-plugin = { path = "plugin", tools = ["grpc_cpp_plugin"], reexport = t
# small rule package makes it available to a consumer build.mcpp; the expensive
# protoc/plugin tools above remain conditional on codegen.
[build-dependencies]
"mcpplibs.grpcgen" = { path = "rules", host-module = true, reexport = true }
mcpplibs.grpcgen = { path = "rules", host-module = true, reexport = true }

[target.'cfg(windows)'.build]
cxxflags = [
Expand Down
2 changes: 1 addition & 1 deletion templates/greeter/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ main = "src/main.cpp"
# UPSTREAM gRPC code: a namespace names whose library it is, not who packaged
# it.
[dependencies]
"{{self.name}}" = { version = "{{self.version}}", features = ["codegen"] }
{{self.name}} = { version = "{{self.version}}", features = ["codegen"] }
9 changes: 6 additions & 3 deletions tools/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ def main():
project = temporary / "quickstart"
manifest = project / "mcpp.toml"
text = manifest.read_text()
dependency = tomllib.loads(text)["dependencies"][identity]
dependency = tomllib.loads(text)["dependencies"]
for part in identity.split("."):
dependency = dependency[part]
options = {"version": dependency} if isinstance(dependency, str) else dependency
assert options["version"] == version, options
replacement = '{ path = ' + json.dumps(package.as_posix())
if options.get("features"):
replacement += ', features = ' + json.dumps(options["features"])
replacement += ' }'
lines = text.splitlines()
matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")]
# The selector as one dotted key, unquoted (mcpp 2026.11.8.1 and later read a quoted one as deprecated).
matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")]
assert len(matches) == 1, "Expected exactly one qualified dependency from self.name"
lines[matches[0]] = json.dumps(identity) + " = " + replacement
lines[matches[0]] = identity + " = " + replacement
manifest.write_text("\n".join(lines) + "\n")
if args.index:
candidate_index = args.index.resolve()
Expand Down
Loading