feat(manifest): 声明式清单能力 — features.sources / generated_files / cfg 条件 sources / per-glob flags#221
Closed
Sunrisepeak wants to merge 1 commit into
Closed
feat(manifest): 声明式清单能力 — features.sources / generated_files / cfg 条件 sources / per-glob flags#221Sunrisepeak wants to merge 1 commit into
Sunrisepeak wants to merge 1 commit into
Conversation
… 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 汇编段补中文)
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.
概要
G1–G9 方案的 PR-B(叠在 #220 / feat/asm-sources 之上;#220 合入后本 PR 自动 retarget 到 main)。不 bump 版本;版本与发布随 PR-C。
内容(G5 + G6 + G1b + G4 + G8b)
G5 —
[features]表形式增sources键(与 xpkg 描述符逐字对等,补齐两语法不对称)src/**仍罩住被门控的文件 → gate 形同虚设。现在未激活 feature 的 glob 变成!排除,gate 真正生效(build 模式;mcpp test保持 0.0.94 的解耦决策,e2e 100/79 回归全过)G6 —
[generated_files]节(路径 = 内容,越根路径解析期报错)"""/'''多行字符串(TOML 1.0 语义:首换行修剪、行尾反斜杠、闭合粘连引号)——整个 manifest 生态受益G1b —
[target.'cfg(...)'.build] sources(条件源 glob,x86.asm跨架构可用的前提)merge_conditional_build并补依赖侧求值——此前conditionalConfigs对依赖完全不求值,描述符写了也静默无效target_cfg键(ffmpeg/x264 按 arch 选汇编目录的表达)G4 —
[build] flags = [{ glob, ... }]per-glob 旗标flags键asmflags经新 packageAsmflags 通道接 PR-A 的unit_asmflagsG8b — 已定位并修复:用户 cflags/cxxflags 里的相对
-I按 ninja cwd(outputDir)解析而非项目根(实测.cpp/.cppm同病,非 .cppm 独有)。修 = scanner 单点绝对化(包根已知)+ plan 入口单元同步。测试
后续
PR-C(build.mcpp 环境契约 + cross 下运行 + 依赖包执行,bump 0.0.95 并触发发布)。