Skip to content

Commit 319c808

Browse files
authored
check_installed_template.py --mirror: the CN acceptance of a release is a run of the script (#858)
1 parent 020f22e commit 319c808

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231

232232
### Chore
233233

234+
- **已安装模板的检查可选镜像。** `tests/mwrap/check_installed_template.py` 新增 `--mirror {GLOBAL,CN}`(默认 GLOBAL);此前固定为 GLOBAL,发布时的 CN 验收只能手工执行。`--published-index --mirror CN` 下 xxhash-m 0.8.3 的封装归档首次即从 gitcode.com 取得。
234235
- **已安装模板的检查:模板写引号键时只允许该弃用警告。** mcpp 2026.11.8.1 之前发布的 mwrap 模板以 `"{{self.name}}"` 写依赖键,
235236
渲染为一个带引号的键;`--strict` 拒绝这一弃用读法,归档又不可改。检查在渲染出引号键时不加 `--strict` 构建,只允许该包的这条
236237
弃用警告,其余警告仍失败;模板的下一版写不带引号的选择器后自动恢复严格构建(onnxruntime-m 1.25.1;opencv-m、ffmpeg-m 的模板同形)。

‎docs/mwrap.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ The pinned client can report duplicate candidates when a workspace mixes full pr
224224

225225
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.
226226

227-
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.
227+
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.
228228

229229
Coupled runtime/plugin/build-module consumers may require several candidate namespaces at once. Use `python3 tests/prepare_builtin_index.py --home <isolated-test-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.
230230

‎docs/zh/mwrap.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ tests/prepare_mwrap_indices.py 的 namespace 视图仅供隔离的单项目消
159159
不能以独立项目通过证明混合 workspace 顺序可用。视图是不提交、不发布的输出,不是新的发布格式。
160160

161161
正常安装由 tests/mwrap/check_installed_template.py 独立验证:把完整 pkgs/index.toml 发布布局放进独立 MCPP_HOME 的单一内置索引,
162-
下载真实且带校验的源码归档,执行 mcpp new,再原样构建/运行生成清单,不替换为 path 依赖。
162+
下载真实且带校验的源码归档,执行 mcpp new,再原样构建/运行生成清单,不替换为 path 依赖。该 home 默认从 GLOBAL 镜像下载,`--mirror CN` 改用 CN(发布时的 CN 验收)。
163163
Git 与发布的 pkgs/mwrap 目录始终一致。
164164

165165
运行库、插件、构建模块耦合的测试可能同时依赖多个候选 namespace。使用 `python3 tests/prepare_builtin_index.py --home <独立测试目录>`,将完整且字节不变的候选布局放入该测试 home 的唯一内置索引;成员用空 `[indices]` 覆盖旧 workspace 路由。自动更新候选 CI 同样使用此模式。不要将同一个完整 checkout 注册为多个项目别名。这只是测试 home 准备,不需要发布 staging、路径转换或修改 mcpp 引擎。

‎tests/mwrap/check_installed_template.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def main():
4343
parser.add_argument("--package", default="mcpplibs.mwrap.onnxruntime@1.25.1.1")
4444
parser.add_argument("--deploy", action="store_true", help="pack, relocate and run the consumer; verify declared notices")
4545
parser.add_argument("--published-index", action="store_true", help="refresh the real public index instead of staging this checkout")
46+
parser.add_argument("--mirror", choices=("GLOBAL", "CN"), default="GLOBAL",
47+
help="the download mirror of the run's home (mcpp self config --mirror)")
4648
parser.add_argument("--home", type=Path, help="reuse a dedicated test home across independent installed consumers")
4749
parser.add_argument("--run-arg", action="append", default=[])
4850
parser.add_argument("--template", help="a named template of the package; omit for its default")
@@ -65,7 +67,7 @@ def main():
6567
# mcpp 2026.10.26.1+ publishes only on request (mcpp docs/04, compile_commands);
6668
# the request is the run's, so the template's manifest stays as rendered.
6769
env = dict(os.environ, MCPP_HOME=str(home), MCPP_COMPILE_COMMANDS="compile_commands.json")
68-
commands = [[args.mcpp, "self", "config", "--mirror", "GLOBAL"]]
70+
commands = [[args.mcpp, "self", "config", "--mirror", args.mirror]]
6971
if args.published_index:
7072
commands.append([args.mcpp, "index", "update"])
7173
commands += [[args.mcpp, "new", "--list-templates", args.package],

0 commit comments

Comments
 (0)