Commit eb5b125
authored
feat(profile): default build profile = dev (mainstream), --release opt-in (v0.0.76) (#188)
* feat(profile): default build profile = dev (mainstream); --release opt-in; v0.0.76
Resolves #179. mcpp's old default profile was "release" (inherited from its
xmake/xlings lineage), but the dominant convention is the opposite: a bare build
is debug/dev and release is opt-in (Cargo/Meson/CMake/Zig/Bazel/MSBuild). Since
mcpp's surface is Cargo-flavored, flip the global default to "dev" (-O0 -g);
release is opt-in via --release / --profile release.
- prepare.cppm: global default profile release -> dev. Precedence:
--profile/--release/--dev flag > [build].default-profile > "dev".
- cli.cppm/cmd_build.cppm: add --release / --dev shorthands (--release is now the
mainstream opt-in flag).
- manifest.cppm: [build].default-profile (alias: profile) — a project's own
default; its role inverts under the flip to "opt into release" for projects
that ship/run optimized. This is the migration mechanism.
- mcpp.toml: default-profile = "release" — keeps mcpp's self-host CI build and
release.yml at -O2 with ZERO workflow changes (no --release threaded through
release pipelines; mcpp's own CI doesn't slow to -O0).
- cross-build-test.yml: bump xlings cache key v2->v3 (the failing job was a
poisoned ~/.xlings cache from the bootstrap-pin-timing, not code).
Tests: 87_build_default_profile.sh (global dev; --release/--dev; project
default-profile=release; --dev override), 68_profile_passthrough.sh (updated for
the new default). Regression: unit 27/0. Doc: design doc L0.5 (convention table +
decision + migration). mcpp self-build verified 'Finished release [optimized]'.
* ci+docs: revert cross-build cache key to v2 (warm); document dev default in user docs
- cross-build-test.yml: revert xlings cache key v3->v2. The v3 bump forced a COLD
~/.xlings, whose first-time toolchain install 127'd; v2 reuses the warm cache
the passing e2e/ci-linux jobs already use (has 0.0.75 + the toolchain). The
original 'version 0.0.75 not found' poison is moot now 0.0.75 is fully
propagated. The self-host bootstrap is otherwise unrelated to this PR's code
(e2e passed; step 6 bootstrap succeeded).
- docs/05-mcpp-toml.md (+ zh): document the new convention — bare `mcpp build`
uses dev (-O0 -g); release is opt-in via --release/--profile release; --dev
shorthand; [build].default-profile per-project default (and the distribution
note).
* ci(cross-build): xlings 0.4.30 -> 0.4.61 + force index re-sync (fix bootstrap pin resolution)
The cross-build aarch64 job failed at the self-host bootstrap with
'xlings: version <pin> not found for mcpp' — the classic first-PR-after-a-
bootstrap-pin-bump failure: a warm cached ~/.xlings carried a 'fresh-looking'
TTL refresh marker, so 0.4.30's `xlings update` no-op'd and the stale index
never saw the just-bumped pin (0.0.75). (Not this PR's code: e2e passed, the
build+tests pass locally.)
Fix: (1) bump XLINGS_VERSION to 0.4.61 (current; has the index-refresh fixes);
(2) delete the .xlings-index-cache.json TTL markers before `xlings update` so it
actually re-pulls the latest index while the toolchain payloads stay cached
(avoids both the stale-index 'not found' and the cold-cache toolchain 127).
* ci(cross-build): keep xlings 0.4.30, fix via index marker-clear only
0.4.61 resolved the pin (index re-sync worked) but 404'd downloading
xim:mcpp@0.0.75 — it changed the XLINGS_RES download resolution and no longer
matches the xlings-res/mcpp asset layout (0.4.30's resolution works; e2e@0.4.30
downloads 0.0.75 fine). The actual bug was the STALE INDEX (a fresh-looking TTL
marker made 0.4.30's `xlings update` no-op). Revert to 0.4.30 and keep the
.xlings-index-cache.json marker-clear, so update re-pulls the index (gets the
bootstrap pin) while download uses 0.4.30's working path.
* ci(cross-build): xlings 0.4.61 (root cause was broken xlings-res assets, now fixed)
The real root cause of the cross-build bootstrap failures was NOT the xlings
version or the profile code: the xlings-res/mcpp 0.0.75 GitHub release assets
were uploaded in a BROKEN state during a flaky network (asset records present
but blobs missing -> HTTP 404 on download). cross-build uses --mirror GLOBAL
(GitHub), so its 'xlings install mcpp@0.0.75' 404'd; the downstream symptom on
0.4.30 was 'version 0.0.75 not found'. GitCode assets were fine all along.
Re-uploaded all 4 GitHub xlings-res/mcpp 0.0.75 assets clean (verified GET 200 +
correct sizes). With downloads working, use 0.4.61 (current) + keep the
.xlings-index-cache.json marker-clear (forces index re-sync past a stale TTL
marker on warm caches).1 parent 7186ec2 commit eb5b125
12 files changed
Lines changed: 156 additions & 18 deletions
File tree
- .agents/docs
- .github/workflows
- docs
- zh
- src
- build
- cli
- toolchain
- tests/e2e
Lines changed: 37 additions & 0 deletions
| 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 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
95 | 132 | | |
96 | 133 | | |
97 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | | - | |
100 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
394 | 400 | | |
395 | 401 | | |
396 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
558 | | - | |
| 557 | + | |
| 558 | + | |
559 | 559 | | |
560 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
561 | 570 | | |
562 | 571 | | |
563 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
| |||
1118 | 1126 | | |
1119 | 1127 | | |
1120 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
1121 | 1131 | | |
1122 | 1132 | | |
1123 | 1133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments