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
376 changes: 376 additions & 0 deletions .agents/docs/2026-11-19-add-openssl-abseil-protobuf-mwrap-plan.md

Large diffs are not rendered by default.

37 changes: 35 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,16 @@ jobs:
# macos stays at 2. It has never been cancelled, so raising it would
# be a prediction rather than a measurement; the formula's 4 is there
# the day it is.
#
# ── 2026-11-20: macos 2 -> 3 ────────────────────────────────────
#
# Observed: on mcpp-index#845 `workspace (macos default 1/2)` was
# cancelled at the 90-minute cap. It carried grpc-cpu (1783s, untimed
# for macos and so priced at the default) and grpc-protobuf-stack,
# whose graph builds gRPC again (cancelled at unit 1800 of 1989).
# Both now have macos rows; three shards put them apart.
ln=$(shards_for linux 6)
mn=$(shards_for macos 2)
mn=$(shards_for macos 3)
wn=$(shards_for windows 5)
# THE TWO LINUX LEGS ARE NOT THE SAME COST, AND THE PLANNER CANNOT
# SEE THAT. `plan_shards.lua` takes a PLATFORM and reads one timing
Expand Down Expand Up @@ -1281,7 +1289,7 @@ jobs:
tar -xzf "$archive"
echo "MCPP=$PWD/mcpp-${MCPP_VERSION}-${{ matrix.suffix }}/bin/mcpp" >> "$GITHUB_ENV"
- name: Immutable archive, default scaffold, strict build and loopback RPC
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.grpc@1.83.0 --toolchain "${{ matrix.toolchain }}"
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.grpc@1.83.0.1 --toolchain "${{ matrix.toolchain }}"

workspace:
# The shard suffix appears only when the platform is actually split, and
Expand Down Expand Up @@ -1779,6 +1787,31 @@ jobs:
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.recastnavigation@1.6.0 --deploy

- name: Installed abseil wrapper archive, actual default basics template and its relocated notices
if: contains(format(' {0} ', env.MEMBERS), ' abseil-basics ') && matrix.toolchain == 'default'
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.abseil@20250512.1 --deploy

- name: Installed protobuf wrapper archive, actual default message template and its relocated notices
if: contains(format(' {0} ', env.MEMBERS), ' protobuf-message ') && matrix.toolchain == 'default'
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.protobuf@35.1 --deploy

- name: Installed protobuf wrapper archive, codegen template (protoc through the protogen rule)
if: contains(format(' {0} ', env.MEMBERS), ' protobuf-codegen ') && matrix.toolchain == 'default' && runner.os != 'Windows'
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.protobuf@35.1 --template codegen

- name: Installed OpenSSL wrapper archive, actual default digest template and its relocated notices
if: contains(format(' {0} ', env.MEMBERS), ' openssl-tls ') && matrix.toolchain == 'default'
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.openssl@3.5.9 --deploy

- name: Installed OpenSSL wrapper archive, tls-loopback template (TLS 1.3 over memory BIOs)
if: contains(format(' {0} ', env.MEMBERS), ' openssl-tls ') && matrix.toolchain == 'default'
shell: bash
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.openssl@3.5.9 --template tls-loopback

- name: Installed ACL wrapper archive, actual default clip template and its relocated notices
if: contains(format(' {0} ', env.MEMBERS), ' acl-clip ') && matrix.toolchain == 'default'
shell: bash
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@

### Added

- **mcpplibs.mwrap.openssl 3.5.9、mcpplibs.mwrap.abseil 20250512.1、mcpplibs.mwrap.protobuf 35.1、mcpplibs.protogen 35.1(新包),
mcpplibs.mwrap.grpc 1.83.0.1。** 三个新的 mwrap 封装,都是 compat 之上的薄封装,版本与上游一致:
openssl-m(OpenSSL 3.5 LTS:头文件的全部声明以 `using` 导出,334 个 `static ossl_inline` 函数重新声明,11632 个常量与 510 个
调用宏映射到 `mcpplibs::mwrap::openssl::macros`,其余宏由 `<mwrap/openssl/macros.hpp>` 提供;导出面记录在 `src/surface.tsv`,
由包的 build.mcpp 在构建时生成模块单元;Linux x86_64、Linux aarch64(LLVM)、macOS、Windows),abseil-m(Abseil LTS
20250512.1,按上游功能分组的子模块;Linux、macOS、Windows、Web),protobuf-m(Protocol Buffers 35.1:消息、描述符、反射、
知名类型、JSON 与文本格式、运行时解析 .proto;特性 `gzip`、`upb`、`codegen`;Linux、macOS、Windows、Web,`codegen` 仅
Linux 与 macOS)。protogen 是 protobuf-m 发布包中的 `rules/` 包:可 import 的 protoc 构建规则,每个 .proto 一条构建边,
`codegen` 特性转发它。grpc 1.83.0.1 是封装修订:改用 compat.openssl 3.5.9,与 openssl-m 同一 OpenSSL;gRPC 源码、模块与
API 不变,grpcgen 与 grpc-plugin 不变。四者共用 compat.abseil 20250512.1、compat.protobuf 35.1 与 compat.openssl 3.5.9,
同一程序只链接一份;成员 `grpc-protobuf-stack` 在一个翻译单元中 import 四者并核对 `absl::Status` 同一、OpenSSL 为 3.5.9。
GCC 16 下同时 import protobuf 与 Abseil 时,import Abseil 的分组模块而非根模块(根模块带入 `abseil.log`,GCC 随后读取模块失败),
且不在命名空间作用域对 protobuf 调用取 decltype(GCC 报告 descriptor.h 成员 "conflicting type for imported declaration");
Clang 两种写法都接受。GitHub 与 GitCode(mcpp-res/mwrap-openssl、mwrap-abseil、mwrap-protobuf、mwrap-grpc)字节一致。
- **compat.openssl 3.5.9(3.5 LTS)。** 三个平台新增 3.5.9,3.5.1 保留;compat.curl、compat.httplib、compat.websocket、
compat.jwt-cpp、chriskohlhoff.asio 改用 3.5.9,compat.mysql-connector-cpp 26.7.0 以修订 1 改用 3.5.9。仍固定 3.5.1 的已发布
清单(如 yizhinailong.mcr 0.1.5)与它们同图时版本不可调和:在工作区根的 `[workspace.dependencies]` 写
`compat.openssl = { version = "3.5.9", override = true }` 选定一份(本仓库根 mcpp.toml 即如此)。
- **mwrap 规范。** 上游库名取库本身的名字,不含仅区分语言的仓库后缀(abseil-cpp → abseil-m);同一翻译单元中 `#include`
在 `import` 之前;以 Clang 审计导出面;手工无法维护的导出面以记录提交、由 build.mcpp 生成(docs/mwrap.md)。
`tests/mwrap/check_installed_template.py` 新增 `--template`,以覆盖非默认模板。
- **mcpplibs.os 0.4.6。** 新增 `mcpplibs.os.text`:把被启动程序写出的文本按其编码解码为 UTF-8。编码为 `utf8`,或 `console`(Windows 控制台程序的约定:写入管道或文件时用所附着控制台的输出代码页,没有控制台时用系统的 ANSI 代码页;以 cl.exe 与 link.exe 测得,mcpp-community/mcpp#970)。`valid_utf8` 把不是 UTF-8 的序列按最大子部分替换为 U+FFFD。`windows::console_text_code_page` 与 `windows::utf8_from_code_page` 是其下的两项事实。openkal 的范围不变。
- **openkal-platform 0.31.0:openkal 0.26 一族。** 平台的各层、载体、工具与各行使用 openkal 0.26.0 及其各实现(openkal-linux 0.27.0、openkal-macos 0.24.0、openkal-windows 0.23.0、openkal-freebsd 0.2.0、openkal-uefi 0.12.0、openkal-dos 与 openkal-dos-tools 0.2.0、openkal-svr4 0.3.0)、openkal-musl 0.30.0、openkal-llvm-runtime 0.21.0 与 openkal-image 0.7.0。System V 一行可以启动其他程序:openkal-svr4 0.3.0 声明 `openkal.process` 与 `openkal.space`,运行器为 ibcs-us 4.3-2。构建程序链接 mcpp.plugins 0.26.1(mcpplibs.os 0.4.5 接受 openkal 0.26);平台的引擎下界仍为 mcpp 2026.11.17.1。
- **mcpp.platforms 0.2.1。** `aarch64-netbsd` 与 `aarch64-openbsd` 两行获得运行器(此前只构建):dirun 0.8.0 在
Expand Down
12 changes: 12 additions & 0 deletions docs/mwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public names, namespaces, type identities, overloads and behavior.
| Public API | original upstream spelling | `cv::Mat`, `Ort::Session` |
| Macro mapping module | `<root>.macros` | `mcpplibs.mwrap.opencv.macros` |

The upstream name is the library's own name, without a repository suffix that
only marks the language: Abseil's repository is abseil-cpp, the wrapper is
`abseil-m` and the package `mcpplibs.mwrap.abseil`.
Do not add `-m` to package/module names or relocate ordinary upstream entities
into a new C++ namespace. Preserve legacy published package identities and bytes;
publish a new mwrap identity rather than rewriting old releases.
Expand Down Expand Up @@ -95,6 +98,15 @@ Preserve argument evaluation and call-site behavior; an assertion macro is not
automatically equivalent to a function. Active macros expand even in qualified
names, so test and document raw-header versus mapped-constant usage.

A translation unit that both includes upstream headers and imports a wrapper
puts every `#include` before the first `import` (GCC rejects a header after an
import of a module that already declared its entities); state this in the README.
Clang requires an operator found by argument-dependent lookup at namespace scope
to be exported too, so audit the surface with Clang. A surface too large to keep
by hand is derived by a tool into a compact record committed to the repository,
and `build.mcpp` renders the module units from it at build time, so nothing
generated is committed (openssl-m: `src/surface.tsv`, `tools/surface.py`).

## Features

Use lowercase kebab-case and recognizable upstream vocabulary:
Expand Down
8 changes: 8 additions & 0 deletions docs/zh/mwrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
| API | 保留上游 | cv::Mat、Ort::Session |
| 宏映射模块 | `<根模块>.macros` | mcpplibs.mwrap.opencv.macros |

上游库名取库本身的名字,不含仅用于区分语言的仓库后缀:Abseil 的仓库是 abseil-cpp,
封装仓库为 `abseil-m`,包为 `mcpplibs.mwrap.abseil`。
包和模块名不带 -m,不创建另一套普通 API namespace。已发布旧身份、版本和内容保持不可变,
通过新 mwrap 身份迁移。简单实现优先依赖 compat.xxx;复杂库可以 vendor 到 upstream/。
同一程序的同一实现只能有一个所有者,不能把 compat 与 vendored 实现重复链接。
Expand Down Expand Up @@ -66,6 +68,12 @@ metadata 与上游锁文件仍明确记录来源。破坏性模块/API 变化必
控制流宏通过 `<mwrap/<库名>/macros.hpp>` 保留,在 import 前 include。
限定名仍会被宏展开;原始宏与映射常量的用法必须分别测试,断言函数不能默认代替断言宏。

同一翻译单元既 include 上游头文件又 import 封装模块时,所有 `#include` 放在第一个 `import` 之前
(GCC 拒绝在已声明同一实体的模块被 import 之后再引入头文件),README 写明。Clang 要求命名空间作用域上
经实参依赖查找找到的运算符也要导出,因此以 Clang 审计导出面。手工无法维护的大型导出面由工具推导为
紧凑的记录提交到仓库,由 `build.mcpp` 在构建时生成模块单元,不提交生成物
(openssl-m:`src/surface.tsv`、`tools/surface.py`)。

## feature

采用小写 kebab-case,复用上游术语:模块 dnn/highgui/stitching;后端 highgui-gtk3、
Expand Down
14 changes: 14 additions & 0 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ members = [
"tests/mwrap/libjpeg-turbo-decode",
"tests/mwrap/libarchive-bundle",
"tests/mwrap/libc-stdio",
"tests/mwrap/abseil-basics",
"tests/mwrap/protobuf-message",
"tests/mwrap/protobuf-codegen",
"tests/mwrap/openssl-tls",
"tests/mwrap/miniaudio-engine",
"tests/mwrap/freetype-render",
"tests/mwrap/harfbuzz-shape",
"tests/mwrap/sdl3-headless",
"tests/mwrap/grpc-cpu",
"tests/mwrap/grpc-protobuf-stack",
"tests/mwrap/grpc-tools",
"tests/mwrap/godot-math",
"tests/mwrap/godot-sdk",
Expand Down Expand Up @@ -313,5 +318,14 @@ members = [
# asio itself comes from the published index while its `ssl` feature dep,
# compat.openssl, resolves from this checkout — which is what lets an
# unmerged compat descriptor be tested through a feature that activates it.

# The index's OpenSSL dependents build on compat.openssl 3.5.9 (3.5 LTS).
# yizhinailong.mcr's own manifest still pins 3.5.1 beside compat.curl (3.5.9),
# and an override is read only from the root's tables, so the workspace
# chooses 3.5.9 for every member graph that holds compat.openssl — what a
# project depending on mcr writes in its own mcpp.toml.
[workspace.dependencies]
compat.openssl = { version = "3.5.9", override = true }

[indices]
compat = { path = "." }
2 changes: 1 addition & 1 deletion pkgs/c/chriskohlhoff.asio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ using ::asio::ssl::error::make_error_code;
},
["ssl"] = {
defines = { "MCPP_FEATURE_SSL" },
deps = { ["compat.openssl"] = "3.5.1" },
deps = { ["compat.openssl"] = "3.5.9" },
sources = { "*/src/asio_ssl.cpp" },
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkgs/c/compat.curl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ package = {

linux = {
cflags = { "-DHAVE_CONFIG_H", "-D_GNU_SOURCE" },
deps = { ["compat.openssl"] = "3.5.1" },
deps = { ["compat.openssl"] = "3.5.9" },
ldflags = { "-lpthread" },
},

macosx = {
cflags = { "-DHAVE_CONFIG_H", "-D_GNU_SOURCE" },
deps = { ["compat.openssl"] = "3.5.1" },
deps = { ["compat.openssl"] = "3.5.9" },
-- curl reaches into the system for proxy configuration on Apple:
-- SystemConfiguration for SCDynamicStoreCopyProxies, and
-- CoreFoundation for the CF objects that hands back.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/c/compat.httplib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ package = {
features = {
["tls"] = {
defines = { "CPPHTTPLIB_OPENSSL_SUPPORT" },
deps = { ["compat.openssl"] = "3.5.1" },
deps = { ["compat.openssl"] = "3.5.9" },
},
["zlib"] = {
defines = { "CPPHTTPLIB_ZLIB_SUPPORT" },
Expand Down
4 changes: 2 additions & 2 deletions pkgs/c/compat.jwt-cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-- OpenSSL is an UNCONDITIONAL compile-time dependency: jwt.h includes
-- <openssl/*.h> outside any feature guard (including ssl.h, even though only
-- libcrypto APIs are called — upstream's CMake target links OpenSSL::SSL +
-- OpenSSL::Crypto both). compat.openssl 3.5.1 provides headers AND carries the
-- OpenSSL::Crypto both). compat.openssl 3.5.9 provides headers AND carries the
-- per-platform link flags itself; they propagate to consumers, so this
-- descriptor adds no ldflags of its own. Windows support in compat.openssl is
-- evidenced by merged #211 + the asio-ssl member's real-TLS test.
Expand Down Expand Up @@ -78,6 +78,6 @@ int mcpp_compat_jwt_cpp_anchor(void) { return 0; }
},
sources = { "mcpp_generated/jwt_cpp_anchor.cpp" },
targets = { ["jwt_cpp"] = { kind = "lib" } },
deps = { ["compat.openssl"] = "3.5.1" },
deps = { ["compat.openssl"] = "3.5.9" },
},
}
12 changes: 8 additions & 4 deletions pkgs/c/compat.mysql-connector-cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package = {
linux = {
deps = {
"compat:libmysqlclient@8.4.6",
"compat:openssl@3.5.1",
"compat:openssl@3.5.9",
"xim:cmake@latest",
"xim:make@latest",
},
Expand All @@ -22,12 +22,14 @@ package = {
CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz",
},
sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550",
-- 1: built against compat.openssl 3.5.9 (was 3.5.1).
revision = 1,
},
},
macosx = {
deps = {
"compat:libmysqlclient@8.4.6",
"compat:openssl@3.5.1",
"compat:openssl@3.5.9",
"xim:cmake@latest",
},
["26.7.0"] = {
Expand All @@ -36,6 +38,8 @@ package = {
CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz",
},
sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550",
-- 1: built against compat.openssl 3.5.9 (was 3.5.1).
revision = 1,
},
},
},
Expand All @@ -48,7 +52,7 @@ package = {
targets = { ["mysql_connector_cpp"] = { kind = "lib" } },
deps = {
["compat.libmysqlclient"] = "8.4.6",
["compat.openssl"] = "3.5.1",
["compat.openssl"] = "3.5.9",
},

-- THE STANDARD LIBRARY THE STATIC LIBRARIES WERE COMPILED AGAINST, per
Expand Down Expand Up @@ -214,7 +218,7 @@ function install()
local ok, result = pcall(function()
local srcroot = find_source_root()
local mysql = find_dep_install_dir("compat:libmysqlclient", "8.4.6")
local openssl = find_dep_install_dir("compat:openssl", "3.5.1")
local openssl = find_dep_install_dir("compat:openssl", "3.5.9")
hook_log("srcroot=" .. tostring(srcroot) .. " mysql=" .. tostring(mysql)
.. " openssl=" .. tostring(openssl))
if not srcroot or not mysql or not openssl then
Expand Down
23 changes: 22 additions & 1 deletion pkgs/c/compat.openssl.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- compat.openssl — OpenSSL 3.5.1 built from source as a portable, static
-- compat.openssl — OpenSSL 3.5 LTS (3.5.9; 3.5.1 kept) built from source as a portable, static
-- library that provides TLS/crypto for consumers (e.g. chriskohlhoff.asio's
-- `ssl` feature, which wraps asio::ssl::context / asio::ssl::stream).
--
Expand Down Expand Up @@ -76,6 +76,13 @@ package = {
"xim:make@latest", "xim:perl@latest",
"xim:glibc@>=2.39", "xim:linux-headers@5.11.1",
},
["3.5.9"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/openssl/releases/download/3.5.9/openssl-3.5.9.tar.gz",
},
sha256 = "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a",
},
["3.5.1"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.1/openssl-3.5.1.tar.gz",
Expand All @@ -98,6 +105,13 @@ package = {
-- it resolves here and the platform gets the same
-- known-complete interpreter linux does.
deps = { "xim:perl@latest" },
["3.5.9"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/openssl/releases/download/3.5.9/openssl-3.5.9.tar.gz",
},
sha256 = "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a",
},
["3.5.1"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.1/openssl-3.5.1.tar.gz",
Expand All @@ -109,6 +123,13 @@ package = {
windows = {
-- Same source tarball as the other platforms; the build differs
-- (VC-WIN64A + nmake), not the source. See _install_windows().
["3.5.9"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz",
CN = "https://gitcode.com/mcpp-res/openssl/releases/download/3.5.9/openssl-3.5.9.tar.gz",
},
sha256 = "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a",
},
["3.5.1"] = {
url = {
GLOBAL = "https://github.com/openssl/openssl/releases/download/openssl-3.5.1/openssl-3.5.1.tar.gz",
Expand Down
Loading
Loading