feat(build): build.mcpp 补全 — 环境契约 + cross 下运行 + 依赖包执行 (0.0.95)#222
Merged
Conversation
Sunrisepeak
force-pushed
the
feat/declarative-manifest
branch
2 times, most recently
from
July 17, 2026 12:06
5eb3162 to
7582cd9
Compare
Sunrisepeak
force-pushed
the
feat/build-mcpp-completion
branch
from
July 17, 2026 12:07
4b1a62a to
5e1bce9
Compare
Sunrisepeak
force-pushed
the
feat/declarative-manifest
branch
from
July 17, 2026 12:27
7582cd9 to
f10b2eb
Compare
Sunrisepeak
force-pushed
the
feat/build-mcpp-completion
branch
from
July 17, 2026 12:27
5e1bce9 to
4436403
Compare
设计: .agents/docs/2026-07-17-asm-sources-and-general-build-capabilities-design.md (PR-C) G3 环境契约 + cross: - 注入 MCPP_TARGET/HOST/PROFILE/OUT_DIR/MANIFEST_DIR/MCPP_FEATURE_<NAME>/ MCPP_FEATURES(仅子进程,capture_exec env);契约值无条件折入重跑键 (cache 新增 ctx 行,旧缓存缺行自动失效一次) - cross --target 不再跳过:宿主工具链按同一 spec 词汇独立解析(不注入 target 轴),懒解析且仅当存在 build.mcpp;typed `import mcpp;` 模块补 读取端 target()/host()/profile()/out_dir()/manifest_dir()/has_feature() - feature 闭包收敛为单一 feature_closure 实现(原三处重复);profile 名提升 为 effectiveProfile 供契约使用;--features 解析共享 parse_feature_request G2 依赖包 build.mcpp(Cargo build.rs 模型): - 时机:feature 激活后、modgraph 扫描前;作用域照 Cargo:cfg/flags 只进该包 自身 TU(镜像进 privateBuild,与 MCPP_FEATURE_ 宏同款),link 指令补传终链 (BFS 传播已过,追加新尾部) - 产物全部项目本地化:target/.build-mcpp/deps/<pkg>@<ver>/,registry 包根 绝不写入;相对 generated= 以 OUT_DIR 为基;scanner 支持绝对路径字面源条目 - 顺修潜在盲区:generated= 只推 bc.sources,scanner 走 modules.sources 镜像 ——现在双推(此前靠默认 glob 兜住) 版本 bump 0.0.95(mcpp.toml + fingerprint.cppm 同步);docs/07 中英补契约与 依赖节;e2e 110(契约值/缓存/feature+profile 重跑)/111(dep 作用域/终链/ registry 零写入)/112(cross + wine 全环);单测 35/35,e2e 112 过(3 失败 均既有环境性 22/54/62)
Sunrisepeak
force-pushed
the
feat/build-mcpp-completion
branch
from
July 17, 2026 12:46
4436403 to
8e3fd3a
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.
概要
G1–G9 方案的 PR-C(终 PR,叠在 #221 之上;A→B→C 依次合入后自动 retarget)。携带版本 bump 0.0.95——本 PR 合入 = 触发 0.0.95 发布链(release.yml → publish-ecosystem → fresh-install → bootstrap pin)。
内容(G3 + G2)
G3 — 环境契约 + cross 下运行
MCPP_TARGET/MCPP_HOST/MCPP_PROFILE/MCPP_OUT_DIR/MCPP_MANIFEST_DIR/MCPP_FEATURE_<NAME>/MCPP_FEATURES(仅子进程);typedimport mcpp;模块补对应读取端target()/host()/profile()/out_dir()/manifest_dir()/has_feature()ctx行)——换 target/profile/开关 feature 必重跑,不依赖作者写rerun-if-env-changed;旧格式缓存自动失效一次--target不再跳过:宿主工具链按同一 spec 词汇独立解析(不注入 target 轴),懒解析、仅当 build.mcpp 存在;程序在宿主编译运行,看到MCPP_TARGET= 交叉三元组feature_closure;--features解析共享化G2 — 依赖包 build.mcpp(Cargo build.rs 模型)
cfg/flags 只进该包自身 TU(镜像进 privateBuild,与MCPP_FEATURE_宏同款),link-lib/link-search达终链<project>/target/.build-mcpp/deps/<pkg>@<ver>/;registry 共享包根绝不写入(e2e 以 find 快照锁零写入);相对generated=以MCPP_OUT_DIR为基,scanner 支持绝对路径字面源条目generated=此前只推bc.sources而 scanner 走modules.sources镜像(靠默认 glob 兜住)——现在双推测试
--features/--release触发重跑且程序观察到新值#error双向锁)、OUT_DIR 生成源入编译、dep 根目录 find 快照零写入MCPP_TARGET=x86_64-windows-gnu烙进生成源、PE 产物 wine 真跑验证--version== mcpp.toml == 0.0.95合入后
走一次发布链:tag → release.yml 四平台 → publish-ecosystem(镜像 xlings-res 双端 + xim-pkgindex bump PR)→ fresh-install 验证 → workspace bootstrap pin bump;随后 mcpp-index 侧解锁项见设计文档 §4.4。