Skip to content

Commit 5088e3f

Browse files
committed
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).
1 parent eb3200a commit 5088e3f

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

.github/workflows/cross-build-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
uses: actions/cache@v4
7575
with:
7676
path: ~/.xlings
77-
key: xlings-${{ runner.os }}-v3-${{ hashFiles('.xlings.json') }}
77+
key: xlings-${{ runner.os }}-v2-${{ hashFiles('.xlings.json') }}
7878
restore-keys: |
79-
xlings-${{ runner.os }}-v3-
79+
xlings-${{ runner.os }}-v2-
8080
8181
- name: Install qemu-user-static
8282
run: |

docs/05-mcpp-toml.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,16 @@ cxxflags = ["-fno-plt"]
411411
ldflags = []
412412
```
413413

414-
- Selection: `mcpp build --profile <name>` (and `mcpp test --profile <name>`, which builds the
415-
code-under-test plus the test binaries under that profile), defaulting to `release`.
414+
- Selection & default: a bare `mcpp build` uses the **`dev`** profile (`-O0 -g`) — the
415+
mainstream convention (cf. Cargo/Meson/CMake/Zig/Bazel). **Release is opt-in:**
416+
`mcpp build --release` (shorthand) or `--profile release`. `--dev` is the explicit
417+
shorthand for dev. Same applies to `mcpp test --profile <name>` (builds the
418+
code-under-test plus the test binaries under that profile).
419+
- **Per-project default**`[build].default-profile = "<name>"` (alias: `profile`) sets
420+
the project's own default when no flag is passed. The typical use is a tool/library
421+
that should build optimized by default: `[build] default-profile = "release"`. Precedence:
422+
`--profile`/`--release`/`--dev` flag **>** `[build].default-profile` **>** global `dev`.
423+
(A project that defaults to dev should pass `--release` when producing a distributable.)
416424
- Built-in profiles: `release` (-O2) / `dev`, `debug` (-O0 -g) / `dist` (-O3 + strip;
417425
**LTO is not enabled by default**). `[profile.<built-in name>]` can override a
418426
built-in definition wholesale.

docs/zh/05-mcpp-toml.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,14 @@ cxxflags = ["-fno-plt"]
389389
ldflags = []
390390
```
391391

392-
- 选择:`mcpp build --profile <name>`(以及 `mcpp test --profile <name>`,会让被测代码与测试二进制
393-
都在该 profile 下编译),默认 `release`
392+
- 选择与默认:裸 `mcpp build`**`dev`** 档(`-O0 -g`)——主流惯例(参照
393+
Cargo/Meson/CMake/Zig/Bazel)。**release 为 opt-in:** `mcpp build --release`(短写)或
394+
`--profile release`;`--dev` 是 dev 的显式短写。`mcpp test --profile <name>` 同理
395+
(被测代码与测试二进制都在该 profile 下编译)。
396+
- **项目级默认** —— `[build].default-profile = "<name>"`(别名 `profile`)设置该项目在不带
397+
flag 时的默认。典型用途是"以发布优化为常态"的工具/库:`[build] default-profile = "release"`
398+
优先级:`--profile`/`--release`/`--dev` flag **>** `[build].default-profile` **>** 全局 `dev`
399+
(默认 dev 的项目在产出可分发物时应显式 `--release`。)
394400
- 内置档案:`release`(-O2)/ `dev``debug`(-O0 -g)/ `dist`(-O3 + strip;
395401
**不默认开 lto**)。`[profile.<内置名>]` 可整体覆盖内置定义。
396402

0 commit comments

Comments
 (0)