Repository navigation
Commit 5e1bce9
committed
feat(build): build.mcpp 补全 — 环境契约 + cross 下运行 + 依赖包执行 (0.0.95)
设计: .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)1 parent 7582cd9 commit 5e1bce9
10 files changed
Lines changed: 635 additions & 91 deletions
File tree
- docs
- zh
- src
- build
- modgraph
- toolchain
- tests/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
95 | 126 | | |
96 | 127 | | |
97 | 128 | | |
| |||
113 | 144 | | |
114 | 145 | | |
115 | 146 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
121 | 152 | | |
122 | 153 | | |
123 | 154 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
89 | 116 | | |
90 | 117 | | |
91 | 118 | | |
| |||
106 | 133 | | |
107 | 134 | | |
108 | 135 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
113 | 140 | | |
114 | 141 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments