Skip to content

Commit fe72481

Browse files
committed
A row the platform column misses is an index miss, refreshed as a dependency's is (mcpp#967)
The platform column was read from the local copy of the index alone, so a row the index listed after that copy was taken was refused as an unknown target until `mcpp index update`. A miss for a row that is refused without an answer (one the engine does not know, or a planned one) now goes through decide_for_miss and apply -- `--offline`, `[index] auto_refresh`, the debounce, one sync per command -- and the column is scanned again after a refresh, the scan cache dropped. Decided once per row per process; the unknown-target and planned refusals say whether the index was refreshed, and why not. A row the table serves without a platform does not refresh. The column scan is split into helpers (one descriptor's claims, the roots, the cached scan), which also brings its loops to two levels. SPEC-013 v1.14 section 14 item 6, usage chapters 05 and 35 in both languages, e2e index::refresh/967; openkal::platforms/1106 leg D runs offline, where a refresh would bring the shared index whose openkal-platform lists the planned row.
1 parent 42b7f09 commit fe72481

11 files changed

Lines changed: 255 additions & 101 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@
8282

8383
### Fixed
8484

85+
- A target row the package index's platform column listed after the local copy of the index
86+
was taken was refused as an unknown target until `mcpp index update`: the miss did not reach
87+
the refresh policy. A row the local copy does not list, and that is refused without it (one
88+
the engine does not know, or a `planned` one), now refreshes the index as a dependency's miss
89+
does (`--offline`, `[index] auto_refresh`, the debounce, one sync per command) and is looked
90+
up again; the refusal says whether the index was refreshed, and why not (mcpp#967).
8591
- On a Windows host the `std` module of a base package that supplies libstdc++ (the Hurd and
8692
Haiku rows of mcpp-platforms) was precompiled with neither the base's `include_dirs` nor
8793
`-nostdinc++`, and stopped at `'bits/stdc++.h' file not found`: the words that close the

‎docs/05-dependencies.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ Controls, in order of precedence:
464464
|---|---|
465465
| `--offline` (any command) | Never touch the network — no index refresh, no downloads, no toolchain auto-install, no `git ls-remote`/`clone`. Anything already installed still builds, including git deps whose commit is in `mcpp.lock` and whose clone is cached |
466466
| `MCPP_OFFLINE=1` | Same, for a whole shell session or CI job |
467-
| `[index] auto_refresh = false` in `~/.mcpp/config.toml` | Never refresh an index implicitly: not on a dependency miss, not before installing a package the local index lacks, and not for the first sync of a project's custom index (that build stops and names `mcpp index update`). Downloads still work |
467+
| `[index] auto_refresh = false` in `~/.mcpp/config.toml` | Never refresh an index implicitly: not on a dependency miss, not on a target row the index's platform column does not list (2026.11.19.1+), not before installing a package the local index lacks, and not for the first sync of a project's custom index (that build stops and names `mcpp index update`). Downloads still work |
468468

469469
`MCPP_NO_AUTO_INSTALL=1` remains accepted as the older, narrower spelling of
470470
`--offline` (it gates only toolchain auto-install).

‎docs/35-platforms.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@ project's own `[target.<selector>] platform` still comes first, and so do the
248248
project's own `[indices]` before the shared ones. The list is generated from the
249249
platform's manifest by the index's tools; engines before 2026.11.17.1 ignore it.
250250

251+
A row the local copy of the index does not list, and that would otherwise be
252+
refused (a row the engine does not know, or a `planned` one), is an index miss
253+
like a dependency's *(2026.11.19.1+, mcpp#967)*: the index is refreshed once
254+
under the same controls (`--offline`, `[index] auto_refresh`, the debounce, at
255+
most one sync per command, [05](05-dependencies.md)) and the column is read
256+
again. A refusal that follows says whether the index was refreshed, and why not.
257+
Before, a row listed after the local copy was taken was refused as an unknown
258+
target until `mcpp index update`.
259+
251260
## Writing a platform package
252261

253262
A platform package is a package with a `[platform]` section. openkal-platform,

‎docs/specs/platforms.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
|---|---|
55
| 规范编号 | SPEC-013 |
66
| 标题 | 平台:一类目标的可复用配置,其声明、选择、合并、对依赖图的补全、链接与封装、运行器与载体 |
7-
| 状态 | 评审中 v1.13 |
7+
| 状态 | 评审中 v1.14 |
88
| 版本 | 1.13 |
99
| 最后修改 | 2026-11-19 |
1010
| 对应实现 | mcpp >= 2026.10.27.1;§10 的执行宿主与 §11 的载体架构 mcpp >= 2026.10.29.1;`runner.hosts`、载体列表、`descriptor_keys` 与 `universal` 的弃用 mcpp >= 2026.10.30.1;§7.5 版本组参与解析、§14 平台系列与 §15.1 系列的锁 mcpp >= 2026.11.7.1;§14 内置平台为确切版本与提示 mcpp >= 2026.11.7.2;v1.7 条款 mcpp >= 2026.11.10.1;v1.10 条款 mcpp >= 2026.11.16.1;v1.11 条款(§14 索引的平台列) mcpp >= 2026.11.17.1;逐条标注 |
@@ -493,6 +493,11 @@ package = {
493493
一个平台包认领。列入的行:`[platform] targets`、`[[platform.define]] triple`、`[[platform.provider]] serves`,
494494
其中的模式(`*-linux-musl`)代表它在平台自己的行与引擎内置表的行中匹配到的行;`[platform.hosted] targets`
495495
中只列入引擎不认识或登记为 `planned` 的行,所以索引从不为宿主自己的行指定平台。早于本版本的引擎不读这个字段。
496+
6. 本地的索引副本没有认领一行、而没有答案时该行被拒绝(引擎不认识的行、`planned` 行),这是一次索引未命中:
497+
引擎**必须**按依赖未命中的同一策略决定是否刷新(`--offline`、`[index] auto_refresh`、去抖、每次运行至多一次),
498+
刷新后**必须**重新扫描,扫描的缓存随之作废;仍未命中时拒绝,消息写出索引是否已刷新及未刷新的原因。内置表持有、
499+
没有平台也能构建的行(如以自己的 sysroot 构建的 `x86_64-freebsd`)未命中时不刷新。**已实现**(mcpp >= 2026.11.19.1,
500+
mcpp#967;此前在本地副本取得之后才列入索引的行被拒绝为未知目标,直到 `mcpp index update`)。
496501

497502
每条命令至多扫描一次索引的条目,且只在内置表没有答案时扫描(约 400 个条目时整个拒绝过程 0.05 s)。**已实现**
498503

@@ -636,3 +641,4 @@ openkal-platform 的 `targets` 因此不含 WebAssembly。Web 经 `wasm32-emscri
636641
| 1.12 | 2026-11-17 | mcpp 2026.11.17.1:§3.1 尚无行定义的三元组按字面成分求值选择器(e2e 1040);§10 运行器的陈述与许可分属两层,覆盖层的 `runner = true`/`false`(e2e 1092)。 |
637642
| 1.12 | 2026-11-17 | mcpp 2026.11.17.2(设计 2026-11-17 §5):§3.1 平台选定之前可用的谓词,以层选择平台时的警告;§10 `hosts` 参与运行器的采用;§14 目标表的平台列为 0.29.1 |
638643
| 1.13 | 2026-11-19 | mcpp 2026.11.19.1(mcpp#956):§7.5 版本组的约束进入合并,结果与请求到达的先后无关;拒绝列出每一个请求者。 |
644+
| 1.14 | 2026-11-19 | mcpp 2026.11.19.1(mcpp#967):§14 索引的平台列第 6 条,一行的未命中按依赖未命中的策略刷新索引并重新扫描,拒绝写出是否已刷新。 |

‎docs/zh/05-dependencies.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ mcpp index status # local state: state, age and revision
389389
|---|---|
390390
| `--offline`(任意命令) | 完全不碰网络 —— 不刷索引、不下载、不自动安装工具链,也不发出 `git ls-remote`/`clone`。已安装的东西照常构建,包括 commit 已在 `mcpp.lock`、克隆已在缓存里的 git 依赖 |
391391
| `MCPP_OFFLINE=1` | 同上,作用于整个 shell 会话或一次 CI job |
392-
| `~/.mcpp/config.toml` 中的 `[index] auto_refresh = false` | 永不隐式刷新索引:依赖未命中时不刷新,安装本地索引没有的包之前不刷新,工程自定义索引的首次同步也不做(该次构建停止,并指出 `mcpp index update`)。下载仍然可用 |
392+
| `~/.mcpp/config.toml` 中的 `[index] auto_refresh = false` | 永不隐式刷新索引:依赖未命中时不刷新,索引的平台列未列出目标行时不刷新(2026.11.19.1 起),安装本地索引没有的包之前不刷新,工程自定义索引的首次同步也不做(该次构建停止,并指出 `mcpp index update`)。下载仍然可用 |
393393

394394
`MCPP_NO_AUTO_INSTALL=1` 作为 `--offline` 更早、更窄的拼法,仍然被接受
395395
(它只约束工具链的自动安装)。

‎docs/zh/35-platforms.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ package = {
201201
版本的选择、锁定与更新同上,报告的来源为 `index`。工程自己的 `[target.<selector>] platform` 仍然在前,工程自己的
202202
`[indices]` 先于共享的索引。这份列表由索引的工具从平台的清单生成;2026.11.17.1 之前的引擎忽略它。
203203

204+
本地索引副本没有列出、否则会被拒绝的行(引擎不认识的行,或 `planned` 行),与依赖一样是一次索引未命中
205+
*(2026.11.19.1 起,mcpp#967)*:按同样的控制(`--offline`、`[index] auto_refresh`、去抖、每条命令至多一次同步,
206+
见 [05](05-dependencies.md))刷新一次索引,再读平台列。随后的拒绝写出索引是否已刷新及未刷新的原因。此前,在本地
207+
副本取得之后才列入的行被拒绝为未知目标,直到 `mcpp index update`。
208+
204209
## 编写平台包
205210

206211
平台包是带 `[platform]` 段的包。openkal-platform 的节选:

0 commit comments

Comments
 (0)