Skip to content

Commit 025b6f4

Browse files
a tree that runs nowhere is refused: with runner hosts unstated read as every system, an empty runs_on is the platform's statement
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent fcadaba commit 025b6f4

4 files changed

Lines changed: 15 additions & 19 deletions

File tree

‎docs/10-pack-and-release.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,9 @@ has the runner (the legs' architectures × the platform's `runner.hosts`).
844844
Not covered macos-x86_64 (no runner row: this mcpp builds no program for x86_64-macos)
845845
```
846846

847-
A tree that runs nowhere — no runner carried and none the platform names — is
848-
refused; over a platform that states no `runner.hosts` this is a note instead.
847+
A platform that states no `runner.hosts` is read as every system of each
848+
architecture. A tree that runs nowhere — no runner carried and none of the
849+
platform's runner pairs of its architectures — is refused.
849850

850851
Packages built on several machines are joined with
851852
`mcpp pack --merge a.zip --merge b.zip` (also `--merge a.zip,b.zip`). The inputs

‎docs/specs/packaging.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ openkal 目标上 `static` 为一个 `.oke`、无 `.okso`,`shared` 为 `.oke`
115115
| 目标集合展开为空,或候选选到不同平台 | 拒绝(SPEC-015 §1) |
116116
| `--pkg-format` 列表含 `dir` 或 `single-file`;列表与命名一个文件的 `-o`;`mcpp run --pkg-format` 的列表 | 拒绝(§5.4) |
117117
| `self-contained` 的树而格式只有 `okb` | 拒绝:okb v1 只含映像,运行器会被丢弃;出路 `--pkg-format tar,okb` |
118-
| 树的 `runs_on` 为空(`self` 与 `with` 都空,§4.7) | 拒绝;平台未声明 `runner.hosts` 而模式不是 `self-contained` 时写出提示,不拒绝 |
118+
| 树的 `runs_on` 为空(`self` 与 `with` 都空,§4.7) | 拒绝 |
119119
| `--merge` 的输入缺少 `mcpp-package.json`,或名字、版本、平台、链接、模式不同 | 拒绝,写出不一致的字段 |
120120
| `--merge` 的两个输入在同一路径上有摘要不同的文件 | 拒绝,写出该路径、两个摘要与两个输入 |
121121
| 库目标(`lib`、`shared`)与提供者格式 | 拒绝:库包没有单一暂存树 |
@@ -291,7 +291,8 @@ clang 在 `__FILE__` 中保留它拼接包含路径时用的 `\`,其映像不同
291291
| 单文件 | 每个文件各自的 `<os>-<arch>` | 空 |
292292
| WebAssembly、Android、iOS、裸机 | 空 | 空 |
293293

294-
`runner.host = "any"` 时 `hosts` 列出运行器程序存在的组合,覆盖与腿的架构无关。树中没有 Windows 启动器时 `runs_on`
294+
`runner.host = "any"` 时 `hosts` 列出运行器程序存在的组合,覆盖与腿的架构无关;平台未声明 `hosts` 时按每个系统 ×
295+
腿的每个架构读取(未知不等于无处)。树中没有 Windows 启动器时 `runs_on`
295296
不含 Windows 的组合。`self` 与 `with` 都为空的树被拒绝(§1.5)。`Packed` 之后写出 `Runs on <组合>; with <runner>:
296297
<组合>`;所请求而未覆盖的组合各写一行 `Not covered <组合> (<原因>)`(本 mcpp 不构建该行、没有 Windows 启动器、
297298
不在平台的 `runner.hosts` 中)。`mcpp emit xpkg`、`--merge`、`mcpp.pack` 的 `runsOn` 读这里,不再计算。

‎docs/zh/10-pack-and-release.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,8 @@ Cygwin 的 shell 交给 `bin/<name>.exe`,以该目录中的映像与自身的
727727
Not covered macos-x86_64 (no runner row: this mcpp builds no program for x86_64-macos)
728728
```
729729

730-
在任何地方都不能运行的树(不携带运行器,平台也未写出运行器存在的组合)被拒绝;平台未声明 `runner.hosts` 时改为
731-
一条提示。
730+
平台未声明 `runner.hosts` 时按每个系统 × 每个架构读取。在任何地方都不能运行的树(不携带运行器,平台的运行器组合
731+
也不含它的架构)被拒绝。
732732

733733
多台机器打出的包以 `mcpp pack --merge a.zip --merge b.zip`(也可 `--merge a.zip,b.zip`)合并。输入是本命令写出的
734734
包目录或归档(`.zip`、`.tar`、`.tar.gz`、`.tgz`、`.tar.zst`、`.tar.xz`),不进行任何构建。腿、系统与 `runs_on`

‎src/pack/pack.cppm‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,21 +1684,15 @@ std::expected<void, Error> finalize_tree(const Plan& plan) {
16841684
}
16851685
// A TREE THAT RUNS NOWHERE IS NOT A PACKAGE (design 2026-10-29 §4.4): it
16861686
// carries no runner a system can start, and the platform names no
1687-
// system its runner exists for. A platform that states no
1688-
// `runner.hosts` says nothing either way, which is said, not refused.
1687+
// system of its legs' architectures its runner exists for.
16891688
if (plan.opts.tree && pkg.runsOnSelf.empty() && pkg.runsOnWith.empty()) {
16901689
auto const& runner = plan.platform.fields.runner;
1691-
if (runner.hostsSet || plan.opts.mode == Mode::BundleAll)
1692-
return std::unexpected(Error{std::format(
1693-
"{} runs on no system: it carries no runner built here{}, and {} names no "
1694-
"system its runner `{}` exists for (runner.hosts).\n use: --mode self-contained "
1695-
"--systems <a system this mcpp builds for>",
1696-
plan.binaryName, plan.opts.mode == Mode::BundleAll ? "" : " (--mode vendored)",
1697-
plan.platform.display(), runner.cmd.empty() ? std::string() : runner.cmd.front())});
1698-
mcpp::ui::note(std::format(
1699-
"{} states no runner.hosts, so the package names no system it runs on "
1700-
"(mcpp-package.json runs_on is empty); an index entry cannot be written for it",
1701-
plan.platform.display()));
1690+
return std::unexpected(Error{std::format(
1691+
"{} runs on no system: it carries no runner built here{}, and {} names no system of "
1692+
"its architectures its runner `{}` exists for (runner.hosts).\n use: --mode "
1693+
"self-contained --systems <a system this mcpp builds for>",
1694+
plan.binaryName, plan.opts.mode == Mode::BundleAll ? "" : " (--mode vendored)",
1695+
plan.platform.display(), runner.cmd.empty() ? std::string() : runner.cmd.front())});
17021696
}
17031697
// What `[pack] include` named is the package's resource, whatever its name.
17041698
for (auto const& rel : *included) stated.role[rel] = "resource";

0 commit comments

Comments
 (0)