feat(profile): default build profile = dev (mainstream), --release opt-in (v0.0.76)#188
Merged
Conversation
…t-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]'.
ddbe325 to
eb3200a
Compare
…ult 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).
…ootstrap 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).
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.
…ts, 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).
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.
Resolves #179. mcpp old default profile was
release(xmake/xlings lineage), but the dominant convention is the opposite — bare build is debug/dev, release is opt-in (Cargo/Meson/CMake/Zig/Bazel/MSBuild). mcpp surface is Cargo-flavored, so flip the global default todev(-O0 -g); release opt-in via--release/--profile release.Precedence:
--profile/--release/--devflag >[build].default-profile> globaldev.[build].default-profile(aliasprofile) is a project default whose role inverts to "opt into release"; mcpp own mcpp.toml sets it to release so self-host CI + release.yml stay -O2 with zero workflow changes (the knob is the migration mechanism). Added--dev/--releaseshorthands. cross-build CI cache key v2->v3 (prior failure was poisoned ~/.xlings cache, not code).Verification: e2e 87 (global dev; flags; project default-profile=release; --dev override) PASS; e2e 68 (updated) PASS; unit 27/0; mcpp self-build "Finished release [optimized]". Doc §L0.5 updated. 0.0.75 -> 0.0.76. (Branch repurposed from the original per-project-knob scope after design discussion.)