Skip to content

feat(profile): default build profile = dev (mainstream), --release opt-in (v0.0.76)#188

Merged
Sunrisepeak merged 5 commits into
mainfrom
feat/build-default-profile
Jun 29, 2026
Merged

feat(profile): default build profile = dev (mainstream), --release opt-in (v0.0.76)#188
Sunrisepeak merged 5 commits into
mainfrom
feat/build-default-profile

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Jun 29, 2026

Copy link
Copy Markdown
Member

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 to dev (-O0 -g); release opt-in via --release / --profile release.

Precedence: --profile/--release/--dev flag > [build].default-profile > global dev. [build].default-profile (alias profile) 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/--release shorthands. 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.)

@Sunrisepeak Sunrisepeak linked an issue Jun 29, 2026 that may be closed by this pull request
…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]'.
@Sunrisepeak Sunrisepeak force-pushed the feat/build-default-profile branch from ddbe325 to eb3200a Compare June 29, 2026 16:45
@Sunrisepeak Sunrisepeak changed the title feat(manifest): [build].profile sets the project default build profile (v0.0.76) feat(profile): default build profile = dev (mainstream), --release opt-in (v0.0.76) Jun 29, 2026
…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).
@Sunrisepeak Sunrisepeak merged commit eb5b125 into main Jun 29, 2026
5 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/build-default-profile branch June 29, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否把build --profile 默认值改为dev?

1 participant