Commit c8bc6af
committed
feat(build): MCPP_TARGET_OS/ARCH/ENV contract env splits
Cargo CARGO_CFG_TARGET_* parity (design §3.1 item 3): contract_env now
parses the resolved target ONCE through the canonical triple parser
(mcpp.toolchain.triple — already imported for MCPP_HOST) and injects
MCPP_TARGET_OS linux|macos|windows
MCPP_TARGET_ARCH GNU spelling (x86_64, aarch64, ...)
MCPP_TARGET_ENV gnu|musl|msvc, "" when the triple has no env segment
so every build.mcpp (ffmpeg/opencv per-OS selection) stops hand-splitting
MCPP_TARGET. All three are always SET; an escape-hatch triple outside the
canonical vocabulary yields "" for all three (parse failure is not an error
here — MCPP_TARGET still carries the verbatim spelling).
Re-run key: verified — contract_hash hashes the WHOLE (name,value) env
vector, and the new vars ride that same vector, so they fold into ctxHash
with no extra plumbing (a target change already re-ran the program via
MCPP_TARGET; the splits add no new invalidation axis).
Typed lib: mcpp::target_os()/target_arch()/target_env() readers.
e2e 110 extended: asserts the three vars are set, OS/ARCH agree with the
full MCPP_TARGET triple's leading segments, and ENV is set (content may be
empty on macOS). Docs env tables updated (en/zh).
Verified: unit 35/35; e2e 110/143/144/111/125 green.1 parent e8b10a8 commit c8bc6af
4 files changed
Lines changed: 42 additions & 2 deletions
File tree
- docs
- zh
- src/build
- tests/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| |||
383 | 386 | | |
384 | 387 | | |
385 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
386 | 403 | | |
387 | 404 | | |
388 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | | - | |
50 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| |||
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
70 | 87 | | |
71 | 88 | | |
72 | 89 | | |
| |||
0 commit comments