fix: xpkg parse Form A payload ships the already-computed versions - #490
Open
wellwei wants to merge 1 commit into
Open
fix: xpkg parse Form A payload ships the already-computed versions#490wellwei wants to merge 1 commit into
wellwei wants to merge 1 commit into
Conversation
Form A(描述符无内联 `mcpp = {}` 表,构建信息来自拉取源码自己的
mcpp.toml)在进入分支前就已经算好 linux/macosx/windows 三平台版本表,
但 --json 只吐 {"namespace","name","form":"A"},把 versions 扔掉了;
文本模式同样不打印 versions 行。消费者(vscode 补全层)因此把索引里
18/81 的 Form A 描述符当成无版本包(mcpp-vscode#8,mcpp-community#379 评论有核对)。
两种拼写(--json / --format json)共用同一 payload,信封只是包裹,
所以修的是 payload 本身:JSON 加 "versions" 键(Form B 同形状),
文本加与 Form B 相同的 versions 行。渲染收敛为 versions_json /
joined_versions 两个辅助函数,两个分支单一来源。
xpm 表全平台缺席仍在分支前报错退出,所以 Form A 的 versions 至少一个
平台非空;个别平台为空时文本跳过该行、JSON 保持空数组(Form B 惯例)。
docs/11-machine-output.md(en+zh)补记两种形态的 data 形状。
测试:e2e 93 新增第 5 节 —— Absent 形态描述符断言文本三行 versions、
--json 的 versions 形状、--format json 信封内 data.versions。先在未
修复二进制(2026.8.21.3)上确认失败(exit=1),新二进制通过;单测
92 passed 0 failed;e2e 202 契约脚本通过。
Closes mcpp-community#489
Refs mcpp-community/mcpp-vscode#8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcpp xpkg parse的 Form A 分支(描述符无内联mcpp = {}表)此前把分支前已算好的三平台xpm版本表直接丢弃:--json只输出{"namespace","name","form":"A"},文本模式无 versions 行。--json/--format json信封,同一 payload)都携带与 Form B 同形状的versions对象;文本输出与 Form B 相同的 versions 行。渲染收敛为versions_json/joined_versions辅助函数,两个分支单一来源。docs/11-machine-output.md(en+zh)补记两种形态的 data 形状;按「只增字段」纪律,form键保留,新增versions为向后兼容的增量。背景:mcpplibs 索引 81 个描述符中 18 个走 Form A 路径,此前被机器输出当作无版本包(mcpp-vscode#8 补全层的阻塞项之一,#379 评论有核对记录)。
Closes #489
Refs mcpp-community/mcpp-vscode#8
Test plan
--format json信封内data.versions断言)mcpp build自举构建通过(release, 62.46s)<fresh> test:92 passed, 0 failed(2 skipped 为既有的平台条件跳过)202_machine_output_contract.sh通过(stdout 纪律 + rc=2 契约不受影响)bash .github/tools/check_docs_style.sh通过