Skip to content

feat(model): a version entry's packaging revision (0.0.58) - #42

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/recipe-revision
Sep 27, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
feat/recipe-revision

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

xpkg V2 的版本条目增加 revision:一个非负整数,计数同一上游版本下配方所安装内容的变化(openxlings/xlings#620)。

语义

  • 条目未写 revision,或其值不是非负整数时,读作 0。
  • 加载器从版本条目表本身读取该字段,因此单一 url、镜像表、按架构的表、模板与 res 各形态读法一致;ref 别名条目本身不带修订号。
  • resolve_resource() 通过 ResolvedResource::revision 报告提供载荷的条目的修订号:对 ref 别名,取别名最终指向的条目。客户端经库自身的解析接口即可得到将要安装的修订号,无需自行遍历别名。

使用该字段的判断(已记录的修订号与配方不同即视为未安装)属于客户端,契约写在 xpkg V2 规范中(openxlings/xim-pkgindex 同步 PR)。

兼容性

两个方向均兼容:0.0.57 的客户端忽略该键;配方可以在任何客户端读取它之前写入。

测试

  • LoaderTest.V2_Revision_ParsedPerVersionEntry:各资源形态、字符串与负数、别名条目。
  • LoaderTest.V2_Revision_ResolvedThroughRef:直接版本、经 ref 解析的版本、未写修订号的版本。

版本:0.0.58。

CI

CI 改用 mcpp 2026.9.26.2(.xlings.json 与沙箱缓存的 key)。索引现在要求 mcpp 不低于 2026.9.18.3,原先固定的 2026.8.4.1 已无法解析本包的依赖,main 上的 CI 同样会因此失败。

A version entry may state `revision`, a non-negative integer that counts
changes to what the recipe installs under an unchanged upstream version.
An entry that states none, and an entry whose value is not a non-negative
integer, reads as revision 0. The loader reads the field from the entry
table itself, so every resource shape (single url, mirror map, per-arch
map, template, res) carries it the same way; a `ref` alias carries none.

This is the one addition the reference implementation needs for
openxlings/xlings#620. The decision that uses the field -- a recorded
revision that differs from the recipe's means not installed -- belongs to
the client, and the contract is stated in the xpkg V2 specification. The
V2 compatibility rule makes the addition safe in both directions: a client
built on 0.0.57 ignores the key, and a recipe may state it before any
client reads it.

resolve_resource() reports the field as ResolvedResource::revision, taken
from the entry that supplies the payload: for a `ref` alias, the entry the
alias resolves to. A client that resolves through the library's own
resolver therefore learns the revision it will install without walking
aliases itself.

CI builds with mcpp 2026.9.26.2 (.xlings.json and the sandbox cache key).
The index now requires mcpp 2026.9.18.3 or later, so the previous pin,
2026.8.4.1, can no longer resolve this package's dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sunrisepeak
Sunrisepeak merged commit bb777e9 into main Sep 27, 2026
1 check passed
Sunrisepeak added a commit to mcpplibs/mcpp-index that referenced this pull request Sep 27, 2026
libxpkg 0.0.58 (openxlings/libxpkg#42): a version entry's packaging revision, read by xlings 2026.9.27.1. GitHub tag archive and GitCode mirror mcpp-res/xpkg are byte-identical (sha256 61621a21...894c).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants