From 31eb0ff6616815a5b99a0b109e24d920e6845d84 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Fri, 20 Nov 2026 13:21:13 +0900 Subject: [PATCH] check_installed_template.py --mirror: the CN acceptance of a release is a run of the script --- CHANGELOG.md | 1 + docs/mwrap.md | 2 +- docs/zh/mwrap.md | 2 +- tests/mwrap/check_installed_template.py | 4 +++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4201c96b..d69b3715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -230,6 +230,7 @@ ### Chore +- **已安装模板的检查可选镜像。** `tests/mwrap/check_installed_template.py` 新增 `--mirror {GLOBAL,CN}`(默认 GLOBAL);此前固定为 GLOBAL,发布时的 CN 验收只能手工执行。`--published-index --mirror CN` 下 xxhash-m 0.8.3 的封装归档首次即从 gitcode.com 取得。 - **已安装模板的检查:模板写引号键时只允许该弃用警告。** mcpp 2026.11.8.1 之前发布的 mwrap 模板以 `"{{self.name}}"` 写依赖键, 渲染为一个带引号的键;`--strict` 拒绝这一弃用读法,归档又不可改。检查在渲染出引号键时不加 `--strict` 构建,只允许该包的这条 弃用警告,其余警告仍失败;模板的下一版写不带引号的选择器后自动恢复严格构建(onnxruntime-m 1.25.1;opencv-m、ffmpeg-m 的模板同形)。 diff --git a/docs/mwrap.md b/docs/mwrap.md index e994f4b5..0ae8408b 100644 --- a/docs/mwrap.md +++ b/docs/mwrap.md @@ -224,7 +224,7 @@ The pinned client can report duplicate candidates when a workspace mixes full pr Namespace views created by tests/prepare_mwrap_indices.py remain available for isolated single-project consumers. Their descriptors preserve source bytes and SHA256 provenance. A standalone success does not certify a mixed workspace sequence. Views are ignored outputs, not a publication format. -Normal installed consumers are tested independently by tests/mwrap/check_installed_template.py: it copies the complete pkgs/index.toml publication layout into one isolated built-in index, downloads the real checksummed source archive, runs mcpp new and builds/runs the generated manifest without a path substitution. The Git and published pkgs/mwrap directory layout remains identical. +Normal installed consumers are tested independently by tests/mwrap/check_installed_template.py: it copies the complete pkgs/index.toml publication layout into one isolated built-in index, downloads the real checksummed source archive, runs mcpp new and builds/runs the generated manifest without a path substitution. Its home downloads from the GLOBAL mirror unless `--mirror CN` names the other (the CN acceptance of a release). The Git and published pkgs/mwrap directory layout remains identical. Coupled runtime/plugin/build-module consumers may require several candidate namespaces at once. Use `python3 tests/prepare_builtin_index.py --home ` to install the complete unchanged candidate layout as the test home's single built-in index; the member uses an empty `[indices]` table to override legacy workspace redirects. Updater candidate CI uses this mode too. Do not register the same full checkout through multiple project aliases. This is test-home preparation only: no publication staging, path conversion or mcpp engine change is required. diff --git a/docs/zh/mwrap.md b/docs/zh/mwrap.md index e2351212..1a056616 100644 --- a/docs/zh/mwrap.md +++ b/docs/zh/mwrap.md @@ -159,7 +159,7 @@ tests/prepare_mwrap_indices.py 的 namespace 视图仅供隔离的单项目消 不能以独立项目通过证明混合 workspace 顺序可用。视图是不提交、不发布的输出,不是新的发布格式。 正常安装由 tests/mwrap/check_installed_template.py 独立验证:把完整 pkgs/index.toml 发布布局放进独立 MCPP_HOME 的单一内置索引, -下载真实且带校验的源码归档,执行 mcpp new,再原样构建/运行生成清单,不替换为 path 依赖。 +下载真实且带校验的源码归档,执行 mcpp new,再原样构建/运行生成清单,不替换为 path 依赖。该 home 默认从 GLOBAL 镜像下载,`--mirror CN` 改用 CN(发布时的 CN 验收)。 Git 与发布的 pkgs/mwrap 目录始终一致。 运行库、插件、构建模块耦合的测试可能同时依赖多个候选 namespace。使用 `python3 tests/prepare_builtin_index.py --home <独立测试目录>`,将完整且字节不变的候选布局放入该测试 home 的唯一内置索引;成员用空 `[indices]` 覆盖旧 workspace 路由。自动更新候选 CI 同样使用此模式。不要将同一个完整 checkout 注册为多个项目别名。这只是测试 home 准备,不需要发布 staging、路径转换或修改 mcpp 引擎。 diff --git a/tests/mwrap/check_installed_template.py b/tests/mwrap/check_installed_template.py index c06d7b91..a64e8382 100644 --- a/tests/mwrap/check_installed_template.py +++ b/tests/mwrap/check_installed_template.py @@ -43,6 +43,8 @@ def main(): parser.add_argument("--package", default="mcpplibs.mwrap.onnxruntime@1.25.1.1") parser.add_argument("--deploy", action="store_true", help="pack, relocate and run the consumer; verify declared notices") parser.add_argument("--published-index", action="store_true", help="refresh the real public index instead of staging this checkout") + parser.add_argument("--mirror", choices=("GLOBAL", "CN"), default="GLOBAL", + help="the download mirror of the run's home (mcpp self config --mirror)") parser.add_argument("--home", type=Path, help="reuse a dedicated test home across independent installed consumers") parser.add_argument("--run-arg", action="append", default=[]) parser.add_argument("--template", help="a named template of the package; omit for its default") @@ -65,7 +67,7 @@ def main(): # mcpp 2026.10.26.1+ publishes only on request (mcpp docs/04, compile_commands); # the request is the run's, so the template's manifest stays as rendered. env = dict(os.environ, MCPP_HOME=str(home), MCPP_COMPILE_COMMANDS="compile_commands.json") - commands = [[args.mcpp, "self", "config", "--mirror", "GLOBAL"]] + commands = [[args.mcpp, "self", "config", "--mirror", args.mirror]] if args.published_index: commands.append([args.mcpp, "index", "update"]) commands += [[args.mcpp, "new", "--list-templates", args.package],