diff --git a/.agents/docs/2026-09-26-plugins-0.15-architecture-plan.md b/.agents/docs/2026-09-26-plugins-0.15-architecture-plan.md index 903b03a..356fd35 100644 --- a/.agents/docs/2026-09-26-plugins-0.15-architecture-plan.md +++ b/.agents/docs/2026-09-26-plugins-0.15-architecture-plan.md @@ -125,7 +125,7 @@ rules-qt 的 SDK 查找顺序为 `options::root` → `QT_ROOT_DIR`(不采用 ` ## 6. 规范与文档 - **README**:精简为约 100 行(原 1113 行),开篇陈述 §0 的总纲;各成员细节移至 `docs/<成员>.md`。 -- **`docs/plugin-development.md`(新增)**:包含职责分层表和十条规则: +- **`docs/01-plugin-development.md`(新增)**:包含职责分层表和十条规则: 1. 机制而非策略; 2. feature 只表达机制; 3. build.mcpp 为先的三级配置; diff --git a/.agents/docs/2026-09-27-mcpp-2026.9.27.1-ecosystem-plan.md b/.agents/docs/2026-09-27-mcpp-2026.9.27.1-ecosystem-plan.md index 45d4a95..5a3bfeb 100644 --- a/.agents/docs/2026-09-27-mcpp-2026.9.27.1-ecosystem-plan.md +++ b/.agents/docs/2026-09-27-mcpp-2026.9.27.1-ecosystem-plan.md @@ -144,11 +144,11 @@ A1 至 A4 可以并行。B3 不依赖 B2:旧版 xlings 忽略 revision 字段 - **C0 预验证:** `ci.yml` 的 `workflow_dispatch` 接受 mcpp 的分支名。在 B4a 之后以该分支运行 plugins 全部 CI,mcpp 发布前就能发现生态回归。 - **C1 内容:** - - 引擎最低版本改为 2026.9.27.1:`ci.yml:54`、README 功能表、`docs/deps.md` 与 `docs/rules-qt.md` 的版本说明。 + - 引擎最低版本改为 2026.9.27.1:`ci.yml:54`、README 功能表、`docs/40-deps.md` 与 `docs/11-rules-qt.md` 的版本说明。 - 删除 `rules/qt.cppm:365-374` 的静默分支:#715 修复后,引擎不再为这种包合成程序。fixture `qt-import-only` 改为断言"没有构建程序运行",作为引擎行为的回归测试。 - 四个 Qt fixture 的 `cxx_runtime = "toolchain-coupled"` 从 `[build]` 移到 `[target.x86_64-linux-gnu]` 与 `[target.aarch64-linux-gnu]`,同时成为 #704 的端到端验证。 - `check-deps-and-qt.sh` 中七处 `--profile dev` 是 #705 的规避手段。逐处去掉,并在三平台上确认第二次构建不重新安装。 - - `docs/rules-qt.md:62、98` 中关于 #715、#704 的规避说明改写为现行行为。 + - `docs/11-rules-qt.md:62、98` 中关于 #715、#704 的规避说明改写为现行行为。 - **发布:** 按 mcpp-plugins 发布流程:tag、GitCode 镜像、mcpp-index 登记。 ### 3.5 阶段 D:沙箱真实验证 diff --git a/.agents/docs/2026-09-27-plugins-0.15.2-plan.md b/.agents/docs/2026-09-27-plugins-0.15.2-plan.md index 950b2cf..f285fd4 100644 --- a/.agents/docs/2026-09-27-plugins-0.15.2-plan.md +++ b/.agents/docs/2026-09-27-plugins-0.15.2-plan.md @@ -41,7 +41,7 @@ D1 的索引改动只是删除冗余键;消费方的切换不依赖它先合 ### 2.3 mcpp-plugins 0.15.2:一个 PR - `rules/qt.cppm`:缺少 SDK 时的提示改为 `"xim:qt-base" = "6.11.1"`。 -- 测试 fixture(qt-consumer、qt-widgets-consumer)与 `docs/rules-qt.md`、README:版本改为 `6.11.1`。 +- 测试 fixture(qt-consumer、qt-widgets-consumer)与 `docs/11-rules-qt.md`、README:版本改为 `6.11.1`。 - `ci.yml`:沙箱缓存 key 的前缀加代次(`mcpp-sandbox-v2-…`),`restore-keys` 同步修改。仅 fixture 哈希变化不够:现有 `restore-keys` 前缀会恢复持有旧 6.11.1 的缓存。 - 验收:三平台 CI 全绿。其中 Linux 的 widgets 打包检查要确认新缓存下装出的 `6.11.1` 带有运行时闭包(libdbus、xkbcommon、fontconfig),这正是 D1 的实证。 - 发布:tag v0.15.2、GitCode 镜像(sha256 比对)、mcpp-index 登记。 diff --git a/.agents/docs/2026-10-01-ecosystem-build-plugin-framework-plan.md b/.agents/docs/2026-10-01-ecosystem-build-plugin-framework-plan.md index 21ae403..37fc250 100644 --- a/.agents/docs/2026-10-01-ecosystem-build-plugin-framework-plan.md +++ b/.agents/docs/2026-10-01-ecosystem-build-plugin-framework-plan.md @@ -216,8 +216,8 @@ sha256 `40b9fa16be5628a5d277824f961faa33dadbf84d9520cff9fe2aeb9b0b217ebf`(下载 ## 4.1 面向两类读者的参考文档(2026-10-02 追加) -`docs/tool-sources.md`(372 行,README 与 plugin-development.md 各有入口)。写它的理由是: -机制此前在三处分别被记下——引擎的键在 mcpp docs/23、模块的接口在 plugin-development.md、 +`docs/02-tool-sources.md`(372 行,README 与 01-plugin-development.md 各有入口)。写它的理由是: +机制此前在三处分别被记下——引擎的键在 mcpp docs/23、模块的接口在 01-plugin-development.md、 每个成员的选项在各自页面——而**没有一处说出必须同时成立的那两半**: `build.mcpp` 里的 `tool::choice` 只有在插件把该载荷声明为 `provision = "on-request"` 时才等于 「不下载」,因为 eager 的载荷在任何构建程序运行之前就已供给。这正是 mcpp#755 的原始症状, @@ -291,7 +291,7 @@ framework-lab 的 8 个用例在 ubuntu-24.04、macos-15、windows-2022 上全 | 用户体验 | 每个显式来源一行,带类与 `file:line`;每条拒绝都列出命名它的四种方式;`considered` 记下每一层问过什么、答了什么 | | 兼容性 | **未迁移的第三方插件无需改动即受益**(覆盖发生在引擎层,`xpkg_dir` 直接回答);成员的历史环境变量保留;地板不满足时的拒绝现在会点名地板与升级方式(第 7 处发现) | | 跨平台 | Linux / macOS / Windows 全绿。跨平台本身贡献了 5 处发现:响应文件的两种 tokenize 语法、Darwin 的 `environ`、宿主自己补的 `.exe` 后缀、Apple 链接形状拿不到 `--ld-path`、gcc 16 的 `always_inline` 拒绝 | -| 一致性 | 优先级只写两份(核心、L2);中英文档结构一一对应;`docs/tool-sources.md` 补上了此前三处分散记述都没说出的那一对条件 | +| 一致性 | 优先级只写两份(核心、L2);中英文档结构一一对应;`docs/02-tool-sources.md` 补上了此前三处分散记述都没说出的那一对条件 | | 无感升级 | 不写任何新键的工程行为与输出不变,由既有 e2e 与 framework-lab 的 `default` 用例断言;插件 0.19.0 的成员在默认路径上下载与输出不变 | | 测试覆盖 | 单测 144(新增 21);e2e 873-877 加 875 里 gcc 拒绝的反例;`plugin-logic` 29 例;framework-lab 10 例 × 3 平台;toolchain-lab 8 例 × 3 平台;CI 判据读 `resolution.json`,所以在已装载荷的 runner 上也能断言「这次没要求它」 | diff --git a/.agents/docs/2026-11-24-rules-qml-design.md b/.agents/docs/2026-11-24-rules-qml-design.md index 3b0f5fa..454fd24 100644 --- a/.agents/docs/2026-11-24-rules-qml-design.md +++ b/.agents/docs/2026-11-24-rules-qml-design.md @@ -178,7 +178,7 @@ Windows 与 macOS 没有实测机器:凡依赖它们的结论都标"推断", - QML:部署 `QtQuick/Layouts` 的插件后,包里没有 `libQt6QuickLayouts.so.6`;Controls 的 `libQt6QuickControls2Impl.so.6` 同样缺。 - **现有 `rules-qt` 的平台插件也有同一缺口**:对已部署 `platforms/` 的打包目录逐个读依赖,缺 `libQt6XcbQpa.so.6`(`libqxcb.so`)、`libQt6WaylandClient.so.6`(`libqwayland.so`)、`libQt6EglFSDeviceIntegration.so.6`(`libqeglfs.so`)。真实 X11 桌面上,xcb 平台插件会因缺 `libQt6XcbQpa` 加载失败;现有 CI 只在 offscreen 下运行,所以没发现。(我没有显示环境,只在静态依赖层面确认,运行层面的失败是推断。) -**与仓库规则的关系**:`docs/plugin-development.md` 的规则 4(运行时闭包属于提供二进制的包;插件只命名库目录)与规则 8(引擎缺口要报告,不要打补丁;已有的补丁要在文档里记录 issue 号并在引擎支持后移除)。因此: +**与仓库规则的关系**:`docs/01-plugin-development.md` 的规则 4(运行时闭包属于提供二进制的包;插件只命名库目录)与规则 8(引擎缺口要报告,不要打补丁;已有的补丁要在文档里记录 issue 号并在引擎支持后移除)。因此: 1. **向 mcpp 提 issue**(你同意后已提交):**mcpp-community/mcpp#1011**,建议能力是"`mcpp pack` 把 `role: library` 的已部署文件也作为闭包的根"。正文见 §15。提交前搜索过,没有重复(相关的 #615、#634、#630、#701 都是已关闭的、讨论别的缺口)。 2. **本 PR 带 `link_plugin_libs` 补丁,按规则 8 标注**(这是你的决定:先 workaround,用户与开发者层面无感,mcpp 修复后自动没问题): @@ -193,7 +193,7 @@ Windows 与 macOS 没有实测机器:凡依赖它们的结论都标"推断", // note: idempotent: linking a library the engine also stages changes nothing ``` - `docs/rules-qt.md`、`docs/rules-qml.md` 各有"引擎缺口"一节,写 mcpp#1011 与移除条件(规则 8);README 不提。 + `docs/11-rules-qt.md`、`docs/12-rules-qml.md` 各有"引擎缺口"一节,写 mcpp#1011 与移除条件(规则 8);README 不提。 - **自动退场**:补丁是幂等的——引擎一旦把已部署库的依赖纳入闭包,我们多链的同一批库对结果没有任何影响(同一个文件、同一个目的地)。引擎没有向 build 程序暴露版本接口(`hostprogram.cppm` 只有 `package_version` 等,已查),所以不做版本门;退场靠下一条。 - **金丝雀**:`qml-deploy` 的脚本多做一次构建:用环境变量让 fixture 的 `build.mcpp` 设 `plugin_closure = false`,打包,再用读取器检查闭包。若这次包里**已经**没有缺库,说明引擎修好了,脚本打印 `NOTICE: the engine now closes deployed libraries (mcpp#1011); remove the plugin_closure workaround` 并以成功退出(不失败,是提示);仍缺库则打印 `ok: the engine gap still exists (mcpp#1011)`。引擎修好后,CI 日志里会自动出现这条提示,不需要有人记得。 - **链接旗标要防"未引用的库被丢弃"**(评审指出的风险,已用 lld 实测):Linux 上 lld 默认保留按全路径给出的库(NEEDED 保留),但加 `--as-needed`(Ubuntu 的 gcc 默认就是)后被丢弃(NEEDED 为 0);用 `-Wl,--push-state,--no-as-needed <库> -Wl,--pop-state` 包住后保留(实测,且包外的库仍按 `--as-needed` 处理)。macOS:`ld64.lld` 默认保留,`-dead_strip_dylibs` 丢弃,`-needed_library <路径>` 保留(实测,直接用 `ld64.lld` 与手工构建的 dylib)。因此补库在 ELF 上用 push/pop 包住,在 Mach-O 上用 `-needed_library`。 @@ -437,7 +437,7 @@ Qml2Imports = qml Translations = # 仅在不是默认的 translations 时写出 ``` -并 `deploy` 到 `.`。检测到项目自己的 `qt.conf` 时不写(Q3)。副作用见 Q3,写进 `docs/rules-qml.md`。 +并 `deploy` 到 `.`。检测到项目自己的 `qt.conf` 时不写(Q3)。副作用见 Q3,写进 `docs/12-rules-qml.md`。 **Qt Quick 所需的插件目录**用一个独立字段 `options::quick_plugins`,与 `qt.deploy_plugins` 取并集,而不是"检测 `deploy_plugins` 是否为默认值再替换"(`std::vector` 分不清"没设置"和"设成了默认值",评审指出)。`quick_plugins` 的默认值:Linux `xcbglintegrations`、`platforminputcontexts`、`imageformats`;Windows/macOS `imageformats`、`platforminputcontexts`(目录不存在则只是 `rules-qt` 已有的警告)。用户把它设为空即不加。**这一项是推断**(真实 GL 窗口无法在无显示环境测试),由打包清单断言与 offscreen 运行约束,可按 CI 调整。`plugin_closure` 在两个规则里默认都是 `true`,不存在"未设置"问题。 @@ -547,10 +547,10 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样 | `src/binary.cppm` | 新增(`mcpp.plugins.binary`) | | `rules/qt.cppm` | §7 的 a–f;头注释增加"见 `mcpp.rules.qml`" | | `mcpp.toml` | `version` 0.26.1 → 0.27.0;`[features.plugins-binary]`、`[features.rules-qml]`;`rules-qt` 的 `implies` 增加 `plugins-binary`;`src/plugins.cppm` 的版本常量同步 | -| `docs/rules-qml.md` | 新增:开头一段摘要,随后用法、选项表、动作清单、部署与闭包、`qt.conf` 副作用、限制(§1 非目标)、平台表、"引擎缺口"一节(同上);遵守 `plugin-development.md` 规则 10 | -| `docs/rules-qt.md` | `moc_json`、`moc_includes`、`compile_ex`、`i18n.extensions`、`plugin_closure`;新增"引擎缺口"一节(平台插件的闭包缺口、issue 号、移除条件、金丝雀);指向 `rules-qml` | -| `docs/engine-and-rules.md` | `rules-qml` 不认领扩展名、不写 `rule_module` 的原因 | -| `docs/plugin-development.md` | §3 的分层表加入 L2 单元 `mcpp.plugins.binary`;规则 8 的"已有补丁"一节指向 `check-engine-gaps.sh` | +| `docs/12-rules-qml.md` | 新增:开头一段摘要,随后用法、选项表、动作清单、部署与闭包、`qt.conf` 副作用、限制(§1 非目标)、平台表、"引擎缺口"一节(同上);遵守 `01-plugin-development.md` 规则 10 | +| `docs/11-rules-qt.md` | `moc_json`、`moc_includes`、`compile_ex`、`i18n.extensions`、`plugin_closure`;新增"引擎缺口"一节(平台插件的闭包缺口、issue 号、移除条件、金丝雀);指向 `rules-qml` | +| `docs/00-engine-and-rules.md` | `rules-qml` 不认领扩展名、不写 `rule_module` 的原因 | +| `docs/01-plugin-development.md` | §3 的分层表加入 L2 单元 `mcpp.plugins.binary`;规则 8 的"已有补丁"一节指向 `check-engine-gaps.sh` | | `.github/scripts/check-engine-gaps.sh` | 新增(Q9 的标记检查),并接入现有 `check-compat-retirement.sh` 所在的步骤 | | `README.md` | Members 表增加 `rules-qml`(mcpp 下限列 2026.10.1.3,注明整个包需要 2026.10.30.1、最低验证 2026.10.31.3);`plugins-binary` 进"通用库"一段;示例版本号 | | `tests/plugin-logic/…` | §10.1 | @@ -564,7 +564,7 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样 1. `mcpp.plugins.binary` 与单测(合成样本、截断扫描)。 2. `rules-qt`:`moc_json`、`moc_includes`、`compile_ex`、导出函数,`plugin-logic` 的"现有 argv 不变"用例(先证明零回归)。 -3. `rules-qt`:`link_plugin_libs`、`plugin_closure`(默认开,带 `ENGINE-GAP WORKAROUND` 标记)、`check-engine-gaps.sh` 与对应单测(单独一个提交;`docs/rules-qt.md` 的"引擎缺口"一节随它提交,便于你单独审这一处行为变更)。 +3. `rules-qt`:`link_plugin_libs`、`plugin_closure`(默认开,带 `ENGINE-GAP WORKAROUND` 标记)、`check-engine-gaps.sh` 与对应单测(单独一个提交;`docs/11-rules-qt.md` 的"引擎缺口"一节随它提交,便于你单独审这一处行为变更)。 4. `rules-qml` 的模块链路(§6),及其 `plugin-logic` 用例。 5. 部署:文本闭包、`qt.conf`、补库(§8)及用例。 6. `qsb`、`qmllint`、`lupdate` 扩展。 @@ -616,14 +616,14 @@ PE 与 Mach-O **读取器**的正确性已用真实构建的样本验证(样 | # | 意见(摘要) | 核实 | 处理 | |---|---|---|---| -| 1 | 闭包补丁违反 `plugin-development.md` 规则 4、8;建议不打补丁、默认关或放进带到期日的 `compat/` | 属实:规则 8 原文是"引擎缺口要报告,不打补丁" | **你的决定**:先 workaround、默认开、无感、引擎修好后自动无事。我采纳了其中的"标注与强制移除"思想,做成与 `compat/` 同构的 `ENGINE-GAP` 标记 + `check-engine-gaps.sh`(因没有固定日期,不用到期日),并加金丝雀(Q9) | +| 1 | 闭包补丁违反 `01-plugin-development.md` 规则 4、8;建议不打补丁、默认关或放进带到期日的 `compat/` | 属实:规则 8 原文是"引擎缺口要报告,不打补丁" | **你的决定**:先 workaround、默认开、无感、引擎修好后自动无事。我采纳了其中的"标注与强制移除"思想,做成与 `compat/` 同构的 `ENGINE-GAP` 标记 + `check-engine-gaps.sh`(因没有固定日期,不用到期日),并加金丝雀(Q9) | | 2 | `plugin_closure`、`deploy_plugins` 用普通类型分不清"未设置"与"设成默认值" | 属实 | 采纳:`plugin_closure` 两处都默认 `true`;Quick 插件目录改用独立字段 `quick_plugins` 取并集(§8) | | 3 | `qt.conf` 固定文本,`deploy_to` 非默认会丢翻译;未处理项目自带 `qt.conf` | 属实 | 采纳(Q3):`Translations` 随 `deploy_to`;检测并警告用户自己的 `qt.conf`。内嵌到 qrc 的方案未采纳:文件方案已实测,内嵌的 `Prefix` 相对谁未验证 | | 4 | README 下限列语义;`action::env` 是否存在 | README 列语义属实;`action::env` 存在(`hostprogram.cppm:441`,协议 13) | 采纳(Q4):列写 2026.10.1.3 并注明;Q4 证据改为只声称验证过的 API | | 5 | §6 的"都跑通"过度概括:单模块、`qsb`/`qmllint` 未运行、G4/C++ 单例无证据;延迟导入等没有真实样本;`closure.py` 写死路径、只认整行 `import` | 属实 | 采纳:补做多模块(`sum=19`)、跨模块继承、C++ `QML_SINGLETON`、无 C++ 类型模块、`lupdate` 的 qml 提取;§6 标题如实写明;Q2 列出只有合成样本覆盖的路径;`closure.py` 容忍行尾 `;`(4 个样本仍与 scanner 一致)。"40 个模块的样本用的是 Qt 自己的文件而不是用户代码":属实,写在 Q1 的覆盖说明里,结论限于 SDK 内部的 import 图 | | 6 | 规则 9:`qml-shaders` 永远不会失败;G9 无 fixture;`aot=false`、`styles` 等无运行用例 | 属实 | 采纳:G9 加进 `qml-consumer`;加三个变体(§10.2);`qml-shaders` 的跳过用 `::notice::` 可见,并在限制里承认 G7 在 `xim:qt-addons` 修复前只有 argv 级覆盖 | | 7 | 计划期读 `.qml` 内容,只声明 glob 不够 | 属实(`rules/qt.cppm` 对读过的头文件逐个声明) | 采纳(§5.1) | -| 8 | 文档清单缺项:`plugin-development.md` L2 表、脚本的 usage/case;交叉引用错;`--format` 写法;`compile_ex`、`tool_path` 扩大契约;`rule_module` 的说法含糊 | 属实 | 采纳(§4.1、§7 e、§11、§15、spikes README) | +| 8 | 文档清单缺项:`01-plugin-development.md` L2 表、脚本的 usage/case;交叉引用错;`--format` 写法;`compile_ex`、`tool_path` 扩大契约;`rule_module` 的说法含糊 | 属实 | 采纳(§4.1、§7 e、§11、§15、spikes README) | | 9 | 测试:`env -i` 挡不住 RUNPATH;`.qmltypes` 文本非契约;mtime 粒度;`grep -a` 不证明 AOT;随机改字节无种子、sanitizer 与模块单元的组合;`dumpbin` 需要 VS | 属实 | 采纳(§10.1、§10.3):挪走 SDK 目录;运行时断言继承;`sleep 2.2`;`llvm-nm` 符号;固定种子、sanitizer 不进 CI;统一用 `llvm-readobj`(也是你关于 LLVM 的意见的落点) | | S1 | `link_flag` 的库可能被 `--as-needed` 丢弃 | **实测属实**(lld `--as-needed` 下 NEEDED 为 0) | 采纳(Q9、§7):push/pop 包住;Mach-O 用 `-needed_library` | | S2 | macOS bundle 里 `Prefix = .` 含义不同 | 无法验证 | 写入 Q3,归入 Q7 的范围,标明推断 | diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..156a1c6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,14 @@ +# Default owner: every path needs the package owner's review. +* @Sunrisepeak + +# Per-area rows: review is routed by family, and a new maintainer +# takes a family by editing one line. +/mcpp.toml @Sunrisepeak +/src/ @Sunrisepeak +/rules/ @Sunrisepeak +/tools/ @Sunrisepeak +/dist/ @Sunrisepeak +/deps/ @Sunrisepeak +/tests/ @Sunrisepeak +/docs/ @Sunrisepeak +/.github/ @Sunrisepeak diff --git a/.github/ISSUE_TEMPLATE/maintainer-application.yml b/.github/ISSUE_TEMPLATE/maintainer-application.yml new file mode 100644 index 0000000..c5cb85d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/maintainer-application.yml @@ -0,0 +1,59 @@ +name: Plugin maintainer application +description: Apply to become the maintainer of one plugin of mcpp-plugins +labels: ["maintainer-application"] +body: + - type: markdown + attributes: + value: | + Thanks for wanting to take a plugin's maintainership. One application + covers one plugin. + + A maintainer knows the plugin deeply and its application domain, and + leads its popularization and ecosystem building — technical articles, + videos, tutorials. Development plus outreach is the core of the role, + and the application states contributions in both categories. What a + maintainer does and knows: + [docs/03 — Maintainers](https://github.com/mcpp-community/mcpp-plugins/blob/main/docs/03-maintainers.md). + - type: input + id: plugin + attributes: + label: The plugin you apply for + description: One plugin per application — for another, open another issue. + placeholder: "rules-cuda" + validations: + required: true + - type: textarea + id: familiarity + attributes: + label: Your familiarity with the plugin and its domain + description: What you build with it, the related field you work in, how long you have used it. + validations: + required: true + - type: textarea + id: technical-contributions + attributes: + label: Technical contributions to the plugin + description: Required. Pull requests or commits — fixes, features, fixture and CI care, documentation. Link them. + placeholder: "PR #12 — the manifest-merge fix; PR #18 — the min-sdk fixture" + validations: + required: true + - type: textarea + id: outreach-contributions + attributes: + label: Ecosystem-building and technical outreach contributions + description: Required. Technical articles, videos, blogs, tutorials — and indirect ecosystem growth through real projects built on the plugin. Preferably public, and linked. + placeholder: "a manifest-merger walkthrough on a blog; a getting-started video for the plugin" + validations: + required: true + - type: textarea + id: maintenance-plan + attributes: + label: Maintenance plan + description: Required, and both sides of the role — the daily technical upkeep you commit to (triage, fixes, fixture and CI care), and the ongoing popularization you plan to keep doing. + validations: + required: true + - type: textarea + id: referrer + attributes: + label: Referrer (optional) + description: An existing maintainer of a related plugin who supports this application, if one knows your work. diff --git a/.github/ISSUE_TEMPLATE/new-plugin.yml b/.github/ISSUE_TEMPLATE/new-plugin.yml new file mode 100644 index 0000000..5f47bed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-plugin.yml @@ -0,0 +1,64 @@ +name: New plugin +description: Propose a new plugin — an RFC for one not yet built, or one already built joining the official repository +labels: ["new-plugin"] +body: + - type: markdown + attributes: + value: | + A plugin is a mechanism: one kind of input turned into actions with + declared inputs and outputs, or a prefix or SDK mapped into the build. + The conventions and the checklist a plugin follows: + [docs/01 — Plugin Development, §5](https://github.com/mcpp-community/mcpp-plugins/blob/main/docs/01-plugin-development.md#5-a-new-plugin). + + What this repository takes: plugins that are general, or that drive a + widely used project — see + [docs/03](https://github.com/mcpp-community/mcpp-plugins/blob/main/docs/03-maintainers.md#which-plugins-this-repository-takes). + A build plugin specific to one project ships beside that project and + is published to mcpp-index on its own + ([slint-m](https://github.com/mcpplibs/slint-m) is the example). The + path this issue takes depends on the stage below. + + The original author of a plugin accepted into this repository becomes + the plugin's maintainer + ([what a maintainer does](https://github.com/mcpp-community/mcpp-plugins/blob/main/docs/03-maintainers.md)). + - type: dropdown + id: stage + attributes: + label: This plugin is + options: + - Not yet implemented — an RFC to discuss first + - Already implemented — applying to join the official repository + validations: + required: true + - type: input + id: name + attributes: + label: The plugin's name + description: A third-party plugin names its modules `mcpp..*` — state the namespace and the module family. + placeholder: "mcpp.acme.protobuf" + validations: + required: true + - type: textarea + id: mechanism + attributes: + label: Mechanism, tools and floor + description: What one kind of input it turns into what; the tools it drives; the engine floor it needs ([docs/02 — Where a Tool Comes From](https://github.com/mcpp-community/mcpp-plugins/blob/main/docs/02-tool-sources.md) states how a plugin resolves a tool). + validations: + required: true + - type: textarea + id: rfc + attributes: + label: For an RFC — the design questions + description: The options, the actions it submits, what the engine already gives it, what you are unsure about. + - type: textarea + id: submission + attributes: + label: For a submission — where it lives today + description: Repository, documentation, a consumer fixture under tests/ that CI can build, and the platforms it claims. + - type: textarea + id: maintenance + attributes: + label: Who maintains it + description: The author, and both sides of the role they commit to — technical upkeep, and popularization and outreach (articles, videos, tutorials, use in real projects). + validations: + required: true diff --git a/.github/scripts/check-toolchain-lanes.sh b/.github/scripts/check-toolchain-lanes.sh index a523d2f..f03c865 100755 --- a/.github/scripts/check-toolchain-lanes.sh +++ b/.github/scripts/check-toolchain-lanes.sh @@ -12,7 +12,7 @@ # built with GCC -- and no build ever compiled that combination, so a # `std::pair` inside `value` (0.19.1) failed only there: # every build passed and every build program in an editor showed a module that -# was "not found". docs/plugin-development.md §4 states the rule this enforces. +# was "not found". docs/01-plugin-development.md §4 states the rule this enforces. # # Environment: MCPP (llvm); MCPP_EDITOR and MCPPLS (editor). set -euo pipefail diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c7f523..62f7475 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,11 @@ on: env: # The mcpp release the consumers build with. Raising it is what admits a - # member that relies on a newer engine; the README states each member's floor. + # plugin that relies on a newer engine; the README states each plugin's floor. # 2026.9.11.1 is what `dist-*` needs at the API level: # `mcpp::provides_pack_format`, `mcpp::pack_format`, `${mcpp.stage_dir}` and # `mcpp::package_version` all arrived in it. Raising this is what admits a - # member relying on a newer engine; the README states each member's floor, + # plugin relying on a newer engine; the README states each plugin's floor, # and the index descriptor's own `min_mcpp` is a different question -- it # bounds the DESCRIPTOR's syntax, and raising it would brick every older # client's whole index. @@ -46,7 +46,7 @@ env: # `dist-apk` refuses its tree naming this release. # # 2026.9.26.2 IS THE RELEASE THAT LANDS mcpp-community/mcpp#702, which the - # `deps-*` members and `rules-qt` (0.13.0) are written against (mcpp's + # `deps-*` plugins and `rules-qt` (0.13.0) are written against (mcpp's # SPEC-007): `mcpp::runtime_search_dir` for a prefix's shared-library # directory, the `prepare` role with `output_dir` for an installation, a # stamp moved past the inputs that changed, and on Windows the imported DLLs @@ -88,8 +88,8 @@ env: # completes a cross subproject's contract (its compilers, archiver and target) # when the action runs, which a subproject that links an executable or a # shared library needs. The package floor stays 2026.10.30.1: every other - # member, and a cross subproject that only builds archives, works on the - # older engine, and docs/deps.md states the requirement where cross builds + # plugin, and a cross subproject that only builds archives, works on the + # older engine, and docs/40-deps.md states the requirement where cross builds # are described. So here, as for 0.20.0's SYCL lane, `MCPP_VERSION` is the # newest engine a lane needs and the floor the oldest the collection loads on. # @@ -236,7 +236,7 @@ jobs: fi echo "ok: one version, two files agreeing" - # NO HEADER AND NO PREPROCESSOR BRANCH (0.21.0, docs/plugin-development.md + # NO HEADER AND NO PREPROCESSOR BRANCH (0.21.0, docs/01-plugin-development.md # §4): the operating system is mcpplibs.os's, the C library std's, and a # platform difference of the building machine is `if constexpr`. - name: no unit includes a header or branches in the preprocessor @@ -1212,10 +1212,10 @@ jobs: - name: dist-appimage produces an AppImage, and it runs working-directory: tests/appimage-consumer run: | - # A PLAIN BUILD HAS NO DISTRIBUTION EDGE. The member declares the + # A PLAIN BUILD HAS NO DISTRIBUTION EDGE. The plugin declares the # format unconditionally and submits only when asked, so this build # must produce no AppImage at all -- the half of the contract a - # member author is most likely to get wrong, and the half that still + # plugin author is most likely to get wrong, and the half that still # works for whoever wrote it. "$MCPP" build if find target -name '*.AppImage' | grep -q .; then @@ -1366,7 +1366,7 @@ jobs: # `2026-09-13-four-upstream-asks-from-a-ui-framework.md`, §4), which # `dist-web`'s two copy steps now use in place of `cp`. `mcpp toolchain # install` first, because this job's `~/.mcpp` cache does not carry - # the emsdk payload the way the local sandbox this member was + # the emsdk payload the way the local sandbox this plugin was # developed against does. - name: Install the emsdk payload for dist-web run: '"$MCPP" toolchain install emsdk 6.0.9' @@ -1463,7 +1463,7 @@ jobs: # THE CLOSURE THE ENGINE STAGED (mcpp#634, B5). A dependency linked as a # shared object on the Android row reaches `lib//` beside the app's # own because the engine stages the closure and names it in the stage - # manifest (2026.9.14.2+), and the member reads that tree. Five criteria: + # manifest (2026.9.14.2+), and the plugin reads that tree. Five criteria: # two packs in a row carry the dependency's library both times; two # triples give one signed APK listing both ABIs; `--format aab` gives an # App Bundle bundletool validates and jarsigner verifies, and a universal @@ -1585,7 +1585,7 @@ jobs: run: | set -e # THE FIXTURE'S OWN DENOMINATOR. It asserts "every rule compiles - # here", and "every" is a list it carries -- so a seventh member + # here", and "every" is a list it carries -- so a seventh plugin # added to this package would be covered by a step whose name says it # already is. The list is therefore compared against the package's # own `[features]` before the build, and the two must be equal. @@ -1596,49 +1596,49 @@ jobs: # ` = { ... }`. Reading keys out of the table BODY matched # `sources` once per feature and reported the fixture as # incomplete while the extractor was what broke. - # MEMBERS, NOT EVERY FEATURE. A member is a feature named for its + # MEMBERS, NOT EVERY FEATURE. A plugin is a feature named for its # family -- `rules-*`, `tools-*`, `dist-*`, the README's naming table # -- and a consumer names it. `plugins-core` is not one: it carries the - # build-program half of the generated surface, every member implies + # build-program half of the generated surface, every plugin implies # it, and a consumer never writes it. Keeping it out keeps this check - # meaning "the fixture names every member a consumer can activate"; + # meaning "the fixture names every plugin a consumer can activate"; # padding the fixture instead would make it mean less. # # BY NAME, NOT BY "NOTHING IMPLIES IT". That was the rule until 0.11.0, # when `dist-apk-kotlin` and `dist-apk-maven` came to imply `dist-apk`, # which a consumer still names. The rule is read out of the manifest, - # not listed here, so a new member is still caught. + # not listed here, so a new plugin is still caught. # A TEMP FILE, NOT `<(...)`. This step also runs on windows-2022 # through Git Bash, where process substitution is emulated and not # dependable -- and a check that behaves differently on one of the # three hosts is the exact class of difference this job exists to # catch, so it must not introduce one. # THE MEMBERS THAT CARRY SOURCES, READ OUT OF THE MANIFEST. From 0.13.0 a - # member family may hold features that add a payload and no source + # plugin family may hold features that add a payload and no source # (`dist-apk-kotlin`): they compile nothing this fixture # could miss, and naming them here would download an SDK on every host. - # So the requirement is one-sided -- every source-carrying member of the + # So the requirement is one-sided -- every source-carrying plugin of the # four families is named -- and the other side only checks spelling: # every name the fixture uses is a feature the package declares. awk '/^\[features\.[a-z0-9-]+\]/ { cur = $0; sub(/^\[features\./, "", cur); sub(/\]$/, "", cur); next } /^\[/ { cur = "" } /^sources[ \t]*=/ && cur ~ /^(rules|tools|dist|deps)-/ { print cur }' mcpp.toml \ - | sort -u > /tmp/members.txt + | sort -u > /tmp/plugins.txt grep -oE '^\[features\.[a-z0-9-]+\]' mcpp.toml \ | sed 's/^\[features\.//; s/\]$//' | sort > /tmp/declared.txt - feats=$(cat /tmp/members.txt) + feats=$(cat /tmp/plugins.txt) used=$(sed -n '/features = \[/,/\], host-module/p' tests/all-rules-compile/mcpp.toml \ | grep -oE '"[a-z-]+"' | tr -d '"' | sort) [ -n "$feats" ] || { - echo "FAIL: read no source-carrying members out of mcpp.toml. The" + echo "FAIL: read no source-carrying plugins out of mcpp.toml. The" echo " extractor above expects [features.] sections with a" echo " sources key and found none, so the manifest spelling changed." grep -n '^\[features' mcpp.toml | head exit 1; } for f in $feats; do echo "$used" | grep -qx "$f" || { - echo "FAIL: the fixture does not name the member $f" - echo " members: $(echo $feats)" + echo "FAIL: the fixture does not name the plugin $f" + echo " plugins: $(echo $feats)" echo " fixture: $(echo $used)" exit 1; } done @@ -1798,12 +1798,12 @@ jobs: # ── the general library and the test kit (0.17.0, mcpp#734) ─────────── # - # The deps members' decisions -- which mechanism reaches the foreign + # The deps plugins' decisions -- which mechanism reaches the foreign # system, which triplet, which C runtime -- tested against stated build # contexts (a Visual Studio row, a managed MSVC row, the Linux GCC and # libc++ rows) with nothing installed. The verdicts are counted against # the cases the fixture declares. - - name: the deps members' decisions hold against stated build contexts (mcpp.plugins.testing) + - name: the deps plugins' decisions hold against stated build contexts (mcpp.plugins.testing) run: bash .github/scripts/check-deps-and-qt.sh plugin-logic # A compatibility unit keeps a behaviour for six months after the release @@ -1816,7 +1816,7 @@ jobs: # # vcpkg keeps everything it reuses in one per-user directory -- its # binary cache (`archives/`), its registry cache (`registries/`) and, - # through the member's `--downloads-root`, its downloads -- so caching that directory is what + # through the plugin's `--downloads-root`, its downloads -- so caching that directory is what # makes the second run of a manifest a restore rather than a compile. - name: Cache vcpkg's per-user directory uses: actions/cache@v4 @@ -1838,7 +1838,7 @@ jobs: - name: deps-archive extracts a zip the project keeps and deploys its tree beside the program run: bash .github/scripts/check-deps-and-qt.sh archive-consumer - - name: deps-vcpkg in two workspace members that share no dependency + - name: deps-vcpkg in two workspace plugins that share no dependency run: bash .github/scripts/check-deps-and-qt.sh vcpkg-workspace - name: deps-cmake builds a CMake subproject as an action and links it @@ -1926,7 +1926,7 @@ jobs: # `std::pair` that only the last one rejects, so every # build passed while every build program showed a missing module in the # editor. `.github/scripts/check-toolchain-lanes.sh` states what each lane - # runs; docs/plugin-development.md §4 states the rule. + # runs; docs/01-plugin-development.md §4 states the rule. toolchain-llvm: name: llvm (linux x86_64, clang + libc++) runs-on: ubuntu-24.04 @@ -2027,7 +2027,7 @@ jobs: # ── THE SAME RULE ON THE OTHER TWO PLATFORMS ──────────────────────────────── # - # `rules-spirv` is the only member whose payload this ecosystem publishes for + # `rules-spirv` is the only plugin whose payload this ecosystem publishes for # all three, so it is the only one that can be checked on all three. What this # job proves is the claim the per-platform declaration makes: a project writes # the rule edge and nothing else, and the compiler that arrives is whichever @@ -2168,13 +2168,13 @@ jobs: # and asks only whether all six modules COMPILE for this host -- which # is the half of a rule that a Linux-only CI never sees. Run after the # end-to-end step, its failure arrived as somebody else's build error: - # `no member named 'popen' in the global namespace`, reported against a + # `no plugin named 'popen' in the global namespace`, reported against a # consumer that had nothing to do with it. - name: every rule module compiles for this host run: | set -e # THE FIXTURE'S OWN DENOMINATOR. It asserts "every rule compiles - # here", and "every" is a list it carries -- so a seventh member + # here", and "every" is a list it carries -- so a seventh plugin # added to this package would be covered by a step whose name says it # already is. The list is therefore compared against the package's # own `[features]` before the build, and the two must be equal. @@ -2187,41 +2187,41 @@ jobs: # incomplete while the extractor was what broke. # MEMBERS, NOT EVERY FEATURE: a feature named for its family # (`rules-*`, `tools-*`, `dist-*`), which a consumer names; `plugins-core`, - # which every member implies and no consumer writes, is not one. By + # which every plugin implies and no consumer writes, is not one. By # name and not by "nothing implies it" since 0.11.0, when # `dist-apk-kotlin` and `dist-apk-maven` came to imply `dist-apk`. The - # rule is read out of the manifest, so a new member is still caught. + # rule is read out of the manifest, so a new plugin is still caught. # # A temp file, not `<(...)`: this step also runs on windows-2022 # through Git Bash, where process substitution is emulated and not # dependable -- and a check that behaves differently on one of the # three hosts is the class of difference this job exists to catch. # THE MEMBERS THAT CARRY SOURCES, READ OUT OF THE MANIFEST. From 0.13.0 a - # member family may hold features that add a payload and no source + # plugin family may hold features that add a payload and no source # (`dist-apk-kotlin`): they compile nothing this fixture # could miss, and naming them here would download an SDK on every host. - # So the requirement is one-sided -- every source-carrying member of the + # So the requirement is one-sided -- every source-carrying plugin of the # four families is named -- and the other side only checks spelling: # every name the fixture uses is a feature the package declares. awk '/^\[features\.[a-z0-9-]+\]/ { cur = $0; sub(/^\[features\./, "", cur); sub(/\]$/, "", cur); next } /^\[/ { cur = "" } /^sources[ \t]*=/ && cur ~ /^(rules|tools|dist|deps)-/ { print cur }' mcpp.toml \ - | sort -u > /tmp/members.txt + | sort -u > /tmp/plugins.txt grep -oE '^\[features\.[a-z0-9-]+\]' mcpp.toml \ | sed 's/^\[features\.//; s/\]$//' | sort > /tmp/declared.txt - feats=$(cat /tmp/members.txt) + feats=$(cat /tmp/plugins.txt) used=$(sed -n '/features = \[/,/\], host-module/p' tests/all-rules-compile/mcpp.toml \ | grep -oE '"[a-z-]+"' | tr -d '"' | sort) [ -n "$feats" ] || { - echo "FAIL: read no source-carrying members out of mcpp.toml. The" + echo "FAIL: read no source-carrying plugins out of mcpp.toml. The" echo " extractor above expects [features.] sections with a" echo " sources key and found none, so the manifest spelling changed." grep -n '^\[features' mcpp.toml | head exit 1; } for f in $feats; do echo "$used" | grep -qx "$f" || { - echo "FAIL: the fixture does not name the member $f" - echo " members: $(echo $feats)" + echo "FAIL: the fixture does not name the plugin $f" + echo " plugins: $(echo $feats)" echo " fixture: $(echo $used)" exit 1; } done @@ -2279,13 +2279,13 @@ jobs: fi echo "ok: the boundary is generated and namespaced on this host" - # ── dist, on the platform each member serves ──────────────────────── + # ── dist, on the platform each plugin serves ──────────────────────── # # A PLAN-LEVEL ASSERTION IS NOT A MEASUREMENT. `plan_for()` returning # `applies == false` on the wrong OS says the gate works; it says nothing - # about whether the tool accepts what the member renders. These two steps + # about whether the tool accepts what the plugin renders. These two steps # exist because that question is only answerable here, and because the - # members were written on a Linux host where neither tool can run. + # plugins were written on a Linux host where neither tool can run. # # THE FIRST THING EITHER ONE SETTLES IS A SPELLING. `dist-wix` writes # `$(Executable)` in its generated `.wxs`, taken from a working @@ -2301,9 +2301,9 @@ jobs: # THE TOOL COMES FROM THE PAYLOAD, NOT FROM THIS STEP. `dist-wix` # declares `xim:wix` under `[target.windows.feature-xlings.dist-wix]`, # so mcpp provisions it when the fixture activates the feature on a - # Windows target, and the member locates it through `xpkg_dir`. An + # Windows target, and the plugin locates it through `xpkg_dir`. An # earlier revision of this step installed WiX 6 with `dotnet tool` - # and the member searched PATH; the criterion below on the argv is + # and the plugin searched PATH; the criterion below on the argv is # what distinguishes the two, and a run that found a host `wix.exe` # would fail it. WiX 7 is not an option for the payload either: it # refuses to run until an OSMF licence is accepted out of band @@ -2319,7 +2319,7 @@ jobs: msi=$(find target -name '*.msi' | head -1) test -n "$msi" || { cat pack.log; echo "FAIL: no MSI"; exit 1; } # THE TOOL CAME FROM THE PAYLOAD BY CONSTRUCTION, and the criterion - # is the absence of any other: this step installs no WiX, the member + # is the absence of any other: this step installs no WiX, the plugin # has no PATH tier, and the runner image ships WiX 3 (candle/light) # but no `wix.exe`. An MSI therefore exists only if the payload's # `wix.exe` produced it. The engine prints the argv with the tool's @@ -2331,7 +2331,7 @@ jobs: fi # THE CRITERION IS THE `File` TABLE, NOT THE FILE'S EXISTENCE. The - # measured failure this member is shaped around is a VALID, EMPTY, + # measured failure this plugin is shaped around is a VALID, EMPTY, # 52 KB installer with no diagnostic, produced when a harvested bind # path resolved to nothing. An assertion that stops at "an .msi # exists" passes on exactly that artifact. @@ -2372,7 +2372,7 @@ jobs: # THE STAGED TREE IS INSTALLED, NOT ONLY THE PROGRAM (0.10.1). The # fixture deploys `share/greeting.txt` to `data/`; the engine stages - # it at `bin/data/greeting.txt` and the member names it in the + # it at `bin/data/greeting.txt` and the plugin names it in the # `StagedFiles` group, so the administrative image carries it at the # same path beside the program, byte-for-byte. data="$(dirname "$inside")/data/greeting.txt" @@ -2413,7 +2413,7 @@ jobs: test -n "$exe" || { echo "FAIL: Info.plist names no executable"; exit 1; } # `CFBundleExecutable` must be a BARE NAME, never a path: Apple's # loader resolves it against Contents/MacOS/ and a path there is not - # a launchable bundle. This is the assumption the member documents. + # a launchable bundle. This is the assumption the plugin documents. case "$exe" in */*) echo "FAIL: CFBundleExecutable is a path: $exe"; exit 1 ;; esac test -x "$app/Contents/MacOS/$exe" \ || { echo "FAIL: $app/Contents/MacOS/$exe is missing or not executable" @@ -2424,13 +2424,13 @@ jobs: "$app/Contents/MacOS/$exe" | tee run.log grep -q '^app-consumer ok' run.log \ || { echo "FAIL: the bundled program did not run"; exit 1; } - # `plutil -lint` is Apple's own parser: a plist this member wrote by + # `plutil -lint` is Apple's own parser: a plist this plugin wrote by # hand and got subtly wrong would otherwise fail at launch time on a # user's machine and nowhere here. plutil -lint "$app/Contents/Info.plist" # THE DEPLOYED FILE, AT THE RESOURCE DESTINATION AND NOT BESIDE THE # PROGRAM (mcpp#630, item 3a): the engine stages `bin/data/...` and - # this member places it under `Contents/Resources/`. + # this plugin places it under `Contents/Resources/`. test -f "$app/Contents/Resources/data/greeting.txt" \ || { echo "FAIL: the deployed file is not under Contents/Resources"; find "$app" -type f; exit 1; } if [ -e "$app/Contents/MacOS/bin" ]; then @@ -2440,10 +2440,10 @@ jobs: echo "ok: one bundle, a valid plist, it launches, and the resource is where NSBundle looks" # 0.11.0 (`options::info_plist`): a project's Info.plist entries join the - # generated plist of the real bundle, a key the member only defaults + # generated plist of the real bundle, a key the plugin only defaults # (`NSHighResolutionCapable`) takes the project's value, Apple's parser # accepts the result, and the bundle still launches. The refusal of a key - # the member derives is asserted at the plan level, in the Linux job. + # the plugin derives is asserted at the plan level, in the Linux job. - name: dist-apple carries a project's Info.plist entries, and the bundle launches if: ${{ !cancelled() && runner.os == 'macOS' }} working-directory: tests/app-consumer @@ -2465,7 +2465,7 @@ jobs: [ "$(grep -c 'NSHighResolutionCapable' "$plist")" -eq 1 ] \ || { echo "FAIL: NSHighResolutionCapable is stated twice"; cat "$plist"; exit 1; } [ "$(pb CFBundleExecutable)" = "app-consumer" ] \ - || { echo "FAIL: CFBundleExecutable is no longer the member's"; cat "$plist"; exit 1; } + || { echo "FAIL: CFBundleExecutable is no longer the plugin's"; cat "$plist"; exit 1; } "$app/Contents/MacOS/app-consumer" | grep -q '^app-consumer ok' \ || { echo "FAIL: the bundle does not launch with the project's entries"; exit 1; } echo "ok: the project's entries are in the bundle's Info.plist, plutil accepts it, and the bundle launches" @@ -2604,7 +2604,7 @@ jobs: # 0.11.0 (`options::info_plist`) on the iOS row: the project's entries # join the simulator bundle's Info.plist, its `UIDeviceFamily` replaces - # the member's default, and the simulator installs and runs the bundle. + # the plugin's default, and the simulator installs and runs the bundle. - name: dist-apple's iOS row carries a project's Info.plist entries, and the simulator runs the bundle if: ${{ !cancelled() && runner.os == 'macOS' }} working-directory: tests/ios-app-consumer @@ -2628,14 +2628,14 @@ jobs: [ "$(pb UIDeviceFamily:0)" = "1" ] && ! pb UIDeviceFamily:1 >/dev/null 2>&1 \ || { echo "FAIL: UIDeviceFamily is not the project's (1)"; cat "$plist"; exit 1; } [ "$(pb CFBundleSupportedPlatforms:0)" = "iPhoneSimulator" ] \ - || { echo "FAIL: CFBundleSupportedPlatforms is no longer the member's"; cat "$plist"; exit 1; } + || { echo "FAIL: CFBundleSupportedPlatforms is no longer the plugin's"; cat "$plist"; exit 1; } out=$("$MCPP" run --target aarch64-ios-sim --format app 2>&1) && rc=0 || rc=$? printf '%s\n' "$out" | tail -20 [ "$rc" -eq 7 ] \ || { echo "FAIL: mcpp run exited $rc with the project's entries, and the program exits 7"; exit 1; } echo "ok: the simulator bundle carries the project's entries, and the simulator ran it and returned 7" - # dist-apk ON A HOST THAT IS NOT LINUX (0.24.0). Every tool the member + # dist-apk ON A HOST THAT IS NOT LINUX (0.24.0). Every tool the plugin # runs is a native program (`aapt2`, `zipalign`) or a jar on the JDK's # `java`, and each step of more than one command is a step program # (0.25.0, `tools-steps`), so no step needs a shell and a Windows host @@ -2716,7 +2716,7 @@ jobs: working-directory: tests/progress-worker run: python3 verify.py "$MCPP" - - name: the deps members' decisions hold against stated build contexts (mcpp.plugins.testing) + - name: the deps plugins' decisions hold against stated build contexts (mcpp.plugins.testing) run: bash .github/scripts/check-deps-and-qt.sh plugin-logic # ── deps-vcpkg, deps-cmake and rules-qt (0.13.0) ────────────────────── @@ -2739,7 +2739,7 @@ jobs: - name: deps-archive extracts a zip the project keeps and deploys its tree beside the program run: bash .github/scripts/check-deps-and-qt.sh archive-consumer - - name: deps-vcpkg in two workspace members that share no dependency + - name: deps-vcpkg in two workspace plugins that share no dependency run: bash .github/scripts/check-deps-and-qt.sh vcpkg-workspace - name: deps-cmake builds a CMake subproject as an action and links it diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..46ca833 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,87 @@ +# AGENTS.md + +`mcpp-plugins` is the package of official build plugins for mcpp +(`mcpp:plugins`). One plugin is one module — a single `.cppm`, or a directory +`//` whose `.cppm` keeps the module a consumer imports while +`internal/` holds the machinery — one feature in `mcpp.toml`, one consumer +under `tests/`, one page under `docs/`. This file states the rules that hold +across the repository in their shortest form; each links to the +document that states it in full. Where this file and a linked document differ, +the linked document holds. + +## 1. Where a fact lives + +| Tree | States | +|---|---| +| [`docs/`](docs/README.md) | one page per plugin or family, and the plugin conventions ([01](docs/01-plugin-development.md)) | +| [`README.zh-CN.md`](README.zh-CN.md) | the README in Chinese; English is the source of truth, and a lagging section is stated in its header | +| [`mcpp.toml`](mcpp.toml) | the package: one feature per plugin, the declared payloads, the engine floor `[package] mcpp` | +| [`tests//`](tests/) | one consumer project per plugin; CI builds each and asserts on its output | +| [`tools/README.md`](tools/README.md) | the tools family's own account | +| [`.agents/docs/`](.agents/docs/) | design records: the reasoning, the measurements, what was refuted | + +A change of behaviour updates the plugin's page and its consumer in the same +pull request. + +## 2. Architecture + +- **A plugin provides a mechanism, not a policy.** No fixed version, path or + library list a project could reasonably choose. Configuration is `build.mcpp` + first ([01 §2](docs/01-plugin-development.md#2-rules)). +- **Four families answer four questions.** `rules-*` how a translation unit is + compiled by a compiler mcpp does not drive; `tools-*` what the build program + does itself; `dist-*` what comes out of the link, and in what form a user + installs it; `deps-*` where a library comes from. The prefix is load-bearing + ([00](docs/00-engine-and-rules.md)). +- **Names are three segments.** `mcpp..`; the second segments + `core`, `plugins`, `deps`, `rules`, `dist`, `tools` belong to the namespace, + and a third-party plugin names its modules `mcpp..*` + ([01 §3](docs/01-plugin-development.md#3-layers-names-and-the-engine-floor)). +- **Three layers, one way down.** The engine's `mcpp` (L1), the general library + `mcpp.plugins.*` (L2, feature `plugins-core`; every plugin implies it), the + plugins (L3). A layer imports only lower layers. +- **Every plugin states an engine floor.** The collection's floor is + `[package] mcpp`; the index descriptor states the highest floor among the + plugins, so a project on an older engine is refused at resolution. +- **A tool resolves in one order, for every plugin:** the build program's + choice, the plugin's legacy variable, the engine's override, the declared + payload. A choice never asks for the payload — a build program that names its + own tool must not trigger a download + ([02](docs/02-tool-sources.md)). + +## 3. Code + +- C++23 modules: `import std;`, plus the module that defines a type. No unit + includes a header or branches on the platform in the preprocessor. +- The code compiles under the four lanes CI runs: GCC with libstdc++, clang + with libc++, clang with libstdc++'s `std` module (an editor's clangd), and + MSVC where a plugin claims Windows. No compiler's leniency is relied on; the + known differences and their workarounds are stated in + [01 §4](docs/01-plugin-development.md#4-the-c-a-plugin-is-written-in). +- A behaviour kept past the release that replaced it lives in `compat/`, one + unit per behaviour, with a retirement date six months on; + `.github/scripts/check-compat-retirement.sh` fails once a date has passed. + +## 4. Build and test + +- CI (`.github/workflows/ci.yml`) builds every fixture under `tests/` with the + pinned mcpp on the GCC lane (`consumers`), and adds `toolchain-llvm`, + `toolchain-editor`, `rules-cross-platform` and `deps-managed-msvc`. +- Every documented behaviour has a criterion: a CI check, on every platform the + plugin claims ([01 §2](docs/01-plugin-development.md#2-rules), rule 9). +- A change to a plugin builds its fixture, not only the package. + +## 5. Change workflow + +- Every change goes through a pull request; `main` is never pushed to directly. + Commits and pull-request text are English, declarative, without emoji or + attribution trailers. One pull request does one thing; all required checks + pass before merge. +- Review follows [`.github/CODEOWNERS`](.github/CODEOWNERS): the family rows + route it; a change to the feature set or the engine floor in `mcpp.toml` + needs the package owner. +- Adding a plugin is the checklist in + [01 §5](docs/01-plugin-development.md#5-a-new-plugin): a module file, a + feature, a consumer, a table row with its floor, a page, a version bump. +- A release changes the version in `mcpp.toml` and tags `v`; the tag + publishes the source archive the index descriptor names. diff --git a/README.md b/README.md index b11fef3..68baa89 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,25 @@ # mcpp-plugins -The build plugins the mcpp project maintains, published as one package, -`mcpp:plugins`. mcpp is a general engine with a framework for build plugins; -plugins come from this package, from third parties, or from the project -itself, and `build.mcpp` is where a project uses them. A consumer selects the -members it needs through features, imports each one from `build.mcpp` under the -module name the member declares, and configures it there. +> The official build plugins for mcpp — one plugin, one feature, one module. + +[![ci](https://github.com/mcpp-community/mcpp-plugins/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpp-community/mcpp-plugins/actions/workflows/ci.yml) +[![Release](https://img.shields.io/github/v/release/mcpp-community/mcpp-plugins)](https://github.com/mcpp-community/mcpp-plugins/releases) +[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE) + +**English** | [简体中文](README.zh-CN.md) · [Documentation](docs/README.md) · [mcpp](https://github.com/mcpp-community/mcpp) · [mcpp-index](https://mcpp.index.xlings.org) · [Releases](https://github.com/mcpp-community/mcpp-plugins/releases) + +mcpp is a general engine with a framework for build plugins; plugins come from +this package (`mcpp:plugins`), from third parties, or from the project itself, +and `build.mcpp` is where a project uses them: it imports the plugin's module +under the name the plugin declares, configures it, and calls it. The edge is a +`[build-dependencies]` entry — the library serves the build program, and the +package never reaches the target. + +## Quick start ```toml [build-dependencies.mcpp] -plugins = { version = "0.27.0", features = ["rules-spirv"], host-module = true } +plugins = { version = "0.27.0", features = ["rules-spirv"] } ``` ```cpp @@ -25,12 +35,7 @@ int main() { } ``` -The edge is a `[build-dependencies]` entry, not a `[dependencies]` entry: -`host-module = true` states which build-time product is wanted, and the section -states that the package does not reach the target. A rule's library is never -linked into the artifact (mcpp docs/05 §2.6.1). - -## Naming +## Families | family | module | answers | |---|---|---| @@ -38,120 +43,71 @@ linked into the artifact (mcpp docs/05 §2.6.1). | tools | `mcpp.tools.` | what the build program does itself (see [`tools/README.md`](tools/README.md)) | | dist | `mcpp.dist.` | what comes out of the link, and in what form a user installs it | | deps | `mcpp.deps.` | where a library comes from | -| identity | `mcpp.plugins` | the lib root, compiled before every member; it states the collection's version | - -The second segments `core`, `plugins`, `deps`, `rules`, `dist` and `tools` of -`mcpp.` belong to this package and the engine; a third-party plugin names its -modules `mcpp..*` ([docs/plugin-development.md](docs/plugin-development.md#3-layers-names-and-the-engine-floor)). -The full account of the families, and of how the engine routes a file to a -rule, is in [docs/engine-and-rules.md](docs/engine-and-rules.md). Where the tool a -member runs comes from -- what a project can name, what a plugin must declare for -naming it to avoid a download, and the scenarios on both sides -- is in -[docs/tool-sources.md](docs/tool-sources.md). - -## Members - -From 0.21.0 the package as a whole needs mcpp 2026.10.30.1 (`[package] mcpp`), -which writes the configuration's contract that `deps-cmake` compiles a cross -build from (0.20.0 needed 2026.10.27.1, whose protocol 17 states a platform's -fields and whose `mcpp pack` writes `mcpp-package.json` beside every staged -tree; 0.19.0 needed 2026.10.1.3, whose -protocol 15 states where each tool and payload comes from); the column states -the release each member's behaviour first needed. - -Cross CMake subprojects that link executables or shared libraries require -mcpp 2026.11.7.1 or later; cross configuration requires CMake 3.19 or later. - -| feature | module | mcpp floor | what it does | doc | -|---|---|---|---|---| -| `rules-ascendc` | `mcpp.rules.ascendc` | 2026.10.1.3 | Compiles Ascend C (`*.asc`) with BiSheng in mixed mode, so the object joins the ordinary link. | [rules](docs/rules.md#rules-ascendc) | -| `rules-cuda` | `mcpp.rules.cuda` | 2026.10.1.3 | Compiles CUDA (`*.cu`) through clang with an LLVM toolchain or nvcc with a GCC one. | [rules](docs/rules.md#rules-cuda) | -| `rules-hip` | `mcpp.rules.hip` | 2026.10.1.3 | Compiles HIP (`*.hip`) with the project's clang on the NVIDIA platform. | [rules](docs/rules.md#rules-hip) | -| `rules-metal` | `mcpp.rules.metal` | 2026.9.8.1 | Compiles `.metal` shaders into Metal libraries with the host's Xcode and deploys them beside the program. | [rules](docs/rules.md#rules-metal) | -| `rules-qt` | `mcpp.rules.qt` | 2026.10.1.3 | Runs `moc`, `uic`, `rcc` and Qt's Linguist tools as actions, links the Qt modules and places their runtime. | [rules-qt](docs/rules-qt.md) | -| `rules-qml` | `mcpp.rules.qml` | 2026.10.1.3; a pack that carries the QML plugins' libraries 2026.11.23.1 | Builds a QML application: each module's `moc`, `qmltyperegistrar`, `qmlcachegen`, `rcc` and `qsb` chain as actions, Qt's QML modules the program imports placed beside it, and a `qt.conf`. Implies `rules-qt`. | [rules-qml](docs/rules-qml.md) | -| `rules-slang` | `mcpp.rules.slang` | 2026.10.1.3 | Compiles Slang (`*.slang`) and embeds or places the result. | [rules](docs/rules.md#rules-slang) | -| `rules-spirv` | `mcpp.rules.spirv` | 2026.10.1.3 | Compiles GLSL and HLSL shader stages to SPIR-V and embeds or places the result. | [rules](docs/rules.md#rules-spirv) | -| `rules-swift` | `mcpp.rules.swift` | 2026.9.8.1 | Compiles a package's `.swift` sources into one module the C and C++ sources call. | [rules](docs/rules.md#rules-swift) | -| `rules-sycl` | `mcpp.rules.sycl` | 2026.10.1.3 | Compiles SYCL (`*.sycl`) with DPC++. | [rules](docs/rules.md#rules-sycl) | -| `tools-embed` | `mcpp.tools.embed` | 2026.9.5.4 | Writes a data file into a header the program compiles in. | [tools-embed](docs/tools-embed.md) | -| `tools-island` | `mcpp.tools.island` | 2026.9.7.1 | Generates the `extern "C"` boundary and the C++ module of a code island. | [tools-island](docs/tools-island.md) | -| `tools-steps` | `mcpp.tools.steps` | 2026.10.1.3 | Describes an action whose work is more than one command as portable operations a backend runs; implied by `dist-apk` and `dist-apple`. | [tools-steps](docs/tools-steps.md) | -| `dist-appimage` | `mcpp.dist.appimage` | 2026.10.1.3 | Turns the tree `mcpp pack` stages into an AppImage (Linux). | [dist](docs/dist.md#dist-appimage) | -| `dist-deb` | `mcpp.dist.deb` | 2026.10.30.1 | Installs the staged tree under `/opt/` with a launcher, a desktop entry and an icon, as a Debian package (Linux targets). | [dist](docs/dist.md#dist-deb-and-dist-rpm) | -| `dist-rpm` | `mcpp.dist.rpm` | 2026.10.30.1 | The same installation as an RPM package (Linux targets). | [dist](docs/dist.md#dist-deb-and-dist-rpm) | -| `dist-wix` | `mcpp.dist.wix` | 2026.10.1.3 | Builds an MSI of the staged tree, and a Burn bundle chaining it (Windows). | [dist](docs/dist.md#dist-wix) | -| `dist-apple` | `mcpp.dist.apple` | 2026.9.14.2 | Lays out a macOS or iOS application bundle, signs it and writes a disk image. | [dist-apple](docs/dist-apple.md) | -| `dist-web` | `mcpp.dist.web` | 2026.9.13.1 | Copies a `wasm32-emscripten` program and its files into a web directory with an `index.html`. | [dist](docs/dist.md#dist-web) | -| `dist-apk` | `mcpp.dist.apk` | 2026.10.1.3 | Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. | [dist-apk](docs/dist-apk.md) | -| `deps-vcpkg` | `mcpp.deps.vcpkg` | 2026.10.1.3 | Installs a `vcpkg.json` manifest as an action with the toolset mcpp resolved, and maps the prefix into the build. | [deps](docs/deps.md#deps-vcpkg) | -| `deps-cmake` | `mcpp.deps.cmake` | 2026.10.1.3; a cross build 2026.10.30.1 | Builds and installs a CMake subproject as an action with Ninja and the toolset mcpp resolved -- for another target, the compilers and words of the engine's contract -- keeps the installation for any build with the same key, and maps the prefix into the build. | [deps](docs/deps.md#deps-cmake) | -| `deps-archive` | `mcpp.deps.archive` | 2026.10.1.3 | Extracts a zip archive the project keeps and places its tree beside the program. | [deps](docs/deps.md#deps-archive) | - -Some features add a sub-capability to a member: `dist-apk-kotlin` and -`dist-apk-maven` (Kotlin sources, a Maven graph), and `deps`, which the deps -members imply. - -**The general library (0.17.0).** `plugins-core` gives a build program -`mcpp.plugins.declare`, `mcpp.plugins.toolset` (the resolved toolchain, -translated for a foreign build system), `mcpp.plugins.fs` (deterministic file -generation and placement) and `mcpp.plugins.tool` (where a tool a member runs -comes from, one order for every member, 0.19.0). Every member implies it; a build program that uses -only these modules, and a third-party plugin built on them, name it on the -dependency edge. `plugins-testing` adds `mcpp.plugins.testing`, which runs a -plugin function against a stated build context and compares what it declared. -`plugins-toolchain` adds `mcpp.plugins.toolchain`, the builders a root build -program states the build toolchain with (0.19.0). -`plugins-platform` adds `mcpp.plugins.platform`, what a platform's plugin and a -package format's provider state -- the link, the artifacts' names, the seal, -where the runner runs, and `provide_format` -- and `mcpp.plugins` reads a staged -package's `mcpp-package.json` (`mcpp::plugins::package`), 0.20.0, mcpp -2026.10.27.1 ([plugin-development](docs/plugin-development.md#3-layers-names-and-the-engine-floor)). -The first three need mcpp 2026.10.1.3. `surface`, the name of `plugins-core` before -0.17.0, is kept until 2027-03-28. A feature states a mechanism and the tools that -mechanism runs; the libraries and SDKs a program links are the project's -declaration (0.15.0 removed `rules-qt-xim*`; see [rules-qt](docs/rules-qt.md)). - -`mcpp.plugins.accel` reads complete implementation-owned target requests; `mcpp.plugins.progress` enables optional action telemetry. Worker programs can select `plugins-progress` for `mcpp.plugins.progress.writer`, the atomic snapshot writer. See [plugin-development](docs/plugin-development.md#optional-action-progress). - -## Layout +| identity | `mcpp.plugins` | the lib root, compiled before every plugin; it states the collection's version | -``` -mcpp.toml the package: one feature per member -src/plugins.cppm export module mcpp.plugins; the version, mcpp::plugins::surface - (the declarations a consumer names), mcpp::plugins::xml and - mcpp::plugins::package (a staged package's metadata) -src/declare.cppm, the general library for build programs (`plugins-core`): -src/toolset.cppm, mcpp.plugins.declare, mcpp.plugins.toolset, mcpp.plugins.fs -src/fs.cppm -src/testing.cppm mcpp.plugins.testing (`plugins-testing`) -src/platform.cppm mcpp.plugins.platform (`plugins-platform`) -src/compat/, deps/compat/ - compatibility units, each retired on the date its header states -rules/.cppm export module mcpp.rules.; -tools/.cppm export module mcpp.tools.; -dist/.cppm export module mcpp.dist.; -deps/.cppm export module mcpp.deps.; deps/deps.cppm is shared -tests// one project per member, built by CI with the pinned mcpp -docs/ one page per member or group of members -``` +A third-party plugin names its modules `mcpp..*`; `core`, +`plugins`, `deps`, `rules`, `dist`, `tools` belong to this package and the +engine. The full account of the families, and of how the engine routes a file +to a rule, is in [docs/00](docs/00-engine-and-rules.md); where a tool a plugin +runs comes from is in [docs/02](docs/02-tool-sources.md). + +## Plugins + +| feature | what it does | doc | +|---|---|---| +| `rules-cuda` | Compiles CUDA (`*.cu`) through clang with an LLVM toolchain or nvcc with a GCC one. | [docs](docs/10-rules.md#rules-cuda) | +| `rules-sycl` | Compiles SYCL (`*.sycl`) with DPC++. | [docs](docs/10-rules.md#rules-sycl) | +| `rules-spirv` | Compiles GLSL and HLSL shader stages to SPIR-V and embeds or places the result. | [docs](docs/10-rules.md#rules-spirv) | +| `rules-qt` | Runs `moc`, `uic`, `rcc` and Qt's Linguist tools as actions, links the Qt modules and places their runtime. | [docs](docs/11-rules-qt.md) | +| `deps-vcpkg` | Installs a `vcpkg.json` manifest as an action with the toolset mcpp resolved, and maps the prefix into the build. | [docs](docs/40-deps.md#deps-vcpkg) | +| `dist-apk` | Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. | [docs](docs/32-dist-apk.md) | + +
+All 23 plugins — feature, behaviour, doc; the modules and engine floors are in the documentation index -## Adding a member - -A member is one module file, one feature in `mcpp.toml`, a consumer under -`tests/` that CI builds and asserts on, a row in the table above with its mcpp -floor, and a version bump. Its code is the C++23 that GCC with libstdc++, clang -with libc++ and an editor's clangd with libstdc++ all accept, and CI builds or -reads every fixture under each of the three -([docs/plugin-development.md](docs/plugin-development.md#4-the-c-a-plugin-is-written-in)). -The conventions a member follows -- the same for a -third-party or a project's own plugin -- are in -[docs/plugin-development.md](docs/plugin-development.md); the division between -what the engine owns and what the member owns is in -[docs/engine-and-rules.md](docs/engine-and-rules.md#adding-a-member-what-the-engine-owns-and-what-the-member-owns). - -## Releases - -A tag `v` publishes the source archive; the index descriptor -(`mcpp-index/pkgs/mcpp/mcpp.plugins.lua`) names the GitHub archive and its GitCode -mirror with one sha256. +| feature | what it does | doc | +|---|---|---| +| `rules-ascendc` | Compiles Ascend C (`*.asc`) with BiSheng in mixed mode, so the object joins the ordinary link. | [docs](docs/10-rules.md#rules-ascendc) | +| `rules-cuda` | Compiles CUDA (`*.cu`) through clang with an LLVM toolchain or nvcc with a GCC one. | [docs](docs/10-rules.md#rules-cuda) | +| `rules-hip` | Compiles HIP (`*.hip`) with the project's clang on the NVIDIA platform. | [docs](docs/10-rules.md#rules-hip) | +| `rules-metal` | Compiles `.metal` shaders into Metal libraries with the host's Xcode and deploys them beside the program. | [docs](docs/10-rules.md#rules-metal) | +| `rules-qt` | Runs `moc`, `uic`, `rcc` and Qt's Linguist tools as actions, links the Qt modules and places their runtime. | [docs](docs/11-rules-qt.md) | +| `rules-qml` | Builds a QML application: each module's `moc`, `qmltyperegistrar`, `qmlcachegen`, `rcc` and `qsb` chain as actions, Qt's QML modules the program imports placed beside it, and a `qt.conf`. Implies `rules-qt`. | [docs](docs/12-rules-qml.md) | +| `rules-slang` | Compiles Slang (`*.slang`) and embeds or places the result. | [docs](docs/10-rules.md#rules-slang) | +| `rules-spirv` | Compiles GLSL and HLSL shader stages to SPIR-V and embeds or places the result. | [docs](docs/10-rules.md#rules-spirv) | +| `rules-swift` | Compiles a package's `.swift` sources into one module the C and C++ sources call. | [docs](docs/10-rules.md#rules-swift) | +| `rules-sycl` | Compiles SYCL (`*.sycl`) with DPC++. | [docs](docs/10-rules.md#rules-sycl) | +| `tools-embed` | Writes a data file into a header the program compiles in. | [docs](docs/20-tools-embed.md) | +| `tools-island` | Generates the `extern "C"` boundary and the C++ module of a code island. | [docs](docs/21-tools-island.md) | +| `tools-steps` | Describes an action whose work is more than one command as portable operations a backend runs; implied by `dist-apk` and `dist-apple`. | [docs](docs/22-tools-steps.md) | +| `dist-appimage` | Turns the tree `mcpp pack` stages into an AppImage (Linux). | [docs](docs/30-dist.md#dist-appimage) | +| `dist-deb` | Installs the staged tree under `/opt/` with a launcher, a desktop entry and an icon, as a Debian package (Linux targets). | [docs](docs/30-dist.md#dist-deb-and-dist-rpm) | +| `dist-rpm` | The same installation as an RPM package (Linux targets). | [docs](docs/30-dist.md#dist-deb-and-dist-rpm) | +| `dist-wix` | Builds an MSI of the staged tree, and a Burn bundle chaining it (Windows). | [docs](docs/30-dist.md#dist-wix) | +| `dist-apple` | Lays out a macOS or iOS application bundle, signs it and writes a disk image. | [docs](docs/31-dist-apple.md) | +| `dist-web` | Copies a `wasm32-emscripten` program and its files into a web directory with an `index.html`. | [docs](docs/30-dist.md#dist-web) | +| `dist-apk` | Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. | [docs](docs/32-dist-apk.md) | +| `deps-vcpkg` | Installs a `vcpkg.json` manifest as an action with the toolset mcpp resolved, and maps the prefix into the build. | [docs](docs/40-deps.md#deps-vcpkg) | +| `deps-cmake` | Builds and installs a CMake subproject as an action with Ninja and the toolset mcpp resolved, and maps the prefix into the build. | [docs](docs/40-deps.md#deps-cmake) | +| `deps-archive` | Extracts a zip archive the project keeps and places its tree beside the program. | [docs](docs/40-deps.md#deps-archive) | + +
+ +## Contributing and maintenance + +The project is maintained mainly by +[@Sunrisepeak](https://github.com/Sunrisepeak) — its upkeep and growth need +more contributors and maintainers. If some plugins interest you and you want +to contribute and maintain, start from the simple and from what interests +you: use them, introduce and teach them, report issues, fix bugs, improve +them, maintain one or more of them: + +- [propose or submit a new plugin](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=new-plugin.yml) +- [apply to maintain one](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=maintainer-application.yml) + +## Maintainers + +| maintainer | plugins primarily maintained | +|---|---| +| [@Sunrisepeak](https://github.com/Sunrisepeak) | primary maintainer of the project | +| [apply to become a maintainer](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=maintainer-application.yml) | [which plugins the repository takes, what the role is, and how to apply](docs/03-maintainers.md) | diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000..ca2130f --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,108 @@ +# mcpp-plugins + +> mcpp 的官方构建插件——一个插件成员,一个 feature,一个模块。 + +[![ci](https://github.com/mcpp-community/mcpp-plugins/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mcpp-community/mcpp-plugins/actions/workflows/ci.yml) +[![Release](https://img.shields.io/github/v/release/mcpp-community/mcpp-plugins)](https://github.com/mcpp-community/mcpp-plugins/releases) +[![License](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE) + +[English](README.md) | 简体中文 · [文档索引](docs/README.md) · [mcpp](https://github.com/mcpp-community/mcpp) · [mcpp-index](https://mcpp.index.xlings.org) · [发布](https://github.com/mcpp-community/mcpp-plugins/releases) + +mcpp 是一个带有构建插件框架的通用引擎;插件来自本包(`mcpp:plugins`)、来自 +第三方,或来自项目自身,而 `build.mcpp` 是项目使用它们的地方:它按成员声明 +的名字导入成员模块,配置并调用它。这条边是 `[build-dependencies]` 条目—— +库服务于构建程序,本包永不抵达目标。 + +## 快速开始 + +```toml +[build-dependencies.mcpp] +plugins = { version = "0.27.0", features = ["rules-spirv"] } +``` + +```cpp +// build.mcpp +import std; +import mcpp; +import mcpp.rules.spirv; + +int main() { + mcpp::rules::spirv::options opt; + opt.includes = { "shaders" }; + return mcpp::rules::spirv::compile(opt) ? 0 : 1; +} +``` + +## 家族 + +| 家族 | 模块 | 回答的问题 | +|---|---|---| +| rules | `mcpp.rules.` | 一类翻译单元如何被一个 mcpp 不直接驱动的编译器编译 | +| tools | `mcpp.tools.` | 构建程序自己要做什么(见 [`tools/README.md`](tools/README.md)) | +| dist | `mcpp.dist.` | 链接产出什么,以及用户以什么形式安装它 | +| deps | `mcpp.deps.` | 一个库从哪里来 | +| identity | `mcpp.plugins` | 库根,先于每个插件成员编译;它声明这个集合的版本 | + +第三方插件把模块命名为 `mcpp.<它的 namespace>.*`;`core`、`plugins`、`deps`、 +`rules`、`dist`、`tools` 属于本包与引擎。家族的完整论述,以及引擎如何把文件 +路由给 rule,见 [docs/00](docs/00-engine-and-rules.md);成员运行的工具从哪里 +来,见 [docs/02](docs/02-tool-sources.md)。 + +## 插件 + +| feature | 行为 | 文档 | +|---|---|---| +| `rules-cuda` | 经 clang(LLVM 工具链)或 nvcc(GCC 工具链)编译 CUDA(`*.cu`)。 | [docs](docs/10-rules.md#rules-cuda) | +| `rules-sycl` | 用 DPC++ 编译 SYCL(`*.sycl`)。 | [docs](docs/10-rules.md#rules-sycl) | +| `rules-spirv` | 把 GLSL 与 HLSL 着色器阶段编译为 SPIR-V,结果可内嵌或放置。 | [docs](docs/10-rules.md#rules-spirv) | +| `rules-qt` | 以 action 运行 `moc`、`uic`、`rcc` 与 Qt 的翻译工具,链接 Qt 模块并放置其运行时。 | [docs](docs/11-rules-qt.md) | +| `deps-vcpkg` | 以 action 安装 `vcpkg.json` manifest(用 mcpp 解析的 toolset),并把前缀映射进构建。 | [docs](docs/40-deps.md#deps-vcpkg) | +| `dist-apk` | 把原生闭包打成已签名的 APK 或 App Bundle,带 Java、Kotlin 与 Maven 库。 | [docs](docs/32-dist-apk.md) | + +
+全部 23 个插件成员——feature、行为、文档;模块与引擎下限见文档索引 + +| feature | 行为 | 文档 | +|---|---|---| +| `rules-ascendc` | 用 BiSheng 以混合模式编译 Ascend C(`*.asc`),目标文件并入普通链接。 | [docs](docs/10-rules.md#rules-ascendc) | +| `rules-cuda` | 经 clang(LLVM 工具链)或 nvcc(GCC 工具链)编译 CUDA(`*.cu`)。 | [docs](docs/10-rules.md#rules-cuda) | +| `rules-hip` | 在 NVIDIA 平台上用项目自带的 clang 编译 HIP(`*.hip`)。 | [docs](docs/10-rules.md#rules-hip) | +| `rules-metal` | 用宿主的 Xcode 把 `.metal` 着色器编成 Metal 库,并部署在程序旁。 | [docs](docs/10-rules.md#rules-metal) | +| `rules-qt` | 以 action 运行 `moc`、`uic`、`rcc` 与 Qt 的翻译工具,链接 Qt 模块并放置其运行时。 | [docs](docs/11-rules-qt.md) | +| `rules-qml` | 构建 QML 应用:各模块的 `moc`、`qmltyperegistrar`、`qmlcachegen`、`rcc`、`qsb` 链为 action,程序导入的 Qt QML 模块放在程序旁,并写 `qt.conf`。隐含 `rules-qt`。 | [docs](docs/12-rules-qml.md) | +| `rules-slang` | 编译 Slang(`*.slang`),结果可内嵌或放置。 | [docs](docs/10-rules.md#rules-slang) | +| `rules-spirv` | 把 GLSL 与 HLSL 着色器阶段编译为 SPIR-V,结果可内嵌或放置。 | [docs](docs/10-rules.md#rules-spirv) | +| `rules-swift` | 把包的 `.swift` 源码编成一个模块,供 C 与 C++ 源码调用。 | [docs](docs/10-rules.md#rules-swift) | +| `rules-sycl` | 用 DPC++ 编译 SYCL(`*.sycl`)。 | [docs](docs/10-rules.md#rules-sycl) | +| `tools-embed` | 把数据文件写进程序编译内含的头文件。 | [docs](docs/20-tools-embed.md) | +| `tools-island` | 生成代码孤岛的 `extern "C"` 边界与 C++ 模块。 | [docs](docs/21-tools-island.md) | +| `tools-steps` | 把工作不止一条命令的 action 描述为后端运行的可移植操作;被 `dist-apk` 与 `dist-apple` 隐含。 | [docs](docs/22-tools-steps.md) | +| `dist-appimage` | 把 `mcpp pack` 暂存的树做成 AppImage(Linux)。 | [docs](docs/30-dist.md#dist-appimage) | +| `dist-deb` | 把暂存树安装在 `/opt/` 下,带启动器、桌面入口与图标,产出 Debian 包(Linux 目标)。 | [docs](docs/30-dist.md#dist-deb-and-dist-rpm) | +| `dist-rpm` | 同样的安装形态,产出 RPM 包(Linux 目标)。 | [docs](docs/30-dist.md#dist-deb-and-dist-rpm) | +| `dist-wix` | 用暂存树构建 MSI,以及串联它的 Burn bundle(Windows)。 | [docs](docs/30-dist.md#dist-wix) | +| `dist-apple` | 布置 macOS 或 iOS 应用 bundle,签名并写成磁盘映像。 | [docs](docs/31-dist-apple.md) | +| `dist-web` | 把 `wasm32-emscripten` 程序及其文件复制进带 `index.html` 的 web 目录。 | [docs](docs/30-dist.md#dist-web) | +| `dist-apk` | 把原生闭包打成已签名的 APK 或 App Bundle,带 Java、Kotlin 与 Maven 库。 | [docs](docs/32-dist-apk.md) | +| `deps-vcpkg` | 以 action 安装 `vcpkg.json` manifest(用 mcpp 解析的 toolset),并把前缀映射进构建。 | [docs](docs/40-deps.md#deps-vcpkg) | +| `deps-cmake` | 以 action 用 Ninja 与 mcpp 解析的 toolset 构建并安装 CMake 子项目,并把前缀映射进构建。 | [docs](docs/40-deps.md#deps-cmake) | +| `deps-archive` | 解压项目自带的 zip 归档,把它的树放在程序旁。 | [docs](docs/40-deps.md#deps-archive) | + +
+ +## 贡献与维护 + +项目目前主要由 [Sunrisepeak](https://github.com/Sunrisepeak) 维护——项目的 +维护和发展需要更多贡献者与维护者。如果你对某些插件感兴趣并期望参与贡献和 +维护,从简单的、自己感兴趣的方向开始:使用它、介绍与教学、反馈问题、修复 +bug、优化改进、维护一个或多个插件: + +- [提出或提交一个新插件](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=new-plugin.yml) +- [申请维护一个插件成员](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=maintainer-application.yml) + +## 维护者 + +| 维护者 | 主要负责的插件成员 | +|---|---| +| [Sunrisepeak](https://github.com/Sunrisepeak) | 项目主要负责人 | +| [申请成为维护者](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=maintainer-application.yml) | [收录标准、职责与申请方式](docs/03-maintainers.md) | diff --git a/deps/cmake.cppm b/deps/cmake.cppm index c950f9b..37a1b57 100644 --- a/deps/cmake.cppm +++ b/deps/cmake.cppm @@ -99,7 +99,7 @@ struct options { // the toolset mcpp builds the program with, named by path, with the Ninja // generator and mcpp's own ninja. `detected` lets CMake find its own // toolset, as 0.16.0 did, until 2027-03-28. Compilers or a toolchain file - // in `cache_args` decide instead. See docs/deps.md. + // in `cache_args` decide instead. See docs/40-deps.md. mcpp::plugins::toolset::choice toolset; // Which generator (0.18.0). `default` is Ninja wherever the toolset is // named, a Visual Studio instance's included, as vcpkg builds its CMake @@ -118,7 +118,7 @@ struct options { // (`%LOCALAPPDATA%/mcpp-plugins/deps-cmake`, // `$XDG_CACHE_HOME/mcpp-plugins/deps-cmake` or // `~/.cache/mcpp-plugins/deps-cmake`). Read when the action runs; the place - // is no part of what is built. See docs/deps.md. + // is no part of what is built. See docs/40-deps.md. std::string cache; // `CMAKE_SYSTEM_NAME` of a build for another target (0.21.0). Empty // derives it from the target's system: Linux, Android, Darwin, iOS, diff --git a/deps/vcpkg.cppm b/deps/vcpkg.cppm index 7e3f1eb..73e6432 100644 --- a/deps/vcpkg.cppm +++ b/deps/vcpkg.cppm @@ -94,7 +94,7 @@ struct options { // other toolset is named in a derived triplet `-mcpp-` // (CMake and make ports build; an MSBuild port needs Visual Studio and is // refused by name). `detected` lets vcpkg find its own toolset, as 0.16.0 - // did, until 2027-03-28. See docs/deps.md. + // did, until 2027-03-28. See docs/40-deps.md. mcpp::plugins::toolset::choice toolset; // The C runtime linkage of the ports on the MSVC ABI, "static" or // "dynamic". Empty follows the program's C++ runtime contract diff --git a/docs/engine-and-rules.md b/docs/00-engine-and-rules.md similarity index 91% rename from docs/engine-and-rules.md rename to docs/00-engine-and-rules.md index ec225b5..e2619c6 100644 --- a/docs/engine-and-rules.md +++ b/docs/00-engine-and-rules.md @@ -1,11 +1,11 @@ -# How the members meet the engine +# How the plugins meet the engine -How a rule reaches the engine: each rule declares its own environment and the file extensions it claims, a consumer names a member through features and the declarations a payload generates, and the engine compiles each member as a host module. The section on what a rule may drive states the one constraint every member shares: it drives only a compiler the ecosystem resolved. +How a rule reaches the engine: each rule declares its own environment and the file extensions it claims, a consumer names a plugin through features and the declarations a payload generates, and the engine compiles each plugin as a host module. The section on what a rule may drive states the one constraint every plugin shares: it drives only a compiler the ecosystem resolved. ## Naming, in full The four families answer four different questions, and the prefix is which -one a member answers: +one a plugin answers: ``` rules-* how is this translation unit compiled @@ -14,19 +14,19 @@ dist-* what comes out of the link, and in what form a user installs it deps-* where does a library come from ``` -A `dist-*` member fits neither of the first two definitions: it does not +A `dist-*` plugin fits neither of the first two definitions: it does not compile a translation unit and it does not do its work while the build program runs. It consumes **link outputs** through a `role = "artifact"` action, reached with `mcpp pack --format ` (mcpp 2026.9.11.1+). The prefix matters because the taxonomy is load-bearing -- a consumer reading `rules-wix` would expect a compiler it does not drive and a translation unit, and there is neither. -A `deps-*` member compiles none of the project's translation units and does not +A `deps-*` plugin compiles none of the project's translation units and does not do its work while the build program runs: the installation is a `prepare` action (mcpp's SPEC-007, docs/specs/build-plugins.md), which fills a declared output directory and which the package's compile and link edges wait for, and whose command is the installer itself -- `vcpkg`, or `cmake -P` over a script -the member writes -- so the package builds no program for it. The build +the plugin writes -- so the package builds no program for it. The build program refers to the prefix by name -- include directory, libraries by full path, runtime search directory -- and never by what is in it, so a plan made before the installation is the plan made after it. @@ -110,11 +110,11 @@ A device source that NO rule claims is not silently dropped: mcpp refuses a device source that reached no action, naming the file. That is the engine's half of this rule and it needs 2026.9.6.5. -The floor is the mcpp release whose engine carries what the member relies on. +The floor is the mcpp release whose engine carries what the plugin relies on. From 0.4.0 every rule shares one: **2026.9.8.1**, the release in which a package's host modules are ordered by their IMPORT GRAPH rather than by their -paths. This package needs that: `src/declare.cppm` is imported by every member, -and `rules/` sorts before `src/`, so before that release the members were +paths. This package needs that: `src/declare.cppm` is imported by every plugin, +and `rules/` sorts before `src/`, so before that release the plugins were compiled first and failed with "failed to read compiled module". **The floor could have been avoided, and was not.** `src/declare.cppm` sorts @@ -133,9 +133,9 @@ change to what this package generates, not to what it asks the engine for. under MSVC 14.52 (36629 and 36725, measured on xrgui's CI) a module that has instantiated `std::filesystem::path`'s iterator poisons every importer that touches `path` again -- `filesystem(1572): error C2801: '_Path_iterator<...>::operator ==' -must be a non-static member`. Nothing in this package instantiates that +must be a non-static plugin`. Nothing in this package instantiates that iterator now: the lib root reads paths apart as strings -(`mcpp::plugins::names::components`), and the members' relative-path +(`mcpp::plugins::names::components`), and the plugins' relative-path arithmetic is `mcpp::plugins::names::relative_to`. The previous shared floor was 2026.9.7.1, the release that reads @@ -150,20 +150,20 @@ The previous shared floor was 2026.9.6.6, the release in which a payload a DEPENDENCY declared is both installed and answerable. Before it a rule could declare `>=8.5.0`, have it installed, and still be told by `xpkg_dir` that nothing was there -- which is why each rule's list used to be repeated in every -project that used it. The earlier per-member floors are still the floors of the +project that used it. The earlier per-plugin floors are still the floors of the rules themselves (`rules-spirv` needs the shader extensions in the device-source table, 2026.9.5.3; `tools-embed` needs the fast path to compare a declared file input, 2026.9.5.4; `rules-sycl` needs `.sycl` in that table, 2026.9.6.1), and they are all below the shared one. -`rules-slang` is the member that does NOT appear in that list, and its absence +`rules-slang` is the plugin that does NOT appear in that list, and its absence is the point: `.slang` is in no engine table at any version. The feature declares the extension and the module that compiles it, so the release it needs is the one that reads those two keys rather than the one that would have carried its extension. 0.10.0 moves the collection's floor to **2026.9.14.2**, and the reason is two -members rather than the rules: `dist-apk` and `dist-apple` read the native +plugins rather than the rules: `dist-apk` and `dist-apple` read the native closure the engine stages and names in the stage manifest's `needs` lines, `dist-apple`'s framework rpath needs the engine to leave an `@executable_path` rpath as written, and `mcpp run --format app` reaches the runner named after the @@ -171,13 +171,13 @@ format only from that release. `rules-metal` itself needs nothing past 2026.9.8.1. An older engine is not left to fail silently: `dist-apk` refuses a stage without `needs` lines, naming the release. -The index descriptor states the highest floor among the members, so it is the +The index descriptor states the highest floor among the plugins, so it is the floor of the collection rather than of any one feature; a project on an older mcpp is refused at resolution rather than at the first shader. ## What a consumer names -A member that embeds a payload -- `rules-spirv`, `rules-slang`, `tools-embed` -- +A plugin that embeds a payload -- `rules-spirv`, `rules-slang`, `tools-embed` -- does not leave the consumer to include a generated header. All three hand their payloads to one generator, `mcpp::plugins::surface`, so what a consumer writes is the same whichever produced them: @@ -233,7 +233,7 @@ worse than it looks: measured with GCC 16.1 on a 1 MB payload, an interface returning `std::span` produced a 1 313 968-byte BMI against 1 808 bytes for the std-free equivalent, and that cost is fixed rather than proportional to the payload -- it is ``'s templates, present whether the payload is 16 KB or -16 MB. A consumer that wants a `std::span` constructs one from the two members. +16 MB. A consumer that wants a `std::span` constructs one from the two plugins. **Where the bytes live is a second, independent choice.** The surface decides how a consumer names a payload; `storage` decides where it sits. The declarations are @@ -313,7 +313,7 @@ the setting as `MCPP_LANGUAGE_MODULES`; an engine that does not report it leaves the header surface in place, so an older engine keeps the behaviour every consumer of this package had before the surface existed. -**The generator is not shader-specific, and three members already share it.** +**The generator is not shader-specific, and three plugins already share it.** `mcpp::plugins::surface` knows about a run of bytes, a name, where it lives and how it is reached; it does not know what SPIR-V is. `rules-spirv`, `rules-slang` and `tools-embed` all call it, which is what keeps their generated declarations @@ -335,17 +335,17 @@ now, and every consumer reaches the same array through the accessor. mcpp compiles every module interface unit among a host-module package's resolved sources as a host module of its own, the lib root first (2026.9.5.3+). -`[features.] sources` is what puts a member into that set, so the module set -a consumer can import is exactly its feature set. A member is compiled alone, +`[features.] sources` is what puts a plugin into that set, so the module set +a consumer can import is exactly its feature set. A plugin is compiled alone, in the same command as the consumer's `build.mcpp`, and may import `std`, `mcpp` and `mcpp.plugins`. ## What a rule may drive, and what it may not -A member drives a compiler the ecosystem resolved and no other. `xim:dpcpp` is +A plugin drives a compiler the ecosystem resolved and no other. `xim:dpcpp` is `mcpp.rules.sycl`'s compiler; `xim:gcc` is the C++ standard library it compiles against; `xim:cuda-nvcc` is the back end it emits for. None of the three is a -default: each is read from `mcpp::xpkg_dir`, and a member that cannot find one +default: each is read from `mcpp::xpkg_dir`, and a plugin that cannot find one refuses and prints the `[xlings.workspace]` line that would add it. Two of those three were added because a build that already worked was found to @@ -354,17 +354,17 @@ be reading the host. Without `--gcc-install-dir` the SYCL unit compiled against installation. Neither said anything: both are visible only in the compiler's own include search list, and only on a machine that has those directories. -## Adding a member: what the engine owns and what the member owns +## Adding a plugin: what the engine owns and what the plugin owns 1. One file, `rules/.cppm`, `tools/.cppm`, `dist/.cppm` or `deps/.cppm`, declaring its module name. The engine owns the graph — the accelerator axis, the constrained globs, - the action edges, the fingerprint — and the member owns the spelling: which - tool, which flags, what is generated. A member does not read `/usr`; a tool + the action edges, the fingerprint — and the plugin owns the spelling: which + tool, which flags, what is generated. A plugin does not read `/usr`; a tool comes from `mcpp::toolchain_dir()`, `mcpp::xpkg_dir()` or an explicit option, and a missing one is refused naming the `[xlings.workspace]` entry to add. 2. A feature in `mcpp.toml` adding that one source. 3. A consumer under `tests/` that builds through it and asserts on the - artefact, and a row in the README's members table with the mcpp floor. + artefact, and a row in the README's plugins table with the mcpp floor. 4. A version bump: mcpp identifies an installed package by `(name, version)`, so a changed payload under an unchanged version is not reinstalled. diff --git a/docs/plugin-development.md b/docs/01-plugin-development.md similarity index 91% rename from docs/plugin-development.md rename to docs/01-plugin-development.md index 1eba362..9a2f61a 100644 --- a/docs/plugin-development.md +++ b/docs/01-plugin-development.md @@ -65,19 +65,19 @@ speaks protocol 17 (the platform's directives and the `platform` phase, mcpp SPEC-013) and writes `mcpp-package.json` beside every staged tree (SPEC-014); it carries protocol 15, which states where each tool and payload comes from. -**Where a member's tool comes from.** A member that runs a program resolves it -through `mcpp.plugins.tool`, which answers in one order for every member: +**Where a plugin's tool comes from.** A plugin that runs a program resolves it +through `mcpp.plugins.tool`, which answers in one order for every plugin: 1. the build program's own choice — `o.cmake = "/usr/bin/cmake"`, or `tool::root(dir)`, `tool::on_path()`; -2. the variable that member has always read (`MCPP_SLANGC`), kept for the +2. the variable that plugin has always read (`MCPP_SLANGC`), kept for the projects that write it; 3. the engine's override (`[xlings.overrides]`, `MCPP_XLINGS_OVERRIDE_*`, `config.toml`) — the payload is then not installed at all; 4. the declared payload, asked for here when it is declared `provision = "on-request"`. -A member writes one `tool::spec` per tool (the package, the program names, the +A plugin writes one `tool::spec` per tool (the package, the program names, the directories under a root, the option's name, a legacy variable) and calls `resolve`: @@ -102,8 +102,8 @@ build reports. A choice alone does not prevent a download: an eagerly declared payload is provisioned before any build program runs. The pair that makes "named here, not -downloaded" true, the scenarios on both sides of it, and how each official member -declares its tools are in [tool-sources.md](tool-sources.md). +downloaded" true, the scenarios on both sides of it, and how each official plugin +declares its tools are in [02-tool-sources.md](02-tool-sources.md). **Stating the build toolchain.** `mcpp.plugins.toolchain` (feature `plugins-toolchain`) builds the statement a root build program makes in its @@ -195,24 +195,42 @@ A plugin is C++23 that three combinations of compiler and standard library accep | clang (LLVM 22) with libc++ | `mcpp build --toolchain llvm@22.1.8` on Linux, and every build on macOS | `toolchain-llvm`, `rules-cross-platform` | | clang with libstdc++'s `std` module | an editor's clangd (mcppls) reading a project built with GCC | `toolchain-editor` | -MSVC is a fourth for the members that claim Windows, checked by `rules-cross-platform` and `deps-managed-msvc`. The third combination is never used by a build, so only the editor lane sees what it rejects; it runs `mcppls diagnostics build.mcpp` on every fixture and fails on any error. +MSVC is a fourth for the plugins that claim Windows, checked by `rules-cross-platform` and `deps-managed-msvc`. The third combination is never used by a build, so only the editor lane sees what it rejects; it runs `mcppls diagnostics build.mcpp` on every fixture and fails on any error. Known differences, each one met in this package: - **A type that holds a container of itself does not use `std::pair` or `std::tuple` for the element.** Under clang with libstdc++'s `std` module, `std::vector>` inside `value` instantiates the pair while `value` is incomplete and fails with "incomplete type used in type trait expression"; GCC and clang with libc++ accept it. The element is a plain struct, and a member function that walks the container is defined after both types are complete (`mcpp::plugins::json::member`, 0.19.1). - **No compiler's leniency is relied on.** An extension, a missing `typename`, or a template accepted only because one compiler instantiates it later is a failure in another lane. - **A build program does not use `std::println`.** On macOS 14 the build program links the system libc++, which lacks a symbol it needs; `std::format` into a string and `std::cout` work everywhere. -- **No unit includes a header or branches on the platform in the preprocessor.** The C library comes from `std`, which exports the functions and types of ISO C (`std::isalnum`, `std::getenv`, `std::FILE`) but no macro; a macro of ISO C (`stdout`, `errno`, `SEEK_SET`) comes from `mcpplibs.mwrap.libc` under its own name (`mcpplibs::mwrap::libc::macros::stdout()`). The operating system comes from `mcpplibs.os`: a program a member asks for a fact runs through `mcpp::plugins::tool::capture` (its arguments as a vector, no shell, so nothing is quoted and no null device is named), a library opens through `mcpplibs::os::library::open`, and a child's environment is stated in its spawn options rather than written into this process's. A build program runs on the machine that builds, so a platform difference is a compile-time question of that machine: `if constexpr (mcpplibs::os::is_windows)`. CI refuses an `#include`, `#if` or `#ifdef` in a unit (0.21.0). +- **No unit includes a header or branches on the platform in the preprocessor.** The C library comes from `std`, which exports the functions and types of ISO C (`std::isalnum`, `std::getenv`, `std::FILE`) but no macro; a macro of ISO C (`stdout`, `errno`, `SEEK_SET`) comes from `mcpplibs.mwrap.libc` under its own name (`mcpplibs::mwrap::libc::macros::stdout()`). The operating system comes from `mcpplibs.os`: a program a plugin asks for a fact runs through `mcpp::plugins::tool::capture` (its arguments as a vector, no shell, so nothing is quoted and no null device is named), a library opens through `mcpplibs::os::library::open`, and a child's environment is stated in its spawn options rather than written into this process's. A build program runs on the machine that builds, so a platform difference is a compile-time question of that machine: `if constexpr (mcpplibs::os::is_windows)`. CI refuses an `#include`, `#if` or `#ifdef` in a unit (0.21.0). - **A function that reaches mcpplibs.os is not `inline`.** A rule's helper that runs a program (`mcpp::plugins::tool::capture`) or opens a library is defined without `inline`, so it is compiled once in its module and an importer sees its declaration only. Under GCC 16 an importer that reads such a body from an inline function fails: "failed to read compiled module cluster: Bad file data", or an unresolved `std::optional>` at the link (`tests/metal-consumer`, 0.21.0). - **A module does not instantiate `std::filesystem::path`'s iterator.** Under MSVC 14.52 every importer that then touches `std::filesystem` fails inside the STL; `mcpp::plugins::names::components` splits a path as a string instead. +**The private region of a unit.** A plugin's file, and each unit of a directory +plugin, reads in three parts: the `export module` line with its imports, the +interface its importers see, and, last, the unit's own private region. In a +unit that is its module's only unit the private region is a private module +fragment — `module :private;` — and the declarations and definitions after it +are the unit's own, never visible to an importer. A unit that shares its module +with other units cannot carry a fragment: its private region is a +`namespace detail` block, and the names a sibling unit imports stay outside it. + +The plugins this package ships today were written before the rule and are not +migrated: a plugin adopts the fragment as it is touched — noted here as a +TODO, not carried out wholesale. + ## 5. A new plugin A plugin in this package consists of: -- a module file under `rules/`, `tools/`, `dist/` or `deps/`; +- a module under `rules/`, `tools/`, `dist/` or `deps/` — one file + `/.cppm`, or a directory when the plugin outgrows one file: + `//.cppm` is the interface a consumer imports, and the units + under `//internal/` carry the machinery as modules named + `mcpp...internal.`. The module name a consumer imports + does not change, and the internals are not part of the contract (§2.5); - a feature in `mcpp.toml`; - a fixture under `tests/` that CI builds and asserts on; -- a row in the README's member table with its mcpp floor; +- a row in the README's plugin table with its mcpp floor; - a page under `docs/`; - a version bump. diff --git a/docs/tool-sources.md b/docs/02-tool-sources.md similarity index 93% rename from docs/tool-sources.md rename to docs/02-tool-sources.md index 48d2382..473f7d6 100644 --- a/docs/tool-sources.md +++ b/docs/02-tool-sources.md @@ -1,6 +1,6 @@ # Where a tool comes from -A member that runs a program — cmake, vcpkg, glslangValidator, nvcc, appimagetool +A plugin that runs a program — cmake, vcpkg, glslangValidator, nvcc, appimagetool — answers one question before it can plan anything: which program. This page is the account of that question for the three people it concerns: whoever writes a plugin, whoever designs one, and whoever uses one. It is written as scenarios, @@ -16,7 +16,7 @@ own account is mcpp `docs/23-the-project-environment.md`; the design record is 1. the build program's choice o.cmake = "/usr/bin/cmake" o.cmake = tool::root("/opt/cmake") o.cmake = tool::on_path() -2. the member's legacy variable MCPP_SLANGC, MCPP_GLSLC (kept, never extended) +2. the plugin's legacy variable MCPP_SLANGC, MCPP_GLSLC (kept, never extended) 3. the engine's override [xlings.overrides] in the root or workspace manifest MCPP_XLINGS_OVERRIDE__ ~/.mcpp/config.toml @@ -38,7 +38,7 @@ machine. Every level names itself in the output, so an environment variable quietly displacing a project's decision is not possible. An override is read from the root manifest only — or the workspace manifest, when -a member is built. A dependency that writes the table is refused and named: +a plugin is built. A dependency that writes the table is refused and named: **which payloads a package needs is its own statement; where they come from is the project's.** @@ -69,7 +69,7 @@ plugin declares, stated in the build program and nowhere else -- no ### 3.1 Four ways, each a whole build program -Every example here is a complete `build.mcpp` that compiles. A member reads one +Every example here is a complete `build.mcpp` that compiles. A plugin reads one option (section 3.6 is the index); what differs is what the project states. **A program this machine already has.** The plainest form: a string assigns to the @@ -89,8 +89,8 @@ int main() { } ``` -**A tree, with the member looking inside it.** `tool::root` states a directory and -lets the member apply its own layout: `deps-cmake` looks for `cmake` in `bin` and +**A tree, with the plugin looking inside it.** `tool::root` states a directory and +lets the plugin apply its own layout: `deps-cmake` looks for `cmake` in `bin` and in `CMake.app/Contents/bin`, `deps-vcpkg` directly under the root. ```cpp @@ -109,7 +109,7 @@ int main() { } ``` -**Whatever is on PATH, as a stated choice.** A member never falls back to PATH on +**Whatever is on PATH, as a stated choice.** A plugin never falls back to PATH on its own; `tool::on_path()` is how a project asks for that, so the log records that the build depends on the machine. @@ -220,7 +220,7 @@ same two lines as the `getenv` pair, for a project that already enables ### 3.4 A stated choice that fails is not replaced -The member +The plugin refuses and names what it consulted, rather than falling back to the payload: ``` @@ -238,7 +238,7 @@ to answer from the output. `deps-vcpkg` declares its payload `provision = "on-request"`, so the choice is read before anything is provisioned. -For a member whose payload is eager -- `rules-cuda`'s toolkit, which the plan +For a plugin whose payload is eager -- `rules-cuda`'s toolkit, which the plan reads a version out of -- naming the tool in `build.mcpp` does not prevent the download, and `[xlings.overrides]` is the way out. Section 5.2 is the table. @@ -264,10 +264,10 @@ a warm payload cache does not save this twice. ### 3.6 Which option, and what it looks for -Each member names its tool through one option, and states where it looks under a +Each plugin names its tool through one option, and states where it looks under a root. A path assigned as a string is taken as the program itself in every case. -| member | option | program names | under a root it looks in | variable it still reads | +| plugin | option | program names | under a root it looks in | variable it still reads | |---|---|---|---|---| | `deps-vcpkg` | `options::vcpkg` (and `options::vcpkg_root`) | `vcpkg` | the root itself | -- | | `deps-cmake`, `deps-archive` | `options::cmake` | `cmake` | `bin`, `CMake.app/Contents/bin` | -- | @@ -282,7 +282,7 @@ root. A path assigned as a string is taken as the program itself in every case. | `dist-wix` | `options::tool` | `wix` | `tool/tools/net6.0/any` | -- | | `dist-apk` | `options::build_tools`, `options::platform`, `options::jdk`, `options::bundletool_dir`, `options::kotlin`, `options::coursier` | roots, no program | -- | -- | -A member whose option names a **root rather than a program** -- `rules-qt`, +A plugin whose option names a **root rather than a program** -- `rules-qt`, `rules-ascendc`, `dist-apk` -- takes `tool::root(...)` or a plain directory path, because what it needs is the tree, not one executable. @@ -313,13 +313,13 @@ succeeded either way. plugins = { version = "0.19.0", features = ["deps-cmake"], host-module = true } ``` -The member resolves nothing stated, reaches the fourth level, finds `xim:cmake` +The plugin resolves nothing stated, reaches the fourth level, finds `xim:cmake` declared on request and not installed, asks for it, and the engine installs it and runs the program again. The output is byte-for-byte what it was before this mechanism existed. One difference from 0.18.1: **a payload declared and not used is not installed.** -A build that never reaches the member — because it compiles only its own modules, +A build that never reaches the plugin — because it compiles only its own modules, or because `--format` took another branch — downloads nothing for it. ### 4.2 State it in the manifest instead of the build program @@ -331,7 +331,7 @@ or because `--format` took another branch — downloads nothing for it. "xim:slang" = { program = "slangc", version = "2026.14.1" } # checked against every requirement ``` -This path needs no support from the member: the engine removes the payload from +This path needs no support from the plugin: the engine removes the payload from the provisioning set, `mcpp::xpkg_dir` answers the root the override implies, and `mcpp::xpkg_source` answers `override`. **A plugin that has not migrated to `mcpp.plugins.tool` benefits from it unchanged**, as long as it reads its @@ -397,7 +397,7 @@ bootstrap = "llvm@22.1.8" # the one that compiles build pr ## 5. For whoever writes a plugin -### 5.1 A member that runs a program +### 5.1 A plugin that runs a program Three pieces, written once per tool: @@ -407,7 +407,7 @@ struct options { mcpp::plugins::tool::choice cmake; }; -// 2. the spec: this member's own knowledge, and nothing else +// 2. the spec: this plugin's own knowledge, and nothing else inline mcpp::plugins::tool::spec cmake_spec(std::string who) { return { .who = std::move(who), .package = "cmake", .programs = {"cmake"}, .bin_dirs = {"bin", "CMake.app/Contents/bin"}, .option = "options::cmake" }; @@ -421,13 +421,13 @@ if (!t) { warn(mcpp::plugins::tool::describe_missing(cmake_spec("mcpp.deps.cmake run(t.program); ``` -`choice` is constructible from a string, so a member migrating from +`choice` is constructible from a string, so a plugin migrating from `std::string` costs its users nothing: `o.cmake = "/usr/bin/cmake"` still compiles, and the line that wrote it reaches the build's output and `mcpp why tool cmake`. `describe_missing` is the one refusal text, and it lists every way to name the -tool. A member does not write its own. +tool. A plugin does not write its own. ### 5.2 The pair that makes "named here, not downloaded" true @@ -446,7 +446,7 @@ The manifest half: So the author's decision is one question: -| when the member needs the tool | how to declare it | after a user names their own | +| when the plugin needs the tool | how to declare it | after a user names their own | |---|---|---| | while **planning** (it runs cmake, vcpkg, appimagetool, bundletool) | `provision = "on-request"` | nothing is downloaded | | **to plan at all** (it reads a version out of the toolkit's headers, an SDK file, an API level from a platform directory) | plainly, which is eager | still downloaded; the user skips it with `[xlings.overrides]` | @@ -464,7 +464,7 @@ the build program would make them fail to plan. "xim:bundletool" = { version = "1.18.3", provision = "on-request" } ``` -The member requests it while planning a bundle, so an ordinary `--format apk` +The plugin requests it while planning a bundle, so an ordinary `--format apk` build installs nothing for it. The engine installs every request of one invocation together and runs only the programs that asked; the asking run is discarded before its directives are applied, so there is no half-applied state. @@ -484,7 +484,7 @@ in `rules-sycl` while it took the payload directory and appended the SYCL consumer failed with `ld.lld: error: unable to find library -lsycl`. The whole collection was audited for that swap. -### 5.5 Keep the variable a member already read +### 5.5 Keep the variable a plugin already read ```cpp .legacy_env = "MCPP_SLANGC" @@ -494,16 +494,16 @@ It answers at the second level, before the engine's override. `rules-slang` also keeps its historical silent PATH fallback, with a warning that names the correct spelling (`options::compiler = tool::on_path()`) and the date it is removed. -### 5.6 A member that only looks +### 5.6 A plugin that only looks -A member that reports what a machine has, rather than running it, passes +A plugin that reports what a machine has, rather than running it, passes `.request = false`, so looking never pulls a payload down. `rules-qt` does this when it resolves an SDK root: it reports which of the three levels named one, and a report is not a reason to download anything. ### 5.7 Prove it, without installing anything -`mcpp.plugins.testing` runs a member against a stated context and compares the +`mcpp.plugins.testing` runs a plugin against a stated context and compares the directives it emitted: ```cpp @@ -543,7 +543,7 @@ refused in a dependency. **One answer, recorded once.** An explicit source produces exactly one `Using` line, one entry in the `Finished` summary, one record in `resolution.json`, and one section of `mcpp why`. All four read the same `SourceDecision`, so three -cannot agree while the fourth lags. A member contributes to it by calling +cannot agree while the fourth lags. A plugin contributes to it by calling `resolve`, which states `mcpp:decision=`; it does not print its own. **The default stays the default.** The ecosystem's path is the one a project @@ -566,9 +566,9 @@ tree that states it is refused where the declaration is read, because gcc select a linker by the name `ld` inside a `-B` directory and a stated tool that takes no part in the build is what this mechanism exists to prevent. -## 7. Every official member that drives a tool, and how it declares it +## 7. Every official plugin that drives a tool, and how it declares it -| member | tool | declaration | reason | +| plugin | tool | declaration | reason | |---|---|---|---| | `deps-vcpkg` | `xim:vcpkg` | on request | it runs vcpkg while planning | | `deps-cmake`, `deps-archive` | `xim:cmake` | on request | it runs cmake while planning | diff --git a/docs/03-maintainers.md b/docs/03-maintainers.md new file mode 100644 index 0000000..86d0d55 --- /dev/null +++ b/docs/03-maintainers.md @@ -0,0 +1,54 @@ +# Maintainers + +The repository is maintained mainly by +[@Sunrisepeak](https://github.com/Sunrisepeak); its upkeep and growth need +more contributors and maintainers. + +## The path + +Start from the simple and from what interests you, and learn a plugin as you +go: + +**use it → introduce and teach it → report issues → fix bugs → improve it → +maintain one or more plugins** + +## Which plugins this repository takes + +This repository carries plugins that are general — a mechanism many projects +reuse — or that drive a widely used, well-known project. A build plugin +specific to one project is better kept beside that project: the plugin lives +in the project's repository, and the project publishes it to mcpp-index like +any library — a build plugin is an ordinary package. +[slint-m](https://github.com/mcpplibs/slint-m) is the example: the build rule +`mcpplibs.mplugin.slint` ships in Slint's own wrapper repository and is +published to the index, not here. + +## What a maintainer does + +Two core responsibilities, and both count: + +| core | the work | +|---|---| +| Technical development | issue triage, fixes, the fixture and CI care on every platform the plugin claims | +| Ecosystem building and technical outreach | technical articles, videos, tutorials — and indirect ecosystem growth: real projects built on the plugin | + +Development plus outreach is the core of the role; the second column is not +optional. + +## What a maintainer knows + +Deep familiarity with the plugin's module and its application domain. The +plugin's page in the [index](README.md) states what it does; the +[conventions](01-plugin-development.md) state what every plugin follows. + +## Applying + +Submissions follow the criterion above. Applications go through the +[issue template](https://github.com/mcpp-community/mcpp-plugins/issues/new?template=maintainer-application.yml), +one plugin per application. An application states contributions to the plugin +in both categories — technical development, and ecosystem building and +technical outreach — and a maintenance plan that covers both sides. A +recommendation from an existing maintainer of a related plugin supports it. +The original author of a plugin accepted into this repository becomes the +plugin's maintainer; bug fixes and improvements are always welcome before any +application. diff --git a/docs/rules.md b/docs/10-rules.md similarity index 96% rename from docs/rules.md rename to docs/10-rules.md index 0471dae..3d0120c 100644 --- a/docs/rules.md +++ b/docs/10-rules.md @@ -1,6 +1,6 @@ # Device and language rules -The rules that compile one kind of translation unit with a compiler mcpp does not drive: GPU and accelerator languages (`rules-ascendc`, `rules-cuda`, `rules-hip`, `rules-sycl`), shader languages (`rules-spirv`, `rules-slang`, `rules-metal`) and Swift (`rules-swift`). Each section states the module, the engine floor, what the rule needs and how it compiles. The environment each rule brings and the extensions it claims are in [engine-and-rules.md](engine-and-rules.md). +The rules that compile one kind of translation unit with a compiler mcpp does not drive: GPU and accelerator languages (`rules-ascendc`, `rules-cuda`, `rules-hip`, `rules-sycl`), shader languages (`rules-spirv`, `rules-slang`, `rules-metal`) and Swift (`rules-swift`). Each section states the module, the engine floor, what the rule needs and how it compiles. The environment each rule brings and the extensions it claims are in [00-engine-and-rules.md](00-engine-and-rules.md). ## `rules-ascendc` @@ -59,9 +59,9 @@ Module `mcpp.rules.sycl`; engine floor: 2026.10.1.3 (0.19.0, mcpp#755; 2026.9.6. Each selected implementation owns its targets. A repository may retain CUDA and SYCL source groups while selecting only `sycl+{nvptx64-sm_89}`; the CUDA group is excluded by its source constraint and the CUDA rule need not be imported. Selecting `cuda+{sm_90},sycl+{nvptx64-sm_89}` selects both implementations with different targets. The rule passes the same target vector to compilation and device linking. Its CUDA compiler payload is requested only for a SYCL NVIDIA target; `options::cuda` accepts the same explicit choice as other rule tools. -The older `sycl,cuda+{sm_89}` form still inherits CUDA targets when the SYCL member has no targets, with a migration warning. Both named implementations remain selected. Explicit SYCL targets are never replaced by a CUDA member. Move the device target to the SYCL member to select only SYCL. GPU execution still requires a compatible device and driver; CI verifies the emitted images and the CPU fallback separately. +The older `sycl,cuda+{sm_89}` form still inherits CUDA targets when the SYCL plugin has no targets, with a migration warning. Both named implementations remain selected. Explicit SYCL targets are never replaced by a CUDA plugin. Move the device target to the SYCL plugin to select only SYCL. GPU execution still requires a compatible device and driver; CI verifies the emitted images and the CPU fallback separately. -**Several NVIDIA architectures in a library.** Each package's device link reads that package's own objects (`-fsycl-link` over its `.sycl.o`), so a library's images are registered inside the library and a consumer's link never asks the SDK to unbundle an archive; a library of `sycl+{nvptx64-sm_89,nvptx64-sm_90}` links into a program with each image its own architecture's (`tests/sycl-library-consumer`). Not supported: handing the SDK an archive of several NVIDIA architectures to device-link (a prebuilt SYCL `.a`, or a kernel that calls a `SYCL_EXTERNAL` function of another package). DPC++ 7.1.0's `clang-offload-bundler` matches the five-part bundle IDs its driver writes (`sycl-nvptx64-nvidia-cuda-sm_89`) to every NVPTX request, so unbundling such an archive for one architecture yields the members of all of them and the device link reports duplicate definitions (mcpp#899, an SDK defect). There, build that archive for one architecture, or keep the device code of each architecture in the package that launches it. The rule keeps every requested architecture; it neither drops one nor reuses one architecture's code for another. +**Several NVIDIA architectures in a library.** Each package's device link reads that package's own objects (`-fsycl-link` over its `.sycl.o`), so a library's images are registered inside the library and a consumer's link never asks the SDK to unbundle an archive; a library of `sycl+{nvptx64-sm_89,nvptx64-sm_90}` links into a program with each image its own architecture's (`tests/sycl-library-consumer`). Not supported: handing the SDK an archive of several NVIDIA architectures to device-link (a prebuilt SYCL `.a`, or a kernel that calls a `SYCL_EXTERNAL` function of another package). DPC++ 7.1.0's `clang-offload-bundler` matches the five-part bundle IDs its driver writes (`sycl-nvptx64-nvidia-cuda-sm_89`) to every NVPTX request, so unbundling such an archive for one architecture yields the plugins of all of them and the device link reports duplicate definitions (mcpp#899, an SDK defect). There, build that archive for one architecture, or keep the device code of each architecture in the package that launches it. The rule keeps every requested architecture; it neither drops one nor reuses one architecture's code for another. The `tests/multi-accel-consumer` fixture selects `cuda+{sm_90},sycl+{nvptx64-sm_89}` and imports both rules. CI inspects each rule's actual image target and runs both host objects without submitting GPU work. This establishes build/link coexistence with one C++ runtime; device execution, interoperation and synchronization require their own runtime checks. diff --git a/docs/rules-qt.md b/docs/11-rules-qt.md similarity index 98% rename from docs/rules-qt.md rename to docs/11-rules-qt.md index 82d8490..f47f50a 100644 --- a/docs/rules-qt.md +++ b/docs/11-rules-qt.md @@ -1,6 +1,6 @@ # `rules-qt` -`mcpp.rules.qt` runs Qt's code generators (`moc`, `uic`, `rcc`) and Linguist tools (`lupdate`, `lrelease`, `lconvert`) as build actions, links the Qt modules and places their runtime beside the program. The rule declares no SDK and pins no version: the project names the Qt it builds with, in `build.mcpp` or in its own `[xlings]` table. Module `mcpp.rules.qt`; engine floor 2026.10.1.3 (mcpp#755) from 0.19.0 (0.27.0 adds `moc_json`, `moc_includes`, `i18n.extensions` and `compile_ex`; QML is [rules-qml](rules-qml.md)), 2026.9.27.1 (mcpp#704, mcpp#715) from 0.16.0, 2026.9.26.2 (mcpp#702) before; from 0.13.0. +`mcpp.rules.qt` runs Qt's code generators (`moc`, `uic`, `rcc`) and Linguist tools (`lupdate`, `lrelease`, `lconvert`) as build actions, links the Qt modules and places their runtime beside the program. The rule declares no SDK and pins no version: the project names the Qt it builds with, in `build.mcpp` or in its own `[xlings]` table. Module `mcpp.rules.qt`; engine floor 2026.10.1.3 (mcpp#755) from 0.19.0 (0.27.0 adds `moc_json`, `moc_includes`, `i18n.extensions` and `compile_ex`; QML is [rules-qml](12-rules-qml.md)), 2026.9.27.1 (mcpp#704, mcpp#715) from 0.16.0, 2026.9.26.2 (mcpp#702) before; from 0.13.0. ## Use diff --git a/docs/rules-qml.md b/docs/12-rules-qml.md similarity index 96% rename from docs/rules-qml.md rename to docs/12-rules-qml.md index 560d9ab..97766c7 100644 --- a/docs/rules-qml.md +++ b/docs/12-rules-qml.md @@ -1,6 +1,6 @@ # `rules-qml` -`mcpp.rules.qml` builds a QML application: for each QML module the project states, it declares the chain Qt's `qt_add_qml_module` runs (`moc`, `qmltyperegistrar`, `qmlcachegen`, `rcc`, `qsb`) as actions, so the module is compiled into the executable and loaded with `loadFromModule`; it places the Qt QML modules the program imports beside it, and writes a `qt.conf` that points Qt at them. It builds on [rules-qt](rules-qt.md), which it implies, and takes its options. Module `mcpp.rules.qml`; engine floor 2026.10.1.3 (the floor of `rules-qt`; the package needs 2026.10.30.1, and the lowest release the fixtures were run on is 2026.10.31.3), and 2026.11.23.1 for a `mcpp pack` that carries the libraries the QML plugins load (mcpp#1011); from 0.27.0. +`mcpp.rules.qml` builds a QML application: for each QML module the project states, it declares the chain Qt's `qt_add_qml_module` runs (`moc`, `qmltyperegistrar`, `qmlcachegen`, `rcc`, `qsb`) as actions, so the module is compiled into the executable and loaded with `loadFromModule`; it places the Qt QML modules the program imports beside it, and writes a `qt.conf` that points Qt at them. It builds on [rules-qt](11-rules-qt.md), which it implies, and takes its options. Module `mcpp.rules.qml`; engine floor 2026.10.1.3 (the floor of `rules-qt`; the package needs 2026.10.30.1, and the lowest release the fixtures were run on is 2026.10.31.3), and 2026.11.23.1 for a `mcpp pack` that carries the libraries the QML plugins load (mcpp#1011); from 0.27.0. ## Use diff --git a/docs/tools-embed.md b/docs/20-tools-embed.md similarity index 97% rename from docs/tools-embed.md rename to docs/20-tools-embed.md index 9f48ef5..fcef29a 100644 --- a/docs/tools-embed.md +++ b/docs/20-tools-embed.md @@ -14,11 +14,11 @@ Module `mcpp.tools.embed`; engine floor: 2026.9.5.4. |---|---|---|---| | `file()` | one | one header | one array, one `_size`, included by name | | `files()` | N | N headers | one `file()` call per input; `options::identifier` is refused, because it names one symbol and there are several | -| `group()` | N | N headers + one generated interface | the same N headers, handed to `mcpp::plugins::surface` so a consumer writes one `import` and names no generated file -- see [What a consumer names](engine-and-rules.md#what-a-consumer-names) | +| `group()` | N | N headers + one generated interface | the same N headers, handed to `mcpp::plugins::surface` so a consumer writes one `import` and names no generated file -- see [What a consumer names](00-engine-and-rules.md#what-a-consumer-names) | | `table()` | N | one header | one array of rows, each carrying its input's key beside its bytes; the consumer iterates or looks a row up by key | -`table()` is for a set the consumer wants to walk rather than name member by -member, where `files()`'s one accessor per input and `group()`'s one function +`table()` is for a set the consumer wants to walk rather than name plugin by +plugin, where `files()`'s one accessor per input and `group()`'s one function per input are both the wrong shape. The motivating case is a shader set: ```cpp diff --git a/docs/tools-island.md b/docs/21-tools-island.md similarity index 99% rename from docs/tools-island.md rename to docs/21-tools-island.md index 41ee485..904be96 100644 --- a/docs/tools-island.md +++ b/docs/21-tools-island.md @@ -13,7 +13,7 @@ Module `mcpp.tools.island`; engine floor: 2026.9.7.1. `mcpp::plugins::surface` generates the whole interface for a **data** payload, because an address and a size are all there is to decide. `mcpp.tools.island` generates what is mechanical about a **code** island -- and -only that. It is a member like `tools-embed` rather than part of the lib root: +only that. It is a plugin like `tools-embed` rather than part of the lib root: nothing in this collection uses it, a project does. The entry points are marked where they are defined, and the signature exists diff --git a/docs/tools-steps.md b/docs/22-tools-steps.md similarity index 85% rename from docs/tools-steps.md rename to docs/22-tools-steps.md index 40bdf13..5dccefe 100644 --- a/docs/tools-steps.md +++ b/docs/22-tools-steps.md @@ -1,12 +1,12 @@ # `tools-steps` -`mcpp.tools.steps` is how a member runs an action whose work is more than one command: the member describes the step as portable operations, and a backend runs it on every host, with no shell. +`mcpp.tools.steps` is how a plugin runs an action whose work is more than one command: the plugin describes the step as portable operations, and a backend runs it on every host, with no shell. ## `tools-steps` Module `mcpp.tools.steps`; engine floor: 2026.10.1.3; implied by `dist-apk` and `dist-apple`. -**Needs and behaviour.** A runner, resolved by the member with `runner_spec()` through `mcpp.plugins.tool`. Until mcpp runs step programs itself (mcpp-community/mcpp#955) the runner is `cmake` 3.31 or newer, which each member that runs steps declares on its own table as `"xim:cmake" = { version = ">=3.31", provision = "on-request" }`, so a plan that runs no step installs nothing. The operations run in order and the first that fails fails the step. `command` writes the program beside the path it is given only when its text changes, and returns the action's argument vector and the inputs it declares, the runner and the program, so a changed program or runner runs the action again and an unchanged one does not. +**Needs and behaviour.** A runner, resolved by the plugin with `runner_spec()` through `mcpp.plugins.tool`. Until mcpp runs step programs itself (mcpp-community/mcpp#955) the runner is `cmake` 3.31 or newer, which each plugin that runs steps declares on its own table as `"xim:cmake" = { version = ">=3.31", provision = "on-request" }`, so a plan that runs no step installs nothing. The operations run in order and the first that fails fails the step. `command` writes the program beside the path it is given only when its text changes, and returns the action's argument vector and the inputs it declares, the runner and the program, so a changed program or runner runs the action again and an unchanged one does not. | operation of `program` | what it does when the step runs | |---|---| @@ -19,4 +19,4 @@ Module `mcpp.tools.steps`; engine floor: 2026.10.1.3; implied by `dist-apk` and Every value is taken verbatim, so a path keeps its spaces, semicolons and backslashes. A list is named by letters, digits and `_`, and starts empty. A pattern's wildcards (`*`, `?`, `[...]`) apply to its last component, and `recursive` matches it in every subdirectory. -The backend is internal. Today it renders the program as a CMake script and the action runs `cmake -P` over it; when the engine runs step programs, `runner_spec` and `command` change and no member does. `cmake_backend::render` is exported so a test can read what a program becomes. +The backend is internal. Today it renders the program as a CMake script and the action runs `cmake -P` over it; when the engine runs step programs, `runner_spec` and `command` change and no plugin does. `cmake_backend::render` is exported so a test can read what a program becomes. diff --git a/docs/dist.md b/docs/30-dist.md similarity index 95% rename from docs/dist.md rename to docs/30-dist.md index 67d3ddf..4b8b160 100644 --- a/docs/dist.md +++ b/docs/30-dist.md @@ -1,12 +1,12 @@ # `dist-appimage`, `dist-deb`, `dist-rpm`, `dist-wix` and `dist-web` -Three `dist-*` members that turn the tree `mcpp pack` stages into an installable form: an AppImage on Linux, an MSI or a Burn bundle on Windows, and a web directory for `wasm32-emscripten`. `dist-apple` and `dist-apk` have pages of their own ([dist-apple.md](dist-apple.md), [dist-apk.md](dist-apk.md)). +Three `dist-*` plugins that turn the tree `mcpp pack` stages into an installable form: an AppImage on Linux, an MSI or a Burn bundle on Windows, and a web directory for `wasm32-emscripten`. `dist-apple` and `dist-apk` have pages of their own ([31-dist-apple.md](31-dist-apple.md), [32-dist-apk.md](32-dist-apk.md)). ## `dist-appimage` Module `mcpp.dist.appimage`; engine floor: 2026.10.1.3 (0.19.0, mcpp#755; 2026.9.11.1 before). Its `xim:appimagetool` is installed when a pack asks for it (`provision = "on-request"`), so an ordinary Linux build downloads none. -**Needs and behaviour.** `xim:appimagetool`, which this feature declares on the `cfg(linux)` axis. Linux only. Turns the tree `mcpp pack` staged into one AppImage: the staged bundle is already an AppDir bar three files, so the member writes an `AppRun`, a `.desktop` entry and an icon into it and invokes one tool -- it never copies or re-lays-out a tree that can be hundreds of megabytes. From 0.11.1 `options::icon` may be an SVG as well as a PNG: the image carries `.svg`, because the desktop entry names the icon without an extension and a reader finds it by the file's, and any other format is refused by name +**Needs and behaviour.** `xim:appimagetool`, which this feature declares on the `cfg(linux)` axis. Linux only. Turns the tree `mcpp pack` staged into one AppImage: the staged bundle is already an AppDir bar three files, so the plugin writes an `AppRun`, a `.desktop` entry and an icon into it and invokes one tool -- it never copies or re-lays-out a tree that can be hundreds of megabytes. From 0.11.1 `options::icon` may be an SVG as well as a PNG: the image carries `.svg`, because the desktop entry names the icon without an extension and a reader finds it by the file's, and any other format is refused by name ## `dist-deb` and `dist-rpm` @@ -24,11 +24,11 @@ Module `mcpp.dist.wix`; engine floor: 2026.10.1.3 (0.19.0, mcpp#755; 2026.9.11.1 ## `dist-web` -Module `mcpp.dist.web`; engine floor: 2026.9.13.1, the release that carries `${mcpp.self}` and `mcpp stage`'s argument shape as an engine contract (`stage --verify content --output `) -- what lets this member's copy run on every host mcpp does, Windows included, in place of the `cp` this member used through 0.8.0. +Module `mcpp.dist.web`; engine floor: 2026.9.13.1, the release that carries `${mcpp.self}` and `mcpp stage`'s argument shape as an engine contract (`stage --verify content --output `) -- what lets this plugin's copy run on every host mcpp does, Windows included, in place of the `cp` this plugin used through 0.8.0. **Needs and behaviour.** nothing beyond mcpp: `wasm32-emscripten` only. Copies `${mcpp.stage_dir}/bin/` -- the `.js` launcher, the implicit `.wasm`, the `.data` when present, and every `mcpp::deploy`'d file, all of which #622 A5 and A4 already stage there -- to `/web/`, dropping the `bin/` prefix a browser has no use for, and writes an `index.html` rendered from a project template or a built-in default that loads the script with a plain `