feat(manifest): 声明式清单能力 — features.sources / generated_files / cfg 条件 sources / per-glob flags#223
Merged
Merged
Conversation
Sunrisepeak
force-pushed
the
feat/declarative-manifest
branch
from
July 17, 2026 12:06
5eb3162 to
7582cd9
Compare
… sources / per-glob flags
设计: .agents/docs/2026-07-17-asm-sources-and-general-build-capabilities-design.md (PR-B)
- G5: mcpp.toml [features] 表形式增 sources 键 → featureSources(与 xpkg
逐字对等);顺修 gate 语义真缺口:drop 只按字符串删 glob,默认 glob 仍罩住
被门控文件——未激活 feature 的 glob 现在变成 `!` 排除,gate 真正生效
(build 模式;test 模式保持 0.0.94 的解耦决策不变,e2e 100/79 回归全过)
- G6: mcpp.toml [generated_files] 节 → generatedFiles(路径越根解析期报错);
根 manifest 补 materialize 调用(此前只对依赖做);自研 TOML 解析器补
"""/''' 多行字符串(TOML 1.0:首换行修剪、行尾反斜杠、闭合粘连引号)
- G1b: ConditionalConfig 增 sources,[target.'cfg(...)'.build] sources 按解析
后 target 求值 APPEND(含 modules.sources 镜像);cfg 合并提炼为
merge_conditional_build 并补依赖侧求值(此前 conditionalConfigs 对依赖
完全不求值,descriptor 写了也静默无效);xpkg 增 target_cfg 键
- G4: [build] flags = [{ glob, cflags/cxxflags/asmflags/defines }] 有序数组
(TOML 表是 sorted map 丢声明序,数组形式才能承载"顺序即语义");xpkg 增
对称 flags 键;scanner 命中附加(声明序 append,后者胜)、零命中 warning、
SourceUnit/CompileUnit 增 packageAsmflags 通道接 PR-A 的 unit_asmflags;
全序列折入 canonical_compile_flags 指纹
- G8b 已定位并修复:用户 cflags/cxxflags 里的相对 -I 按 ninja cwd(outputDir)
解析而非项目根(.cpp/.cppm 同病)——scanner 单点绝对化 + plan 入口单元同步
- 单测:toml/xpkg 对称性契约测试、多行字符串、per-glob 顺序语义、相对 -I;
e2e 106(featureSources 四象限)/107(generated_files)/108(cfg sources,
host-aware)/109(per-glob flags 顺序覆盖+零命中告警);全量 110 过,
3 失败均既有环境性(22/54/62);docs/05 中英同步(含 PR-A 汇编段补中文)
Sunrisepeak
force-pushed
the
feat/declarative-manifest
branch
from
July 17, 2026 12:27
7582cd9 to
f10b2eb
Compare
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.
接替 #221(原 PR 因叠栈 base 分支合入删除被 GitHub 自动关闭,内容已 rebase 到 main,diff 一致)。原描述:
G5 —
[features]表形式增sources键(与 xpkg 描述符逐字对等);顺修 gate 语义真缺口:原 drop 只按字符串删 glob,默认 glob 仍罩住被门控文件——未激活 feature 的 glob 现在变成!排除(build 模式;mcpp test保持 0.0.94 解耦决策,e2e 100/79 回归全过)。G6 —
[generated_files]节(越根路径解析期报错);根 manifest 补 materialize 调用;自研 TOML 解析器补"""/'''多行字符串(TOML 1.0 语义)。G1b —
[target.'cfg(...)'.build] sources条件源 glob,按解析后 target 求值;cfg 合并提炼为merge_conditional_build并补依赖侧求值(此前 conditionalConfigs 对依赖完全不求值);xpkg 增target_cfg键。G4 —
[build] flags = [{ glob, cflags/cxxflags/asmflags/defines }]有序数组(TOML 表是 sorted map 丢声明序,数组才能承载"顺序即语义");xpkg 对称flags键;零命中告警;全序列折入指纹;asmflags 经 packageAsmflags 通道接 #220 的 unit_asmflags。G8b — 已定位修复:用户 cflags/cxxflags 相对
-I按 ninja cwd 解析而非项目根(.cpp/.cppm 同病),scanner 单点绝对化 + plan 入口单元同步。测试:单测 35/35(含 toml↔xpkg 对称性契约测试);e2e 106–109 新增;全量 110 过/3 既有环境失败。后续:feat/build-mcpp-completion(0.0.95 bump)接续。