From f91682912de2f67de1571feb4640b2c5660e5218 Mon Sep 17 00:00:00 2001 From: wellwei <96378453+wellwei@users.noreply.github.com> Date: Sat, 5 Sep 2026 02:10:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(pkg):=20compat.boost-beast=201.92.0=20?= =?UTF-8?q?+=20modular-boost=20=E7=AC=AC=E4=BA=8C=E5=88=97=E8=BD=A6(25=20?= =?UTF-8?q?=E4=B8=AA=E6=96=B0=E5=8C=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 收录 Boost.Beast(HTTP/WebSocket)。Beast 1.92 上游已移除 BEAST_USE_STANDALONE_ASIO(error.hpp 无条件别名 boost::system::error_code), 无法复用独立 chriskohlhoff.asio,故沿 #244 的 modular-boost 拆包路线 (vcpkg 同构,每个 boostorg/ 从自己的 boost-1.92.0 tag 打小包) 一次性补齐全传递闭包,共 25 个新描述符: boost-beast(19 直接依赖), boost-asio, boost-align, boost-bind, boost-compat, boost-container, boost-container-hash, boost-core, boost-describe, boost-endian, boost-intrusive, boost-io, boost-logic, boost-move, boost-mp11, boost-optional, boost-predef, boost-preprocessor, boost-smart-ptr, boost-static-string, boost-system, boost-type-index, boost-utility, boost-variant2, boost-winapi - 闭包逐 include grep(两种 #include 拼写)并与各仓 CMakeLists INTERFACE 行交叉核对;beast 的 19 个依赖与上游 CMakeLists 完全一致 - 29 棵 include 树(2608 文件)两两不相交,*/include 联合无碰撞 - 单文件 shim 归属逐一核实(type_index 走 单文件头; cerrno 归 system;get_pointer/type/noncopyable 等归 core;none 归 optional) - boost-asio 经 default feature 携带 BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER 与 BOOST_ASIO_DISABLE_BOOST_DATE_TIME(与 chriskohlhoff.asio 同思路): 关掉 boost.context(编译期汇编库)与 boost.date_time,保住家族 header-only; boost-beast 的 default feature 原样重述两个宏,保证消费 TU 配置一致 - 全部 25 个 tarball 无符号链接(Windows 可直接解包);sha256 双算稳定; 暂不建 CN 镜像(纯字符串 GLOBAL url,家族先例) - 测试成员 boost-beast:HTTP 解析/序列化回路/错误路径/自带 zlib 往返/ multi_buffer+static_string;boost-asio:feature 宏传播 + 真实 io_context 定时器/co_spawn 往返;既有 boost-uuid 成员回归通过 - mcpp 2026.8.27.2 本地冷验证通过;lint 全套(lua 语法/必填字段/裸版本/ name 单段/镜像表/跨包引用/平台版本对齐/重复版本/xpkg parse)全绿 设计文档:.agents/docs/2026-09-05-add-boost-beast-plan.md --- .../docs/2026-09-05-add-boost-beast-plan.md | 142 +++++++++++++++ CHANGELOG.md | 10 ++ mcpp.toml | 2 + pkgs/c/compat.boost-align.lua | 56 ++++++ pkgs/c/compat.boost-asio.lua | 105 +++++++++++ pkgs/c/compat.boost-beast.lua | 114 ++++++++++++ pkgs/c/compat.boost-bind.lua | 55 ++++++ pkgs/c/compat.boost-compat.lua | 56 ++++++ pkgs/c/compat.boost-container-hash.lua | 56 ++++++ pkgs/c/compat.boost-container.lua | 57 ++++++ pkgs/c/compat.boost-core.lua | 56 ++++++ pkgs/c/compat.boost-describe.lua | 54 ++++++ pkgs/c/compat.boost-endian.lua | 54 ++++++ pkgs/c/compat.boost-intrusive.lua | 56 ++++++ pkgs/c/compat.boost-io.lua | 54 ++++++ pkgs/c/compat.boost-logic.lua | 55 ++++++ pkgs/c/compat.boost-move.lua | 54 ++++++ pkgs/c/compat.boost-mp11.lua | 54 ++++++ pkgs/c/compat.boost-optional.lua | 58 +++++++ pkgs/c/compat.boost-predef.lua | 54 ++++++ pkgs/c/compat.boost-preprocessor.lua | 54 ++++++ pkgs/c/compat.boost-smart-ptr.lua | 57 ++++++ pkgs/c/compat.boost-static-string.lua | 59 +++++++ pkgs/c/compat.boost-system.lua | 60 +++++++ pkgs/c/compat.boost-type-index.lua | 56 ++++++ pkgs/c/compat.boost-utility.lua | 60 +++++++ pkgs/c/compat.boost-variant2.lua | 56 ++++++ pkgs/c/compat.boost-winapi.lua | 55 ++++++ tests/examples/boost-asio/mcpp.toml | 12 ++ tests/examples/boost-asio/tests/asio.cpp | 55 ++++++ tests/examples/boost-beast/mcpp.toml | 10 ++ tests/examples/boost-beast/tests/beast.cpp | 163 ++++++++++++++++++ 32 files changed, 1899 insertions(+) create mode 100644 .agents/docs/2026-09-05-add-boost-beast-plan.md create mode 100644 pkgs/c/compat.boost-align.lua create mode 100644 pkgs/c/compat.boost-asio.lua create mode 100644 pkgs/c/compat.boost-beast.lua create mode 100644 pkgs/c/compat.boost-bind.lua create mode 100644 pkgs/c/compat.boost-compat.lua create mode 100644 pkgs/c/compat.boost-container-hash.lua create mode 100644 pkgs/c/compat.boost-container.lua create mode 100644 pkgs/c/compat.boost-core.lua create mode 100644 pkgs/c/compat.boost-describe.lua create mode 100644 pkgs/c/compat.boost-endian.lua create mode 100644 pkgs/c/compat.boost-intrusive.lua create mode 100644 pkgs/c/compat.boost-io.lua create mode 100644 pkgs/c/compat.boost-logic.lua create mode 100644 pkgs/c/compat.boost-move.lua create mode 100644 pkgs/c/compat.boost-mp11.lua create mode 100644 pkgs/c/compat.boost-optional.lua create mode 100644 pkgs/c/compat.boost-predef.lua create mode 100644 pkgs/c/compat.boost-preprocessor.lua create mode 100644 pkgs/c/compat.boost-smart-ptr.lua create mode 100644 pkgs/c/compat.boost-static-string.lua create mode 100644 pkgs/c/compat.boost-system.lua create mode 100644 pkgs/c/compat.boost-type-index.lua create mode 100644 pkgs/c/compat.boost-utility.lua create mode 100644 pkgs/c/compat.boost-variant2.lua create mode 100644 pkgs/c/compat.boost-winapi.lua create mode 100644 tests/examples/boost-asio/mcpp.toml create mode 100644 tests/examples/boost-asio/tests/asio.cpp create mode 100644 tests/examples/boost-beast/mcpp.toml create mode 100644 tests/examples/boost-beast/tests/beast.cpp diff --git a/.agents/docs/2026-09-05-add-boost-beast-plan.md b/.agents/docs/2026-09-05-add-boost-beast-plan.md new file mode 100644 index 00000000..7369074c --- /dev/null +++ b/.agents/docs/2026-09-05-add-boost-beast-plan.md @@ -0,0 +1,142 @@ +# 收录 compat.boost-beast 1.92.0(及 modular-boost 家族第二列车,共 25 个新包) + +日期:2026-09-05。目标:把 Boost.Beast(HTTP/WebSocket)以 modular-boost 拆包 +路线收进索引。参考既有案例 `compat.boost-uuid`(#244)。 + +## 形态判定 + +- 来源 (a) 第三方上游:boostorg/beast,tag `boost-1.92.0` —— 与家族现有五包 + (config/assert/throw-exception/type-traits/uuid)同一训练版本。上游 beast + 已发布 1.93 训练之前家族不能单独动版本("整列车一起升级"策略),故全部 + 新包钉 `boost-1.92.0`。 +- Layout:`beast-boost-1.92.0/include/boost/beast.hpp` + `include/boost/beast/`, + 与家族一致的 `include_dirs = { "*/include" }` 模板。 +- License BSL-1.0;header-only(CMake 目标是 INTERFACE;beast/zlib 是自带 + 的 inflate/deflate 移植,不需要外部 zlib;`boost/beast.hpp` 聚合面不含 + ssl,`beast/ssl.hpp` 需要消费者自带 OpenSSL 依赖,本包不接线)。 + +## 为什么必须走 boost.asio,而不是现成的 chriskohlhoff.asio + +Beast 1.92 上游**已移除** `BEAST_USE_STANDALONE_ASIO`: +`include/boost/beast/core/detail/config.hpp` 全树 grep 不到 "STANDALONE", +`beast/core/error.hpp` 无条件把 `beast::error_code` 别名为 +`boost::system::error_code`。所以独立 Asio 路线在 1.92 训练上不存在, +必须补 boost.asio 家族成员;boost.asio 自身是 header-only(superproject +不构建编译目标),闭包是 align/assert/config/system/throw_exception。 + +## 闭包(机械可复核) + +对每个参与仓库的 include 树做全量 grep(两种拼写 `#include` 与 `# include` +都要抓:初版正则漏了带空格的 `# include `, +差点少包 mp11),并与各仓 CMakeLists 的 INTERFACE 行交叉核对: + +``` +beast -> asio, assert*, bind, config*, container, container_hash, core, + endian, intrusive, logic, mp11, optional, smart_ptr, + static_string, system, throw_exception*, type_index, + type_traits*, winapi (19 个,grep 与 CMake 完全一致) +asio -> align, assert*, config*, system, throw_exception* + (+ context、date_time:见下节,二者被 define 关闭) +align -> assert*, config*, core +bind -> config*, core +compat -> assert*, config*, throw_exception* +container -> assert*, config*, intrusive, move +container_hash -> config*, describe, mp11 +core -> assert*, config*, throw_exception* +describe -> mp11 +endian -> config* +intrusive -> assert*, config*, move +io -> config* +logic -> config*, core +move -> config* +mp11 / predef / preprocessor -> (无) +optional -> assert*, config*, core, throw_exception*, type_traits* +smart_ptr -> assert*, config*, core, throw_exception* +static_string -> assert*, config*, container-hash, core, throw_exception*, utility +system -> assert*, compat, config*, mp11, throw_exception*, variant2, winapi +type_index -> config*, container-hash, throw_exception* +utility -> assert*, config*, core, io, preprocessor, throw_exception*, type_traits* +variant2 -> assert*, config*, mp11 +winapi -> config*, predef +``` + +(`*` = 家族已有包。)单文件 shim 的归属以物理文件为准逐一核实: +`boost/get_pointer.hpp`、`boost/type.hpp`、`boost/is_placeholder.hpp`、 +`boost/visit_each.hpp`、`boost/noncopyable.hpp` → core;`boost/none.hpp` → +optional;`boost/cerrno.hpp` → system;`boost/detail/{call_traits, +compressed_pair}.hpp` → utility;`boost/detail/winapi/*` → winapi; +`boost/version.hpp`、`boost/cstdint.hpp`、`boost/static_assert.hpp`、 +`boost/detail/workaround.hpp` → config(家族既有声明)。 +beast 的 `type_index` 只以单文件头 `` 进入——只按 +目录 grep 会漏掉它;上游 CMakeLists 列的 type_index 反而因此是对的。 +29 棵 include 树(25 新 + 4 既有 + beast)合计 2608 个文件, +**两两不相交**(脚本核验零重复路径),`*/include` 联合成一棵 `boost/` +树无碰撞。 + +## boost-asio 的两个 disable 宏(本 PR 唯一的 feature 用法) + +boost.asio 对 boost.context(spawn 栈ful 协程)与 boost.date_time( +deadline_timer)是**编译器版本级自动探测**:clang/gcc ≥ C++11 就打开 +`BOOST_ASIO_HAS_BOOST_CONTEXT_FIBER`;`boost/version.hpp ≥ 1.33` 就打开 +`..._DATE_TIME`。而 Boost.Context 是**编译期(含汇编)库**,一旦放任探测, +asio/impl/spawn.hpp 会 include ``,家族的 +header-only 性质就保不住。两个都有上游认可的关闭开关: + +``` +BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER +BOOST_ASIO_DISABLE_BOOST_DATE_TIME +``` + +二者经 compat.boost-asio 的 `default` → `no-boost-extras` feature 的 +`defines` 传播(先例:chriskohlhoff.asio 的 separate-compilation、 +compat.curl 的 staticlib)。compat.boost-beast 的 default feature +**原样重述**这两个宏:feature defines 对直接消费者传播是已验证行为, +隔着中间包(beast)向消费者的传播没有现成先例,重述一遍保证 beast 消费者 +的每个 TU 看到一致配置;两侧同值,幂等无 ODR 风险。 +关闭后 beast 不用 spawn/deadline_timer,无能力损失。 + +## 命名 + +包名一律 kebab:`boost-container-hash`、`boost-smart-ptr`、 +`boost-type-index`、`boost-static-string`(家族先例 type-traits/ +throw-exception);仓库 URL 与注释中保留上游仓原名 `container_hash` 等。 +目录按完整包名首字母,`compat.*` 全部落 `pkgs/c/`。 + +## CN 镜像 + +按家族先例(#244、boost-ext.ut)暂不建:全部采用纯字符串 +`url = ""`,lint 允许,CN 用户回退上游源,由维护者后续补 gitcode。 +24 个新 tarball 的 sha256 各计算两次确认稳定;既有四包的钉定哈希与本次 +上游下载逐一相符(互证 GitHub archive 稳定性)。 + +## 消费与测试 + +- `tests/examples/boost-beast/`:`#include ` 聚合头把 + core/http/websocket/zlib 编进同一 TU;断言 HTTP 请求解析、响应序列化 + (response_serializer)+ 回读往返、畸形输入报错、自带 zlib 压缩/解压 + 往返、multi_buffer/flat_buffer 与 static_string。 +- `tests/examples/boost-asio/`:直接消费者路径,验证 feature 宏传播到 + 消费 TU;真实跑 `steady_timer` + `io_context::run`、post/defer、 + co_spawn/awaitable、tcp endpoint。`#include ` 单体头 + 顺带验证 disable 宏守卫下单体 include 可用。 +- 两成员只消费 `compat` 命名空间,继承根 workspace 的 `[indices]` + 重定向,不声明自己的 indices。 +- 正向验证在 CI(linux/macos/windows 三平台);无 feature 需要负向验证 + (无源码门控),disable 宏的"负向"体现在:闭包树里根本没有 + `boost/context`、`boost/date_time` 头文件可解析(机械核验过)。 + +## 结果 + +- 本地:`mcpp test -p boost-asio`、`mcpp test -p boost-beast` 通过 + (mcpp 2026.8.27.2,冷启动),lint(lua 语法、必填字段、裸版本、 + name 单段、镜像表、`mcpp xpkg parse` 全描述符)通过。 +- CI:lint / mirror-cn-reachable / workspace 选择性成员测试全绿后合并。 + +## 备注 / 后续 + +- 升级到 1.93 训练时需整列车一起动(29 个包)。 +- 消费者要 beast::ssl 时:加 `compat.openssl` 并确保 OpenSSL 头在 include + 路径——本包未为 ssl 接线(boost.asio 的 ssl 头在包里,能编译的先决 + 条件是消费者带 OpenSSL)。 +- 若未来某消费者需要 spawn()/deadline_timer:需要收录 Boost.Context + (含汇编编译)或 Boost.Date_Time(闭包巨大),届时再评估拆包成本。 diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8345d5..a8e766fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,16 @@ ### Added +- 收录 `compat.boost-beast` 1.92.0(Boost.Beast,HTTP/WebSocket),沿 modular-boost + 拆包路线一次性补齐其 24 个传递依赖:`boost-asio`、`boost-align`、`boost-bind`、 + `boost-compat`、`boost-container`、`boost-container-hash`、`boost-core`、 + `boost-describe`、`boost-endian`、`boost-intrusive`、`boost-io`、`boost-logic`、 + `boost-move`、`boost-mp11`、`boost-optional`、`boost-predef`、 + `boost-preprocessor`、`boost-smart-ptr`、`boost-static-string`、`boost-system`、 + `boost-type-index`、`boost-utility`、`boost-variant2`、`boost-winapi`。 + 29 包 include 树两两不相交、闭包逐 include 核实;`boost-asio` 经 default + feature 携带 `BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER` / `..._DATE_TIME`, + 保持家族 header-only。新增 `boost-beast` 与 `boost-asio` 两个工作区成员。 - 收录 `gzj-creator.galay` 5.0.2 原生 Form-A 模块包,覆盖 `galay.utils` 与 `galay.kernel` 默认模块,并加入 Unix 示例工程和索引文档。 diff --git a/mcpp.toml b/mcpp.toml index 2556703f..f055874b 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -11,7 +11,9 @@ members = [ "tests/examples/archive", "tests/examples/asio-module", "tests/examples/asio-ssl", + "tests/examples/boost-asio", "tests/examples/boost-assert", + "tests/examples/boost-beast", "tests/examples/boost-config", "tests/examples/boost-ext.ut", "tests/examples/boost-throw-exception", diff --git a/pkgs/c/compat.boost-align.lua b/pkgs/c/compat.boost-align.lua new file mode 100644 index 00000000..dd85a09d --- /dev/null +++ b/pkgs/c/compat.boost-align.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.Align 1.92.0 — aligned allocation functions, allocators and traits. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- align -> assert, config, core +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-align", + description = "Boost.Align 1.92.0 — aligned allocation functions, allocators and traits", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/align", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/align/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "e9d7a0012be7849d36e366e565e5d05028069a1be3ea67bf31ed129c8344864c", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/align/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "e9d7a0012be7849d36e366e565e5d05028069a1be3ea67bf31ed129c8344864c", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/align/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "e9d7a0012be7849d36e366e565e5d05028069a1be3ea67bf31ed129c8344864c", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_align_anchor.cpp"] = [==[ +int mcpp_compat_boost_align_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_align_anchor.cpp" }, + targets = { ["boost_align"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-asio.lua b/pkgs/c/compat.boost-asio.lua new file mode 100644 index 00000000..7c2374bc --- /dev/null +++ b/pkgs/c/compat.boost-asio.lua @@ -0,0 +1,105 @@ +-- Form B inline descriptor for Boost.Asio 1.92.0 — networking/async I/O as +-- consumed INSIDE the modular-boost header family. This is the boostorg/asio +-- tree (Boost.Asio), NOT the standalone chriskohlhoff.asio package already in +-- this index: Beast 1.92 removed BEAST_USE_STANDALONE_ASIO upstream, so the +-- beast descriptor has no choice but to ride boost.asio (see compat.boost-beast). +-- +-- Header-only — the boostorg superproject builds no compiled asio target. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree and cross-checked +-- against the repo's CMakeLists INTERFACE line: +-- asio -> align, assert, config, system, throw_exception +-- (+ context, date_time — both DISABLED, see below) +-- Boost.Align looks surprising on first read but is real: asio/detail/memory +-- routes aligned allocations through boost::align::align. +-- +-- Two optional Boost libraries are compile-time auto-detected and deliberately +-- switched OFF via the package's default feature (same trick as the +-- standalone chriskohlhoff.asio's ASIO_DISABLE_BOOST_CONTEXT_FIBER): +-- +-- * boost.context — spawn()/yield_context stackful coroutines. The fiber +-- detection is compiler-only (clang/gcc >= C++11 ⇒ on), so without the +-- disable define asio/impl/spawn.hpp would #include , +-- and Boost.Context is a COMPILED (and assembly) library — packaging it +-- would end this family's header-only property. Beast never calls spawn. +-- * boost.date_time — the legacy deadline_timer. asio/deadline_timer.hpp and +-- time_traits.hpp are guarded by BOOST_ASIO_HAS_BOOST_DATE_TIME, so with +-- the disable define even `#include ` never reaches +-- boost/date_time. Beast uses steady_timer (std::chrono). +-- +-- With both off, the asio surface is the same one the standalone package +-- exposes minus iostream/streambuf quirks: io_context, timers, sockets, +-- buffers, co_spawn/awaitable, ssl (headers — requires an OpenSSL dep the +-- consumer must bring, e.g. compat.openssl; NOT wired here). Handlers run on +-- POSIX threads auto-detected via unistd.h macros; no ldflags needed beyond +-- what the consumer's own profile carries — see chriskohlhoff.asio for the +-- -pthread precedent if a member ever needs it pinned. +-- +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-asio", + description = "Boost.Asio 1.92.0 — networking/async I/O; the boostorg tree consumed by Boost.Beast", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/asio", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/asio/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "9aff35259a81bc08cf7a4498cec06e8e35a645a54b917ae16c3e5884fd260ecb", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + -- Exposes `boost/asio/` (+ boost/asio.hpp) so family consumers' + -- `#include ` resolve. + include_dirs = { "*/include" }, + -- Header-only: a trivial anchor TU gives mcpp a buildable lib target. + generated_files = { + ["mcpp_generated/boost_asio_anchor.cpp"] = [==[ +int mcpp_compat_boost_asio_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_asio_anchor.cpp" }, + targets = { ["boost_asio"] = { kind = "lib" } }, + -- The disable defines ride the package's default feature so they reach + -- every TU that compiles an asio header — direct consumers here, and + -- compat.boost-beast consumers through its own identical default + -- feature (idempotent, same values — see that descriptor). + features = { + ["default"] = { implies = { "no-boost-extras" } }, + ["no-boost-extras"] = { + defines = { + "BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER", + "BOOST_ASIO_DISABLE_BOOST_DATE_TIME", + }, + }, + }, + deps = { + ["compat.boost-align"] = "1.92.0", + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-system"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-beast.lua b/pkgs/c/compat.boost-beast.lua new file mode 100644 index 00000000..0c650e72 --- /dev/null +++ b/pkgs/c/compat.boost-beast.lua @@ -0,0 +1,114 @@ +-- Form B inline descriptor for Boost.Beast 1.92.0 — HTTP and WebSocket +-- networking built on Asio, the largest member of this index's modular-boost +-- header family so far. Header-only (upstream's CMake target is INTERFACE; +-- beast/zlib is a bundled inflate/deflate port, no external zlib; beast/ssl +-- is NOT part of boost/beast.hpp's aggregate — using it needs an OpenSSL dep +-- the consumer must bring, e.g. compat.openssl). +-- +-- Why boost.asio and not the standalone chriskohlhoff.asio already in this +-- index: upstream removed BEAST_USE_STANDALONE_ASIO around Boost 1.87 — the +-- 1.92 tree hardwires boost/system + boost/asio (beast/core/error.hpp aliases +-- error_code to boost::system::error_code unconditionally), and grepping the +-- whole include tree for "STANDALONE" comes up empty. So this package rides +-- the boost.asio family member, which carries its own default-feature defines +-- disabling the boost.context/boost.date_time optional surface. +-- +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Dependency closure verified by +-- grepping every `` include across the include tree (both +-- `#include` and `# include` spellings) and cross-checked against the repo's +-- CMakeLists BOOST_BEAST_DEPENDENCIES line — the two agree exactly, 19 libs, +-- of which four were already in this index (assert, config, throw-exception, +-- type-traits): +-- beast -> asio, assert, bind, config, container, container_hash, core, +-- endian, intrusive, logic, mp11, optional, smart_ptr, +-- static_string, system, throw_exception, type_index, +-- type_traits, winapi +-- winapi enters through beast/core/file_win32 (Windows-only paths) and +-- boost/system; the headers are inert on POSIX, so the dep is declared on all +-- three platforms like the rest of the family. type_index is reached via the +-- single-file boost/type_index.hpp shims (a dir-only grep would miss it — +-- that mistake cost the first draft of this closure a dependency). +-- +-- The default feature re-states boost-asio's two disable defines: feature +-- defines propagate to direct consumers, and restating them here keeps a +-- beast consumer's TUs consistent even if transitive propagation through an +-- intermediate package ever changes. Same values on both sides = idempotent. +-- +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-beast", + description = "Boost.Beast 1.92.0 — HTTP and WebSocket networking on Boost.Asio (header-only)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/beast", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/beast/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "de6f1308125438d238d7d53d2b9be8eddc11db17977baf87e2a2e7fc1dd9ea29", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/beast/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "de6f1308125438d238d7d53d2b9be8eddc11db17977baf87e2a2e7fc1dd9ea29", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/beast/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "de6f1308125438d238d7d53d2b9be8eddc11db17977baf87e2a2e7fc1dd9ea29", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + -- Exposes boost/beast.hpp + boost/beast/* for `#include + -- `-style consumption. + include_dirs = { "*/include" }, + -- Header-only: a trivial anchor TU gives mcpp a buildable lib target. + generated_files = { + ["mcpp_generated/boost_beast_anchor.cpp"] = [==[ +int mcpp_compat_boost_beast_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_beast_anchor.cpp" }, + targets = { ["boost_beast"] = { kind = "lib" } }, + features = { + ["default"] = { implies = { "asio-no-boost-extras" } }, + ["asio-no-boost-extras"] = { + defines = { + "BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER", + "BOOST_ASIO_DISABLE_BOOST_DATE_TIME", + }, + }, + }, + deps = { + ["compat.boost-asio"] = "1.92.0", + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-bind"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-container"] = "1.92.0", + ["compat.boost-container-hash"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + ["compat.boost-endian"] = "1.92.0", + ["compat.boost-intrusive"] = "1.92.0", + ["compat.boost-logic"] = "1.92.0", + ["compat.boost-mp11"] = "1.92.0", + ["compat.boost-optional"] = "1.92.0", + ["compat.boost-smart-ptr"] = "1.92.0", + ["compat.boost-static-string"] = "1.92.0", + ["compat.boost-system"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + ["compat.boost-type-index"] = "1.92.0", + ["compat.boost-type-traits"] = "1.92.0", + ["compat.boost-winapi"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-bind.lua b/pkgs/c/compat.boost-bind.lua new file mode 100644 index 00000000..9866740d --- /dev/null +++ b/pkgs/c/compat.boost-bind.lua @@ -0,0 +1,55 @@ +-- Form B inline descriptor for Boost.Bind 1.92.0 — bind.hpp expression binders and mem_fn. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- bind -> config, core +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-bind", + description = "Boost.Bind 1.92.0 — bind.hpp expression binders and mem_fn", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/bind", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/bind/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "63b4d0f508cea880638f332f2f2c5f9581c8f3e751dd4a385635386ceb5bd72d", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/bind/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "63b4d0f508cea880638f332f2f2c5f9581c8f3e751dd4a385635386ceb5bd72d", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/bind/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "63b4d0f508cea880638f332f2f2c5f9581c8f3e751dd4a385635386ceb5bd72d", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_bind_anchor.cpp"] = [==[ +int mcpp_compat_boost_bind_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_bind_anchor.cpp" }, + targets = { ["boost_bind"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-compat.lua b/pkgs/c/compat.boost-compat.lua new file mode 100644 index 00000000..b1866942 --- /dev/null +++ b/pkgs/c/compat.boost-compat.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.Compat 1.92.0 — C++11-17 backports of newer standard facilities (invoke, to_chars). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- compat -> assert, config, throw_exception +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-compat", + description = "Boost.Compat 1.92.0 — C++11-17 backports of newer standard facilities (invoke, to_chars)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/compat", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/compat/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5c75932af3b259abce882b203e6bd2ce5de7e7630e1fea24494fcb4e7da43c41", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/compat/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5c75932af3b259abce882b203e6bd2ce5de7e7630e1fea24494fcb4e7da43c41", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/compat/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5c75932af3b259abce882b203e6bd2ce5de7e7630e1fea24494fcb4e7da43c41", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_compat_anchor.cpp"] = [==[ +int mcpp_compat_boost_compat_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_compat_anchor.cpp" }, + targets = { ["boost_compat"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-container-hash.lua b/pkgs/c/compat.boost-container-hash.lua new file mode 100644 index 00000000..fc6f9c8f --- /dev/null +++ b/pkgs/c/compat.boost-container-hash.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.ContainerHash 1.92.0 — hash_value and hash range combinators. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- container_hash -> config, describe, mp11 +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-container-hash", + description = "Boost.ContainerHash 1.92.0 — hash_value and hash range combinators", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/container_hash", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container_hash/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "f88aabbbc2f163db5eea65662b26e5af2bde0a0bff065c645b7347ed6a71a566", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container_hash/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "f88aabbbc2f163db5eea65662b26e5af2bde0a0bff065c645b7347ed6a71a566", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container_hash/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "f88aabbbc2f163db5eea65662b26e5af2bde0a0bff065c645b7347ed6a71a566", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_container_hash_anchor.cpp"] = [==[ +int mcpp_compat_boost_container_hash_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_container_hash_anchor.cpp" }, + targets = { ["boost_container_hash"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + ["compat.boost-describe"] = "1.92.0", + ["compat.boost-mp11"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-container.lua b/pkgs/c/compat.boost-container.lua new file mode 100644 index 00000000..adc8dde2 --- /dev/null +++ b/pkgs/c/compat.boost-container.lua @@ -0,0 +1,57 @@ +-- Form B inline descriptor for Boost.Container 1.92.0 — STL-compatible containers; Beast consumes allocator_traits. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- container -> assert, config, intrusive, move +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-container", + description = "Boost.Container 1.92.0 — STL-compatible containers; Beast consumes allocator_traits", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/container", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa5823d6b5eaac5a56af6b4ea90e9560f9659d3237e62db7e54f434a5611ae7f", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa5823d6b5eaac5a56af6b4ea90e9560f9659d3237e62db7e54f434a5611ae7f", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/container/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa5823d6b5eaac5a56af6b4ea90e9560f9659d3237e62db7e54f434a5611ae7f", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_container_anchor.cpp"] = [==[ +int mcpp_compat_boost_container_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_container_anchor.cpp" }, + targets = { ["boost_container"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-intrusive"] = "1.92.0", + ["compat.boost-move"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-core.lua b/pkgs/c/compat.boost-core.lua new file mode 100644 index 00000000..3c5e3d8a --- /dev/null +++ b/pkgs/c/compat.boost-core.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.Core 1.92.0 — core utilities: addressof, empty_value, ref, type.hpp shims. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- core -> assert, config, throw_exception +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-core", + description = "Boost.Core 1.92.0 — core utilities: addressof, empty_value, ref, type.hpp shims", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/core", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/core/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa4eb2ccbe5577ded70f25b8f0d852a5246591f90cc34916160739e3d0dbfea6", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/core/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa4eb2ccbe5577ded70f25b8f0d852a5246591f90cc34916160739e3d0dbfea6", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/core/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "aa4eb2ccbe5577ded70f25b8f0d852a5246591f90cc34916160739e3d0dbfea6", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_core_anchor.cpp"] = [==[ +int mcpp_compat_boost_core_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_core_anchor.cpp" }, + targets = { ["boost_core"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-describe.lua b/pkgs/c/compat.boost-describe.lua new file mode 100644 index 00000000..7bbaff52 --- /dev/null +++ b/pkgs/c/compat.boost-describe.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Describe 1.92.0 — macro-based enum/class descriptions (feeds ContainerHash). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- describe -> mp11 +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-describe", + description = "Boost.Describe 1.92.0 — macro-based enum/class descriptions (feeds ContainerHash)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/describe", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/describe/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4ef61ea2ca967b803e171f4756e03e201680d5dd19d014324f9a848e0d06863b", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/describe/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4ef61ea2ca967b803e171f4756e03e201680d5dd19d014324f9a848e0d06863b", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/describe/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4ef61ea2ca967b803e171f4756e03e201680d5dd19d014324f9a848e0d06863b", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_describe_anchor.cpp"] = [==[ +int mcpp_compat_boost_describe_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_describe_anchor.cpp" }, + targets = { ["boost_describe"] = { kind = "lib" } }, + deps = { + ["compat.boost-mp11"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-endian.lua b/pkgs/c/compat.boost-endian.lua new file mode 100644 index 00000000..1260661d --- /dev/null +++ b/pkgs/c/compat.boost-endian.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Endian 1.92.0 — byte-order conversion (WebSocket framing). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- endian -> config +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-endian", + description = "Boost.Endian 1.92.0 — byte-order conversion (WebSocket framing)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/endian", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/endian/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5acc3f986b997db9927039e5a034ede1e923dc3576037e2c24b7363961931c03", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/endian/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5acc3f986b997db9927039e5a034ede1e923dc3576037e2c24b7363961931c03", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/endian/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5acc3f986b997db9927039e5a034ede1e923dc3576037e2c24b7363961931c03", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_endian_anchor.cpp"] = [==[ +int mcpp_compat_boost_endian_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_endian_anchor.cpp" }, + targets = { ["boost_endian"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-intrusive.lua b/pkgs/c/compat.boost-intrusive.lua new file mode 100644 index 00000000..114401fa --- /dev/null +++ b/pkgs/c/compat.boost-intrusive.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.Intrusive 1.92.0 — intrusive list/set hooks (Beast buffers and http::fields). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- intrusive -> assert, config, move +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-intrusive", + description = "Boost.Intrusive 1.92.0 — intrusive list/set hooks (Beast buffers and http::fields)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/intrusive", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/intrusive/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "1df09194b4e223cbc86616d6747f6df35d3bb2b24456a58e4fb5b8483ca37f26", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/intrusive/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "1df09194b4e223cbc86616d6747f6df35d3bb2b24456a58e4fb5b8483ca37f26", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/intrusive/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "1df09194b4e223cbc86616d6747f6df35d3bb2b24456a58e4fb5b8483ca37f26", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_intrusive_anchor.cpp"] = [==[ +int mcpp_compat_boost_intrusive_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_intrusive_anchor.cpp" }, + targets = { ["boost_intrusive"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-move"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-io.lua b/pkgs/c/compat.boost-io.lua new file mode 100644 index 00000000..bb5d68a2 --- /dev/null +++ b/pkgs/c/compat.boost-io.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.IO 1.92.0 — stream flag helpers (ios_state, ostream_put) and boost/io_fwd.hpp. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- io -> config +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-io", + description = "Boost.IO 1.92.0 — stream flag helpers (ios_state, ostream_put) and boost/io_fwd.hpp", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/io", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/io/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a42279650f8a79f93a24fbda0b968e519224efdff91e4177407a4ee8b9d9ee57", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/io/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a42279650f8a79f93a24fbda0b968e519224efdff91e4177407a4ee8b9d9ee57", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/io/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a42279650f8a79f93a24fbda0b968e519224efdff91e4177407a4ee8b9d9ee57", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_io_anchor.cpp"] = [==[ +int mcpp_compat_boost_io_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_io_anchor.cpp" }, + targets = { ["boost_io"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-logic.lua b/pkgs/c/compat.boost-logic.lua new file mode 100644 index 00000000..2ffe8c85 --- /dev/null +++ b/pkgs/c/compat.boost-logic.lua @@ -0,0 +1,55 @@ +-- Form B inline descriptor for Boost.Logic 1.92.0 — tribool three-state boolean (Beast detect_ssl). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- logic -> config, core +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-logic", + description = "Boost.Logic 1.92.0 — tribool three-state boolean (Beast detect_ssl)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/logic", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/logic/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "c87ccdd307318d2d9dd80e462f3fe72ea635b8cf6a240956229ecceaa3de9eec", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/logic/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "c87ccdd307318d2d9dd80e462f3fe72ea635b8cf6a240956229ecceaa3de9eec", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/logic/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "c87ccdd307318d2d9dd80e462f3fe72ea635b8cf6a240956229ecceaa3de9eec", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_logic_anchor.cpp"] = [==[ +int mcpp_compat_boost_logic_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_logic_anchor.cpp" }, + targets = { ["boost_logic"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-move.lua b/pkgs/c/compat.boost-move.lua new file mode 100644 index 00000000..276b3c9d --- /dev/null +++ b/pkgs/c/compat.boost-move.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Move 1.92.0 — move-emulation traits and move-aware utilities. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- move -> config +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-move", + description = "Boost.Move 1.92.0 — move-emulation traits and move-aware utilities", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/move", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/move/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7e50df59f1e5ba7614a762255a58142a7c2eccb8fa23c59a8a27789f25cad762", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/move/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7e50df59f1e5ba7614a762255a58142a7c2eccb8fa23c59a8a27789f25cad762", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/move/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7e50df59f1e5ba7614a762255a58142a7c2eccb8fa23c59a8a27789f25cad762", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_move_anchor.cpp"] = [==[ +int mcpp_compat_boost_move_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_move_anchor.cpp" }, + targets = { ["boost_move"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-mp11.lua b/pkgs/c/compat.boost-mp11.lua new file mode 100644 index 00000000..48c1228c --- /dev/null +++ b/pkgs/c/compat.boost-mp11.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Mp11 1.92.0 — C++11 metaprogramming list/combinator library. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- mp11 -> (nothing) +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-mp11", + description = "Boost.Mp11 1.92.0 — C++11 metaprogramming list/combinator library", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/mp11", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/mp11/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a5754dc5ff9e7ff34119983889530e3ab8d8fb43ce2b4fea9c18673044df45d9", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/mp11/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a5754dc5ff9e7ff34119983889530e3ab8d8fb43ce2b4fea9c18673044df45d9", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/mp11/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "a5754dc5ff9e7ff34119983889530e3ab8d8fb43ce2b4fea9c18673044df45d9", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_mp11_anchor.cpp"] = [==[ +int mcpp_compat_boost_mp11_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_mp11_anchor.cpp" }, + targets = { ["boost_mp11"] = { kind = "lib" } }, + deps = { + -- (none: this header set's include closure stays inside boost/mp11/) + }, + }, +} diff --git a/pkgs/c/compat.boost-optional.lua b/pkgs/c/compat.boost-optional.lua new file mode 100644 index 00000000..4313d4bf --- /dev/null +++ b/pkgs/c/compat.boost-optional.lua @@ -0,0 +1,58 @@ +-- Form B inline descriptor for Boost.Optional 1.92.0 — optional values (Beast buffers_prefix uses in_place_init). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- optional -> assert, config, core, throw_exception, type_traits +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-optional", + description = "Boost.Optional 1.92.0 — optional values (Beast buffers_prefix uses in_place_init)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/optional", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/optional/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "6d914b02c45cea2294768c151589f5855e33d11d3491c613cee3382e27963a96", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/optional/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "6d914b02c45cea2294768c151589f5855e33d11d3491c613cee3382e27963a96", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/optional/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "6d914b02c45cea2294768c151589f5855e33d11d3491c613cee3382e27963a96", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_optional_anchor.cpp"] = [==[ +int mcpp_compat_boost_optional_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_optional_anchor.cpp" }, + targets = { ["boost_optional"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + ["compat.boost-type-traits"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-predef.lua b/pkgs/c/compat.boost-predef.lua new file mode 100644 index 00000000..4363af8b --- /dev/null +++ b/pkgs/c/compat.boost-predef.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Predef 1.92.0 — compiler/architecture/OS detection macros (feeds WinAPI). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- predef -> (nothing) +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-predef", + description = "Boost.Predef 1.92.0 — compiler/architecture/OS detection macros (feeds WinAPI)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/predef", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/predef/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4c870bcf7f547f3e3d1db26700b078a33f87c4c8232cd1c8d89ec82be6b54130", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/predef/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4c870bcf7f547f3e3d1db26700b078a33f87c4c8232cd1c8d89ec82be6b54130", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/predef/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "4c870bcf7f547f3e3d1db26700b078a33f87c4c8232cd1c8d89ec82be6b54130", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_predef_anchor.cpp"] = [==[ +int mcpp_compat_boost_predef_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_predef_anchor.cpp" }, + targets = { ["boost_predef"] = { kind = "lib" } }, + deps = { + -- (none: this header set's include closure stays inside boost/predef/) + }, + }, +} diff --git a/pkgs/c/compat.boost-preprocessor.lua b/pkgs/c/compat.boost-preprocessor.lua new file mode 100644 index 00000000..a59d6a01 --- /dev/null +++ b/pkgs/c/compat.boost-preprocessor.lua @@ -0,0 +1,54 @@ +-- Form B inline descriptor for Boost.Preprocessor 1.92.0 — preprocessor metaprogramming (feeds Utility/TypeTraits). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- preprocessor -> (nothing) +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-preprocessor", + description = "Boost.Preprocessor 1.92.0 — preprocessor metaprogramming (feeds Utility/TypeTraits)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/preprocessor", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/preprocessor/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7c8f444bb5cf5f37d594ca421938ef0271f7d9866275347f25ceabffb931de7d", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/preprocessor/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7c8f444bb5cf5f37d594ca421938ef0271f7d9866275347f25ceabffb931de7d", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/preprocessor/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7c8f444bb5cf5f37d594ca421938ef0271f7d9866275347f25ceabffb931de7d", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_preprocessor_anchor.cpp"] = [==[ +int mcpp_compat_boost_preprocessor_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_preprocessor_anchor.cpp" }, + targets = { ["boost_preprocessor"] = { kind = "lib" } }, + deps = { + -- (none: this header set's include closure stays inside boost/preprocessor/) + }, + }, +} diff --git a/pkgs/c/compat.boost-smart-ptr.lua b/pkgs/c/compat.boost-smart-ptr.lua new file mode 100644 index 00000000..615a8e12 --- /dev/null +++ b/pkgs/c/compat.boost-smart-ptr.lua @@ -0,0 +1,57 @@ +-- Form B inline descriptor for Boost.SmartPtr 1.92.0 — shared/weak/scoped pointers plus boost/shared_ptr.hpp shims. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- smart_ptr -> assert, config, core, throw_exception +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-smart-ptr", + description = "Boost.SmartPtr 1.92.0 — shared/weak/scoped pointers plus boost/shared_ptr.hpp shims", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/smart_ptr", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/smart_ptr/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "49994bb3d97b81fc877df3ae04595d922857939f65fd568019e7a2053dee648f", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/smart_ptr/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "49994bb3d97b81fc877df3ae04595d922857939f65fd568019e7a2053dee648f", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/smart_ptr/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "49994bb3d97b81fc877df3ae04595d922857939f65fd568019e7a2053dee648f", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_smart_ptr_anchor.cpp"] = [==[ +int mcpp_compat_boost_smart_ptr_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_smart_ptr_anchor.cpp" }, + targets = { ["boost_smart_ptr"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-static-string.lua b/pkgs/c/compat.boost-static-string.lua new file mode 100644 index 00000000..ad32ed2d --- /dev/null +++ b/pkgs/c/compat.boost-static-string.lua @@ -0,0 +1,59 @@ +-- Form B inline descriptor for Boost.StaticString 1.92.0 — fixed-capacity string behind beast::static_string. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- static_string -> assert, config, container_hash, core, throw_exception, utility +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-static-string", + description = "Boost.StaticString 1.92.0 — fixed-capacity string behind beast::static_string", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/static_string", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/static_string/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7a02f012eeb384d804605b76949e4f16e925e50731ba2d4b3a0074db1b959a4f", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/static_string/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7a02f012eeb384d804605b76949e4f16e925e50731ba2d4b3a0074db1b959a4f", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/static_string/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7a02f012eeb384d804605b76949e4f16e925e50731ba2d4b3a0074db1b959a4f", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_static_string_anchor.cpp"] = [==[ +int mcpp_compat_boost_static_string_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_static_string_anchor.cpp" }, + targets = { ["boost_static_string"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-container-hash"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + ["compat.boost-utility"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-system.lua b/pkgs/c/compat.boost-system.lua new file mode 100644 index 00000000..344ef706 --- /dev/null +++ b/pkgs/c/compat.boost-system.lua @@ -0,0 +1,60 @@ +-- Form B inline descriptor for Boost.System 1.92.0 — error_code/system_error and the boost/cerrno.hpp shim. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- system -> assert, compat, config, mp11, throw_exception, variant2, winapi +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-system", + description = "Boost.System 1.92.0 — error_code/system_error and the boost/cerrno.hpp shim", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/system", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/system/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7eead7ca317453ae546fb6444212c0429e909f102654b69847f8d8904d18735a", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/system/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7eead7ca317453ae546fb6444212c0429e909f102654b69847f8d8904d18735a", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/system/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "7eead7ca317453ae546fb6444212c0429e909f102654b69847f8d8904d18735a", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_system_anchor.cpp"] = [==[ +int mcpp_compat_boost_system_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_system_anchor.cpp" }, + targets = { ["boost_system"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-compat"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-mp11"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + ["compat.boost-variant2"] = "1.92.0", + ["compat.boost-winapi"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-type-index.lua b/pkgs/c/compat.boost-type-index.lua new file mode 100644 index 00000000..d5623111 --- /dev/null +++ b/pkgs/c/compat.boost-type-index.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.TypeIndex 1.92.0 — runtime type information with RTTI-free fallback. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- type_index -> config, container_hash, throw_exception +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-type-index", + description = "Boost.TypeIndex 1.92.0 — runtime type information with RTTI-free fallback", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/type_index", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/type_index/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5012b75aace9288c9c9d0d58e830fbbaac0331ac64638edced1f8c673e87f256", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/type_index/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5012b75aace9288c9c9d0d58e830fbbaac0331ac64638edced1f8c673e87f256", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/type_index/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "5012b75aace9288c9c9d0d58e830fbbaac0331ac64638edced1f8c673e87f256", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_type_index_anchor.cpp"] = [==[ +int mcpp_compat_boost_type_index_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_type_index_anchor.cpp" }, + targets = { ["boost_type_index"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + ["compat.boost-container-hash"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-utility.lua b/pkgs/c/compat.boost-utility.lua new file mode 100644 index 00000000..09bea92e --- /dev/null +++ b/pkgs/c/compat.boost-utility.lua @@ -0,0 +1,60 @@ +-- Form B inline descriptor for Boost.Utility 1.92.0 — result_of, compressed_pair, call_traits, in_place factories. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- utility -> assert, config, core, io, preprocessor, throw_exception, type_traits +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-utility", + description = "Boost.Utility 1.92.0 — result_of, compressed_pair, call_traits, in_place factories", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/utility", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/utility/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "41ef0d92840b0db9249f20ac17bbe1eca0ec1f35dd5261920a255475820b7c19", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/utility/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "41ef0d92840b0db9249f20ac17bbe1eca0ec1f35dd5261920a255475820b7c19", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/utility/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "41ef0d92840b0db9249f20ac17bbe1eca0ec1f35dd5261920a255475820b7c19", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_utility_anchor.cpp"] = [==[ +int mcpp_compat_boost_utility_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_utility_anchor.cpp" }, + targets = { ["boost_utility"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-core"] = "1.92.0", + ["compat.boost-io"] = "1.92.0", + ["compat.boost-preprocessor"] = "1.92.0", + ["compat.boost-throw-exception"] = "1.92.0", + ["compat.boost-type-traits"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-variant2.lua b/pkgs/c/compat.boost-variant2.lua new file mode 100644 index 00000000..5ffcb875 --- /dev/null +++ b/pkgs/c/compat.boost-variant2.lua @@ -0,0 +1,56 @@ +-- Form B inline descriptor for Boost.Variant2 1.92.0 — never-empty variant (feeds Boost.System's result). +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- variant2 -> assert, config, mp11 +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-variant2", + description = "Boost.Variant2 1.92.0 — never-empty variant (feeds Boost.System's result)", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/variant2", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/variant2/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "3137ec23fdfa5c7d67e31b5227b8ffd0dd918dec8f2fb9b6cebcb998f65c7180", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/variant2/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "3137ec23fdfa5c7d67e31b5227b8ffd0dd918dec8f2fb9b6cebcb998f65c7180", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/variant2/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "3137ec23fdfa5c7d67e31b5227b8ffd0dd918dec8f2fb9b6cebcb998f65c7180", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_variant2_anchor.cpp"] = [==[ +int mcpp_compat_boost_variant2_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_variant2_anchor.cpp" }, + targets = { ["boost_variant2"] = { kind = "lib" } }, + deps = { + ["compat.boost-assert"] = "1.92.0", + ["compat.boost-config"] = "1.92.0", + ["compat.boost-mp11"] = "1.92.0", + }, + }, +} diff --git a/pkgs/c/compat.boost-winapi.lua b/pkgs/c/compat.boost-winapi.lua new file mode 100644 index 00000000..5c2c0bd7 --- /dev/null +++ b/pkgs/c/compat.boost-winapi.lua @@ -0,0 +1,55 @@ +-- Form B inline descriptor for Boost.WinAPI 1.92.0 — WinAPI wrappers; owns boost/detail/winapi/* shims too. +-- Part of the modular-boost header family; see compat.boost-config for the +-- family wiring and version-train policy. Header closure verified by grepping +-- every `` include across the include tree (both `#include` and +-- `# include` spellings) and cross-checked against this repo's CMakeLists +-- INTERFACE line: +-- winapi -> config, predef +-- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. +package = { + spec = "1", + namespace = "compat", + name = "boost-winapi", + description = "Boost.WinAPI 1.92.0 — WinAPI wrappers; owns boost/detail/winapi/* shims too", + licenses = {"BSL-1.0"}, + repo = "https://github.com/boostorg/winapi", + type = "package", + + xpm = { + linux = { + ["1.92.0"] = { + url = "https://github.com/boostorg/winapi/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "09993abc4ba7b8238e9068983cda9db12b0e3ee39c8aed8e21162e98d0a3ad4e", + }, + }, + macosx = { + ["1.92.0"] = { + url = "https://github.com/boostorg/winapi/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "09993abc4ba7b8238e9068983cda9db12b0e3ee39c8aed8e21162e98d0a3ad4e", + }, + }, + windows = { + ["1.92.0"] = { + url = "https://github.com/boostorg/winapi/archive/refs/tags/boost-1.92.0.tar.gz", + sha256 = "09993abc4ba7b8238e9068983cda9db12b0e3ee39c8aed8e21162e98d0a3ad4e", + }, + }, + }, + + mcpp = { + language = "c++20", + import_std = false, + include_dirs = { "*/include" }, + generated_files = { + ["mcpp_generated/boost_winapi_anchor.cpp"] = [==[ +int mcpp_compat_boost_winapi_anchor(void) { return 0; } +]==], + }, + sources = { "mcpp_generated/boost_winapi_anchor.cpp" }, + targets = { ["boost_winapi"] = { kind = "lib" } }, + deps = { + ["compat.boost-config"] = "1.92.0", + ["compat.boost-predef"] = "1.92.0", + }, + }, +} diff --git a/tests/examples/boost-asio/mcpp.toml b/tests/examples/boost-asio/mcpp.toml new file mode 100644 index 00000000..b6908f70 --- /dev/null +++ b/tests/examples/boost-asio/mcpp.toml @@ -0,0 +1,12 @@ +# compat.boost-asio test project: the direct-consumer path for the boostorg +# asio tree — feature-define propagation (BOOST_ASIO_DISABLE_BOOST_* reach +# this TU), a real steady_timer round through io_context, and the coroutine +# surface (co_spawn + awaitable). Stackful spawn/deadline_timer stay absent +# by design; the descriptor's disable defines are what keep boost.context and +# boost.date_time out of the closure. +[package] +name = "boost-asio-tests" +version = "0.1.0" + +[dependencies.compat] +boost-asio = "1.92.0" diff --git a/tests/examples/boost-asio/tests/asio.cpp b/tests/examples/boost-asio/tests/asio.cpp new file mode 100644 index 00000000..c886bc75 --- /dev/null +++ b/tests/examples/boost-asio/tests/asio.cpp @@ -0,0 +1,55 @@ +// Behavioral test for compat.boost-asio: a real steady_timer fires through a +// running io_context, post/defech queue in order, and the C++20 coroutine +// surface (co_spawn + awaitable) adds numbers. All offline, no sockets. +#include + +int main() { + namespace asio = boost::asio; + using asio::ip::tcp; + bool ok = true; + + // 1. A steady_timer with a 1ms expiry actually wakes the io_context. + { + asio::io_context ctx; + bool fired = false; + asio::steady_timer timer(ctx, std::chrono::milliseconds(1)); + timer.async_wait([&](const boost::system::error_code& ec) { + fired = !ec.failed(); + }); + ctx.run(); + ok = ok && fired; + } + + // 2. post and defer both run; a strand-wrapped counter is consistent. + { + asio::io_context ctx; + int counter = 0; + asio::post(ctx, [&] { ++counter; }); + asio::defer(ctx, [&] { ++counter; }); + ctx.run(); + ok = ok && counter == 2; + } + + // 3. co_spawn + awaitable: the coroutine surface works end to end. + { + asio::io_context ctx; + auto adder = [](int a, int b) -> asio::awaitable { co_return a + b; }; + int result = 0; + asio::co_spawn( + ctx, + [&]() -> asio::awaitable { + result = co_await adder(20, 22); + }, + asio::detached); + ctx.run(); + ok = ok && result == 42; + } + + // 4. The tcp endpoint/address plumbing compiles and resolves offline. + { + tcp::endpoint ep(asio::ip::make_address("127.0.0.1"), 8080); + ok = ok && ep.address().is_loopback() && ep.port() == 8080; + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-beast/mcpp.toml b/tests/examples/boost-beast/mcpp.toml new file mode 100644 index 00000000..b02373df --- /dev/null +++ b/tests/examples/boost-beast/mcpp.toml @@ -0,0 +1,10 @@ +# compat.boost-beast test project: offline HTTP parse/serialize round-trip, +# zlib round-trip and SSL-detection — the assertions exercise the whole +# 25-package modular-boost closure transitively (asio, system, core, mp11, +# intrusive, ...) through one `#include `. +[package] +name = "boost-beast-tests" +version = "0.1.0" + +[dependencies.compat] +boost-beast = "1.92.0" diff --git a/tests/examples/boost-beast/tests/beast.cpp b/tests/examples/boost-beast/tests/beast.cpp new file mode 100644 index 00000000..88c08d95 --- /dev/null +++ b/tests/examples/boost-beast/tests/beast.cpp @@ -0,0 +1,163 @@ +// Behavioral test for compat.boost-beast, entirely offline: buffer types, +// HTTP request parsing, response serialize + parse round-trip, the error +// path on malformed input, the bundled zlib streams, and beast::static_string. +// Including the boost/beast.hpp aggregate forces one TU through core + http + +// websocket + zlib, which is what validates the whole modular-boost closure +// wiring (asio, system, mp11, intrusive, ...) against the 1.92.0 train. +#include + +#include + +int main() { + namespace beast = boost::beast; + namespace asio = boost::asio; + namespace http = beast::http; + namespace zlib = beast::zlib; + bool ok = true; + + // beast's parser.put() returns the number of octets it parsed and the + // caller must consume exactly that many from the dynamic buffer before + // feeding the rest — the same contract http::read() implements on top. + auto parse_all = [](auto& parser, beast::flat_buffer& buf) { + beast::error_code ec; + while (!parser.is_done()) { + auto const consumed = parser.put(buf.data(), ec); + if (ec.failed() || consumed == 0) break; + buf.consume(consumed); + } + return ec; + }; + + // 1. multi_buffer (an intrusive list of extents) holds appended chunks; + // flat_buffer linearizes them byte-for-byte. + { + beast::multi_buffer mb; + asio::const_buffer chunk("0123456789", 10); + mb.commit(asio::buffer_copy(mb.prepare(10), chunk)); + mb.commit(asio::buffer_copy(mb.prepare(10), chunk)); + ok = ok && mb.size() == 20; + + beast::flat_buffer fb; + fb.commit(asio::buffer_copy(fb.prepare(mb.size()), mb.data())); + ok = ok && beast::buffers_to_string(fb.data()) == + "01234567890123456789"; + } + + // 2\. Parse a request carrying headers and a body; assert the fields. + { + std::string const wire = + "PUT /things/42 HTTP/1.1\r\n" + "Host: example.com\r\n" + "Content-Type: text/plain\r\n" + "Content-Length: 5\r\n" + "\r\n" + "hello"; + beast::flat_buffer buf; + buf.commit(asio::buffer_copy(buf.prepare(wire.size()), + asio::buffer(wire))); + + http::request_parser parser; + beast::error_code ec = parse_all(parser, buf); + ok = ok && !ec.failed() && parser.is_done(); + + auto const& req = parser.get(); + ok = ok && req.method() == http::verb::put; + ok = ok && req.target() == "/things/42"; + ok = ok && req.version() == 11; + ok = ok && req["Host"] == "example.com"; + ok = ok && req["Content-Type"] == "text/plain"; + ok = ok && req.body() == "hello"; + } + + // 3\. Serialize a response, parse the wire bytes back; values survive. + { + http::response res{http::status::created, 11}; + res.set(http::field::content_type, "application/json"); + res.body() = "{\"ok\":true}"; + res.prepare_payload(); + + http::response_serializer sr(res); + std::string out; + beast::error_code sec; + while (!sr.is_done()) { + sr.next(sec, [&](beast::error_code const&, + auto const& bytes) { + out += beast::buffers_to_string(bytes); + sr.consume(beast::buffer_bytes(bytes)); + }); + } + ok = ok && !sec.failed(); + ok = ok && out.find("HTTP/1.1 201 Created\r\n") == 0; + ok = ok && + out.find("Content-Type: application/json") != std::string::npos; + ok = ok && out.find("{\"ok\":true}") != std::string::npos; + + beast::flat_buffer buf; + buf.commit(asio::buffer_copy(buf.prepare(out.size()), + asio::buffer(out))); + http::response_parser parser; + beast::error_code ec = parse_all(parser, buf); + ok = ok && !ec.failed() && parser.is_done(); + + auto const& back = parser.get(); + ok = ok && back.result() == http::status::created; + ok = ok && back.version() == 11; + ok = ok && back[http::field::content_type] == "application/json"; + ok = ok && back.body() == "{\"ok\":true}"; + } + + // 4\. Malformed input must fail the parser through beast's error type. + { + std::string const bad = "NONSENSE\r\n\r\n"; + beast::flat_buffer buf; + buf.commit(asio::buffer_copy(buf.prepare(bad.size()), + asio::buffer(bad))); + http::request_parser parser; + beast::error_code ec = parse_all(parser, buf); + ok = ok && ec.failed(); + } + + // 5\. The bundled zlib implementation (no external libz) round-trips data + // that compresses well. + { + std::string const text(8192, 'a'); + beast::error_code ec; + + zlib::deflate_stream def; + def.reset(6, 15, 8, zlib::Strategy::normal); + std::string comp(1024, '\0'); + zlib::z_params zd{}; + zd.next_in = text.data(); + zd.avail_in = text.size(); + zd.next_out = comp.data(); + zd.avail_out = comp.size(); + def.write(zd, zlib::Flush::full, ec); + ok = ok && !ec.failed(); + comp.resize(comp.size() - zd.avail_out); + ok = ok && !comp.empty() && comp.size() < text.size(); + + zlib::inflate_stream inf; + inf.reset(15); + std::string back(text.size() + 64, '\0'); + zlib::z_params zi{}; + zi.next_in = comp.data(); + zi.avail_in = comp.size(); + zi.next_out = back.data(); + zi.avail_out = back.size(); + inf.write(zi, zlib::Flush::none, ec); + ok = ok && !ec.failed(); + back.resize(back.size() - zi.avail_out); + ok = ok && back == text; + } + + // 6\. beast::static_string (boost/static_string) stays within capacity and + // compares like a string. + { + beast::static_string<16> s{"hello"}; + s.append(", world"); + ok = ok && s.size() == 12; + ok = ok && s == "hello, world"; + } + + return ok ? 0 : 1; +} From fd1dfe889c6cf5d9a73de5776c38039c88831fed Mon Sep 17 00:00:00 2001 From: wellwei <96378453+wellwei@users.noreply.github.com> Date: Sat, 5 Sep 2026 02:20:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(boost-asio):=20=E9=92=89=E5=AE=9A=20BOO?= =?UTF-8?q?ST=5FASIO=5FHAS=5FTHREADS=20=E2=80=94=20llvm-on-Windows=20?= =?UTF-8?q?=E9=9D=99=E9=BB=98=E9=80=80=E5=8C=96=E4=B8=BA=20null=5Fthread?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit workspace 的 llvm-on-Windows 工具链(clang → x86_64-pc-windows-msvc)不定义 _MT/_REENTRANT,boost::config 也给不出 BOOST_HAS_THREADS,asio 的探测 (detail/config.hpp)静默选中 null_thread,boost-asio 成员在 windows CI 上 运行即 crash(exit 0xC0000409)。与 chriskohlhoff.asio 钉 ASIO_HAS_THREADS 完全同构;该宏还参与 BOOST_ASIO_VERSION_TAG,跨 TU 必须一致,故作为 default feature 的 define 传播,boost-beast 侧同步重述。 linux/macos/windows 三平台语义一致,macOS 本地冷验证两成员仍通过。 --- .agents/docs/2026-09-05-add-boost-beast-plan.md | 12 ++++++++++-- CHANGELOG.md | 6 ++++-- pkgs/c/compat.boost-asio.lua | 13 +++++++++++-- pkgs/c/compat.boost-beast.lua | 15 +++++++++------ 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.agents/docs/2026-09-05-add-boost-beast-plan.md b/.agents/docs/2026-09-05-add-boost-beast-plan.md index 7369074c..4ac45d39 100644 --- a/.agents/docs/2026-09-05-add-boost-beast-plan.md +++ b/.agents/docs/2026-09-05-add-boost-beast-plan.md @@ -87,14 +87,22 @@ BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER BOOST_ASIO_DISABLE_BOOST_DATE_TIME ``` -二者经 compat.boost-asio 的 `default` → `no-boost-extras` feature 的 +二者经 compat.boost-asio 的 `default` → `asio-config` feature 的 `defines` 传播(先例:chriskohlhoff.asio 的 separate-compilation、 compat.curl 的 staticlib)。compat.boost-beast 的 default feature -**原样重述**这两个宏:feature defines 对直接消费者传播是已验证行为, +**原样重述**这些宏:feature defines 对直接消费者传播是已验证行为, 隔着中间包(beast)向消费者的传播没有现成先例,重述一遍保证 beast 消费者 的每个 TU 看到一致配置;两侧同值,幂等无 ODR 风险。 关闭后 beast 不用 spawn/deadline_timer,无能力损失。 +第三个宏 `BOOST_ASIO_HAS_THREADS`:workspace 的 llvm-on-Windows 工具链 +(clang → x86_64-pc-windows-msvc)不定义 `_MT`/`_REENTRANT`,boost::config +也给不出 `BOOST_HAS_THREADS`,asio 的探测(detail/config.hpp 1169-1190 行) +会静默选中 null_thread;且该宏参与 `BOOST_ASIO_VERSION_TAG`(符号级别名), +跨 TU 必须一致——所以必须作为 feature define 传播而不是 cflag。这是 CI +windows 腿上 boost-asio 成员首跑 crash(exit 0xC0000409)后的修正, +与 chriskohlhoff.asio 钉 `ASIO_HAS_THREADS` 完全同构。 + ## 命名 包名一律 kebab:`boost-container-hash`、`boost-smart-ptr`、 diff --git a/CHANGELOG.md b/CHANGELOG.md index a8e766fb..fbee7945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,10 @@ `boost-preprocessor`、`boost-smart-ptr`、`boost-static-string`、`boost-system`、 `boost-type-index`、`boost-utility`、`boost-variant2`、`boost-winapi`。 29 包 include 树两两不相交、闭包逐 include 核实;`boost-asio` 经 default - feature 携带 `BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER` / `..._DATE_TIME`, - 保持家族 header-only。新增 `boost-beast` 与 `boost-asio` 两个工作区成员。 + feature 携带 `BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER` / `..._DATE_TIME` + 与 `BOOST_ASIO_HAS_THREADS`(llvm-on-Windows 无 `_MT`/`BOOST_HAS_THREADS`, + 不钉定会静默退化为 null_thread 且 VERSION_TAG 跨 TU 漂移),保持家族 + header-only。新增 `boost-beast` 与 `boost-asio` 两个工作区成员。 - 收录 `gzj-creator.galay` 5.0.2 原生 Form-A 模块包,覆盖 `galay.utils` 与 `galay.kernel` 默认模块,并加入 Unix 示例工程和索引文档。 diff --git a/pkgs/c/compat.boost-asio.lua b/pkgs/c/compat.boost-asio.lua index 7c2374bc..958ac664 100644 --- a/pkgs/c/compat.boost-asio.lua +++ b/pkgs/c/compat.boost-asio.lua @@ -85,12 +85,21 @@ int mcpp_compat_boost_asio_anchor(void) { return 0; } -- every TU that compiles an asio header — direct consumers here, and -- compat.boost-beast consumers through its own identical default -- feature (idempotent, same values — see that descriptor). + -- + -- BOOST_ASIO_HAS_THREADS is pinned for the same reason + -- chriskohlhoff.asio pins ASIO_HAS_THREADS: the workspace's + -- llvm-on-Windows toolchain (clang → x86_64-pc-windows-msvc) defines + -- no _MT/_REENTRANT and boost::config yields no BOOST_HAS_THREADS, so + -- asio's own detection (detail/config.hpp) silently selects + -- null_thread. It also feeds BOOST_ASIO_VERSION_TAG, so it must agree + -- across every TU — hence a feature define, not a cflag. features = { - ["default"] = { implies = { "no-boost-extras" } }, - ["no-boost-extras"] = { + ["default"] = { implies = { "asio-config" } }, + ["asio-config"] = { defines = { "BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER", "BOOST_ASIO_DISABLE_BOOST_DATE_TIME", + "BOOST_ASIO_HAS_THREADS", }, }, }, diff --git a/pkgs/c/compat.boost-beast.lua b/pkgs/c/compat.boost-beast.lua index 0c650e72..bd21bf36 100644 --- a/pkgs/c/compat.boost-beast.lua +++ b/pkgs/c/compat.boost-beast.lua @@ -30,10 +30,12 @@ -- single-file boost/type_index.hpp shims (a dir-only grep would miss it — -- that mistake cost the first draft of this closure a dependency). -- --- The default feature re-states boost-asio's two disable defines: feature --- defines propagate to direct consumers, and restating them here keeps a --- beast consumer's TUs consistent even if transitive propagation through an --- intermediate package ever changes. Same values on both sides = idempotent. +-- The default feature re-states boost-asio's three runtime defines (the two +-- optional-boost disables plus BOOST_ASIO_HAS_THREADS, which feeds +-- BOOST_ASIO_VERSION_TAG): feature defines propagate to direct consumers, and +-- restating them here keeps a beast consumer's TUs consistent even if +-- transitive propagation through an intermediate package ever changes. Same +-- values on both sides = idempotent. -- -- Header-only, traditional `#include` consumption; no CN mirror yet; BSL-1.0. package = { @@ -81,11 +83,12 @@ int mcpp_compat_boost_beast_anchor(void) { return 0; } sources = { "mcpp_generated/boost_beast_anchor.cpp" }, targets = { ["boost_beast"] = { kind = "lib" } }, features = { - ["default"] = { implies = { "asio-no-boost-extras" } }, - ["asio-no-boost-extras"] = { + ["default"] = { implies = { "asio-config" } }, + ["asio-config"] = { defines = { "BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER", "BOOST_ASIO_DISABLE_BOOST_DATE_TIME", + "BOOST_ASIO_HAS_THREADS", }, }, }, From 966e3261cb2ff435f78e1abf17909ec19dcf7831 Mon Sep 17 00:00:00 2001 From: wellwei <96378453+wellwei@users.noreply.github.com> Date: Sat, 5 Sep 2026 02:53:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?test(boost-family):=20=E5=A4=A7=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=88=90=E5=91=98=20=E2=80=94=20=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=A6=86=E7=9B=96=E5=85=A8=E9=83=A8=2023=20?= =?UTF-8?q?=E4=B8=AA=E5=B0=8F=E4=BE=9D=E8=B5=96=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 tests/examples/boost-family/:消费 modular-boost 家族所有没有专属 成员的小包(align/bind/compat/container/container-hash/core/describe/ endian/intrusive/io/logic/move/mp11/optional/predef/preprocessor/ smart-ptr/static-string/system/type-index/utility/variant2/winapi), 按主题分 6 个 tests/*.cpp,每个组件都有可失败的行为断言: core-smart core(addressof/empty_value/ref) + smart-ptr + move containers container(vector) + intrusive(list) + optional + static-string meta mp11 + describe + preprocessor + type-index + predef system-errors system(error_code/system_error) + compat(invoke) + bind bytes-logic endian + container-hash + logic(tribool) + align io-platform io(ios_flags_saver) + utility(compressed_pair) + winapi 实测踩坑固化进注释:tribool 连 operator! 都返回 tribool(取 bool 走 explicit 转换/indeterminate());boost/winapi 头非 Windows 平台 #error (include 与断言均在 _WIN32 门控内,由 windows CI 腿真实覆盖); intrusive::list 析构前必须 clear(带链析构触发调试断言)。 mcpp 2026.8.27.2 本地冷验证:6/6 test result ok。 --- .../docs/2026-09-05-add-boost-beast-plan.md | 13 +++- CHANGELOG.md | 7 +- mcpp.toml | 1 + tests/examples/boost-family/mcpp.toml | 32 +++++++++ .../boost-family/tests/bytes-logic.cpp | 64 +++++++++++++++++ .../boost-family/tests/containers.cpp | 60 ++++++++++++++++ .../boost-family/tests/core-smart.cpp | 52 ++++++++++++++ .../boost-family/tests/io-platform.cpp | 58 +++++++++++++++ tests/examples/boost-family/tests/meta.cpp | 71 +++++++++++++++++++ .../boost-family/tests/system-errors.cpp | 65 +++++++++++++++++ 10 files changed, 421 insertions(+), 2 deletions(-) create mode 100644 tests/examples/boost-family/mcpp.toml create mode 100644 tests/examples/boost-family/tests/bytes-logic.cpp create mode 100644 tests/examples/boost-family/tests/containers.cpp create mode 100644 tests/examples/boost-family/tests/core-smart.cpp create mode 100644 tests/examples/boost-family/tests/io-platform.cpp create mode 100644 tests/examples/boost-family/tests/meta.cpp create mode 100644 tests/examples/boost-family/tests/system-errors.cpp diff --git a/.agents/docs/2026-09-05-add-boost-beast-plan.md b/.agents/docs/2026-09-05-add-boost-beast-plan.md index 4ac45d39..6e5c4742 100644 --- a/.agents/docs/2026-09-05-add-boost-beast-plan.md +++ b/.agents/docs/2026-09-05-add-boost-beast-plan.md @@ -127,7 +127,18 @@ throw-exception);仓库 URL 与注释中保留上游仓原名 `container_has 消费 TU;真实跑 `steady_timer` + `io_context::run`、post/defer、 co_spawn/awaitable、tcp endpoint。`#include ` 单体头 顺带验证 disable 宏守卫下单体 include 可用。 -- 两成员只消费 `compat` 命名空间,继承根 workspace 的 `[indices]` +- `tests/examples/boost-family/`:**大测试成员**,一次性消费全部 23 个没有 + 专属成员的小依赖包(align/bind/compat/container/container-hash/core/ + describe/endian/intrusive/io/logic/move/mp11/optional/predef/preprocessor/ + smart-ptr/static-string/system/type-index/utility/variant2/winapi), + 按主题分 6 个 tests/*.cpp(core-smart / containers / meta / + system-errors / bytes-logic / io-platform),每个组件都有可失败断言。 + 实测踩坑三则已固化进测试注释:boost::logic::tribool 连 `operator!` 都 + 返回 tribool(取 bool 只能 explicit 转换或 indeterminate()); + boost/winapi 头在非 Windows 平台 `#error`(include 与断言都在 + `#ifdef _WIN32` 内,由 windows CI 腿真实覆盖);intrusive::list 析构前 + 必须 clear(调试断言 hook 不得带链析构)。 +- 三成员只消费 `compat` 命名空间,继承根 workspace 的 `[indices]` 重定向,不声明自己的 indices。 - 正向验证在 CI(linux/macos/windows 三平台);无 feature 需要负向验证 (无源码门控),disable 宏的"负向"体现在:闭包树里根本没有 diff --git a/CHANGELOG.md b/CHANGELOG.md index fbee7945..1cb0c9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,12 @@ feature 携带 `BOOST_ASIO_DISABLE_BOOST_CONTEXT_FIBER` / `..._DATE_TIME` 与 `BOOST_ASIO_HAS_THREADS`(llvm-on-Windows 无 `_MT`/`BOOST_HAS_THREADS`, 不钉定会静默退化为 null_thread 且 VERSION_TAG 跨 TU 漂移),保持家族 - header-only。新增 `boost-beast` 与 `boost-asio` 两个工作区成员。 + header-only。新增 `boost-beast`、`boost-asio`、`boost-family` 三个工作区 + 成员;其中 `boost-family` 为大测试成员,一个工程 6 个测试文件覆盖全部 + 23 个没有专属成员的小依赖包(core/smart-ptr、container/intrusive/ + optional/static-string、mp11/describe/preprocessor/type-index/predef、 + system/compat/bind、endian/container-hash/logic/align、io/utility/ + winapi)。 - 收录 `gzj-creator.galay` 5.0.2 原生 Form-A 模块包,覆盖 `galay.utils` 与 `galay.kernel` 默认模块,并加入 Unix 示例工程和索引文档。 diff --git a/mcpp.toml b/mcpp.toml index f055874b..656d410f 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -16,6 +16,7 @@ members = [ "tests/examples/boost-beast", "tests/examples/boost-config", "tests/examples/boost-ext.ut", + "tests/examples/boost-family", "tests/examples/boost-throw-exception", "tests/examples/boost-type-traits", "tests/examples/boost-uuid", diff --git a/tests/examples/boost-family/mcpp.toml b/tests/examples/boost-family/mcpp.toml new file mode 100644 index 00000000..eeb19873 --- /dev/null +++ b/tests/examples/boost-family/mcpp.toml @@ -0,0 +1,32 @@ +# compat boost 家族"大测试"成员:为每个没有专属成员的小依赖包提供行为断言。 +# 消费全部 23 个小包(boost-beast / boost-asio / 既有 uuid/config/assert/ +# throw-exception/type-traits 各有专属成员,不在其中),按主题分成 6 个 +# tests/*.cpp,每个组件都有可失败的有效断言。 +[package] +name = "boost-family-tests" +version = "0.1.0" + +[dependencies.compat] +boost-align = "1.92.0" +boost-bind = "1.92.0" +boost-compat = "1.92.0" +boost-container = "1.92.0" +boost-container-hash = "1.92.0" +boost-core = "1.92.0" +boost-describe = "1.92.0" +boost-endian = "1.92.0" +boost-intrusive = "1.92.0" +boost-io = "1.92.0" +boost-logic = "1.92.0" +boost-move = "1.92.0" +boost-mp11 = "1.92.0" +boost-optional = "1.92.0" +boost-predef = "1.92.0" +boost-preprocessor = "1.92.0" +boost-smart-ptr = "1.92.0" +boost-static-string = "1.92.0" +boost-system = "1.92.0" +boost-type-index = "1.92.0" +boost-utility = "1.92.0" +boost-variant2 = "1.92.0" +boost-winapi = "1.92.0" diff --git a/tests/examples/boost-family/tests/bytes-logic.cpp b/tests/examples/boost-family/tests/bytes-logic.cpp new file mode 100644 index 00000000..46fbcf19 --- /dev/null +++ b/tests/examples/boost-family/tests/bytes-logic.cpp @@ -0,0 +1,64 @@ +// boost-endian (byte-order conversion), boost-container-hash (hashing), +// boost-logic (tribool) and boost-align (pointer alignment helpers). +#include +#include +#include +#include +#include +#include + +#include +#include + +int main() { + bool ok = true; + + // endian: reversing is an involution with byte-exact results. + { + std::uint32_t x = 0x01020304u; + ok = ok && boost::endian::endian_reverse(x) == 0x04030201u; + ok = ok && + boost::endian::endian_reverse(boost::endian::endian_reverse(x)) == x; + } + + // container-hash: deterministic within a process; combining is stable. + { + boost::hash hs; + ok = ok && hs("abc") == hs("abc"); + + const std::vector v1{1, 2, 3}, v2{1, 2, 3}; + std::size_t seed = 0; + boost::hash_range(seed, v1.begin(), v1.end()); + std::size_t seed2 = 0; + boost::hash_range(seed2, v2.begin(), v2.end()); + ok = ok && seed == seed2 && seed != 0; + } + + // logic: three-valued truth table entry points used by beast::detect_ssl. + // Every operator (including !) returns tribool; the explicit conversion + // and the indeterminate() free function are the way back to bool. + { + using boost::logic::indeterminate; + using boost::logic::tribool; + tribool t = true, f = false, i = indeterminate; + + ok = ok && static_cast(t) && !static_cast(f); + ok = ok && indeterminate(i); + ok = ok && indeterminate(t && i); + ok = ok && static_cast(t || i); // true dominates OR + ok = ok && !static_cast(f && i); // false dominates AND + ok = ok && indeterminate(i || f) && indeterminate(i && t); + } + + // align: round-tripping through align_up lands on the boundary and + // align_down undoes it. + { + alignas(64) char raw[128]; + ok = ok && boost::alignment::is_aligned(boost::alignment::align_up(raw, 64), 64); + ok = ok && boost::alignment::align_down( + boost::alignment::align_up(raw, 64), 64) == + boost::alignment::align_up(raw, 64); + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-family/tests/containers.cpp b/tests/examples/boost-family/tests/containers.cpp new file mode 100644 index 00000000..25a8860d --- /dev/null +++ b/tests/examples/boost-family/tests/containers.cpp @@ -0,0 +1,60 @@ +// boost-container (vector), boost-intrusive (list), boost-optional +// and boost-static-string. +#include +#include +#include +#include + +int main() { + bool ok = true; + + // container: an STL-compatible vector that is not std::vector. + { + boost::container::vector vec; + for (int i = 0; i < 100; ++i) vec.push_back(i); + ok = ok && vec.size() == 100 && vec.back() == 99 && vec[42] == 42; + } + + // intrusive: the list only links; ownership stays with the nodes. + { + namespace intr = boost::intrusive; + struct Node : intr::list_base_hook<> { + int v; + explicit Node(int x) : v(x) {} + }; + intr::list lst; + Node a(1), b(2), c(3); + lst.push_back(a); + lst.push_back(b); + lst.push_back(c); + ok = ok && lst.size() == 3 && lst.front().v == 1 && lst.back().v == 3; + + lst.pop_front(); + ok = ok && lst.front().v == 2 && a.v == 1; // a outlives its unlinking + + lst.clear(); // unlink everything: hooks must not die while linked + ok = ok && lst.empty(); + } + + // optional: empty/engaged lifecycle and value_or fallback. + { + boost::optional o; + ok = ok && !o && o.value_or(-1) == -1; + + o = 9; + ok = ok && o && *o == 9 && o.value() == 9; + + o.reset(); + ok = ok && !o; + } + + // static-string: fixed-capacity string with a compile-time bound. + { + boost::static_strings::static_string<8> s("abc"); + s += "def"; + ok = ok && s == "abcdef" && s.size() == 6; + ok = ok && s.compare(0, 3, "abc") == 0; + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-family/tests/core-smart.cpp b/tests/examples/boost-family/tests/core-smart.cpp new file mode 100644 index 00000000..21ae4fdd --- /dev/null +++ b/tests/examples/boost-family/tests/core-smart.cpp @@ -0,0 +1,52 @@ +// boost-core (addressof / empty_value / ref), boost-smart-ptr +// (shared_ptr/weak_ptr/make_shared) and boost-move (movelib::unique_ptr). +#include +#include +#include +#include +#include +#include +#include +#include + +int main() { + bool ok = true; + + // core: addressof survives overloaded operator&, ref wraps without copies. + { + struct Tricky { + int v = 7; + Tricky* operator&() const { return nullptr; } + } tricky; + ok = ok && boost::addressof(tricky) != nullptr; + ok = ok && boost::addressof(tricky)->v == 7; + + auto r = boost::cref(tricky.v); + ok = ok && r.get() == 7; + } + + // core: empty_value with a non-empty payload stores and returns it. + { + boost::empty_value ev(boost::empty_init_t(), 42); + ok = ok && ev.get() == 42; + } + + // smart-ptr: reference counting across shared/weak. + { + boost::shared_ptr sp = boost::make_shared(5); + boost::weak_ptr wp = sp; + ok = ok && sp.use_count() == 1 && *sp == 5 && !wp.expired(); + + sp.reset(); + ok = ok && wp.expired() && wp.lock() == boost::shared_ptr(); + } + + // move: movelib::unique_ptr transfers sole ownership. + { + boost::movelib::unique_ptr up = boost::movelib::make_unique(11); + boost::movelib::unique_ptr up2 = boost::move(up); + ok = ok && !up && up2 && *up2 == 11; + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-family/tests/io-platform.cpp b/tests/examples/boost-family/tests/io-platform.cpp new file mode 100644 index 00000000..c2c4ec8b --- /dev/null +++ b/tests/examples/boost-family/tests/io-platform.cpp @@ -0,0 +1,58 @@ +// boost-io (stream state savers), boost-utility (compressed_pair) and +// boost-winapi (WinAPI type shims — compilable only where Win32 exists). +#include +#include + +#include +#include +#include + +#ifdef _WIN32 +#include +#endif + +int main() { + bool ok = true; + + // io: RAII flag saver restores the stream's formatting state. + { + std::ostringstream os; + os << 255; + ok = ok && os.str() == "255"; + + os.str(""); + { + boost::io::ios_flags_saver fs(os); + os << std::hex << 255; + ok = ok && os.str() == "ff"; + } + + os.str(""); + os << 255; + ok = ok && os.str() == "255"; // hex did not leak + } + + // utility: compressed_pair — empty-base-optimized pair with accessors. + { + boost::compressed_pair cp(3, "three"); + ok = ok && cp.first() == 3 && cp.second() == "three"; + + // Both members empty: compiles and stays stateless in practice. + struct Nothing {}; + boost::compressed_pair empty_pair{}; + ok = ok && sizeof(empty_pair) <= sizeof(Nothing) * 2; + } + + // winapi: the shims declare the Win32 surface themselves, but the + // headers are Windows-only to compile (they #error elsewhere), so real + // assertions run under the Windows CI leg only. + { +#ifdef _WIN32 + ok = ok && std::is_pointer::value; + ok = ok && std::is_integral::value; + ok = ok && sizeof(boost::winapi::DWORD_) >= 4; +#endif + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-family/tests/meta.cpp b/tests/examples/boost-family/tests/meta.cpp new file mode 100644 index 00000000..84c607e7 --- /dev/null +++ b/tests/examples/boost-family/tests/meta.cpp @@ -0,0 +1,71 @@ +// boost-mp11 (list metaprogramming), boost-describe (enum reflection), +// boost-preprocessor (token repetition), boost-type-index (runtime type +// identity) and boost-predef (platform/compiler detection). +#include +#include +#include +#include +#include +#include +#include + +#include + +// Enumerators must be visible at global scope for the describe macros. +enum class Color { red = 1, green = 2, blue = 4 }; +BOOST_DESCRIBE_ENUM(Color, red, green, blue) + +#define FAMILY_INC(z, n, d) + (n) + +int main() { + bool ok = true; + + // mp11: list size and per-type iteration. + { + using L = boost::mp11::mp_list; + ok = ok && boost::mp11::mp_size::value == 3; + + int total = 0; + boost::mp11::mp_for_each([&](auto t) { total += sizeof(decltype(t)); }); + ok = ok && total > 0 && total >= 3; + } + + // describe: enumerate (name, value) pairs without RTTI tricks. + { + int count = 0; + bool blueNamed = false; + boost::mp11::mp_for_each>( + [&](auto d) { + ++count; + if (d.value == Color::blue) + blueNamed = std::string(d.name) == "blue"; + }); + ok = ok && count == 3 && blueNamed; + } + + // preprocessor: stringize/cat composition and unrolled repetition. + { + ok = ok && std::string(BOOST_PP_STRINGIZE(BOOST_PP_CAT(fo, o))) == "foo"; + + int total = BOOST_PP_REPEAT(5, FAMILY_INC, 0); // + 0 + 1 + 2 + 3 + 4 + ok = ok && total == 10; + } + + // type-index: runtime type identity with a readable name. + { + namespace ti = boost::typeindex; + ok = ok && ti::type_id() == ti::type_id(); + ok = ok && ti::type_id() != ti::type_id(); + ok = ok && std::string(ti::type_id().pretty_name()).find("int") != + std::string::npos; + } + + // predef: the platform and compiler we run the index's CI on must be + // detected (predef defines every macro, 0 when not detected). + { + ok = ok && (BOOST_OS_LINUX || BOOST_OS_MACOS || BOOST_OS_WINDOWS) != 0; + ok = ok && (BOOST_COMP_CLANG || BOOST_COMP_GNUC || BOOST_COMP_MSVC) != 0; + } + + return ok ? 0 : 1; +} diff --git a/tests/examples/boost-family/tests/system-errors.cpp b/tests/examples/boost-family/tests/system-errors.cpp new file mode 100644 index 00000000..099d0c88 --- /dev/null +++ b/tests/examples/boost-family/tests/system-errors.cpp @@ -0,0 +1,65 @@ +// boost-system (error_code/system_error), boost-compat (invoke backport) +// and boost-bind (bind/mem_fn with placeholders). +#include +#include +#include +#include + +#include + +int family_sub(int a, int b) { return a - b; } + +struct Point { + int x = 31; + int get() const { return x; } +}; + +int main() { + bool ok = true; + + // system: generic errc mapping, category identity, throwing with a code. + { + namespace sys = boost::system; + sys::error_code ec = sys::errc::make_error_code(sys::errc::invalid_argument); + ok = ok && static_cast(ec); + ok = ok && ec == sys::errc::invalid_argument; + ok = ok && ec.category() == sys::generic_category(); + + bool caught = false; + try { + throw sys::system_error(ec); + } catch (const sys::system_error& e) { + caught = e.code() == sys::errc::invalid_argument; + } + ok = ok && caught; + } + + // compat: C++11-17 std::invoke backport, including member-object access. + { + struct Inc { + int operator()(int x) const { return x + 1; } + }; + ok = ok && boost::compat::invoke(Inc{}, 41) == 42; + ok = ok && boost::compat::invoke([](int a, int b) { return a * b; }, 6, 7) == 42; + + Point p; + ok = ok && boost::compat::invoke(&Point::x, p) == 31; + ok = ok && boost::compat::invoke(&Point::get, p) == 31; + } + + // bind: partial application through placeholders, plus mem_fn. + { + namespace ph = boost::placeholders; + auto f = boost::bind(family_sub, ph::_1, 3); + ok = ok && f(10) == 7; + + Point p; + auto byName = boost::bind(&Point::x, ph::_1); + ok = ok && byName(p) == 31; + + auto m = boost::mem_fn(&Point::get); + ok = ok && m(p) == 31; + } + + return ok ? 0 : 1; +}