Skip to content

Commit d2efefa

Browse files
committed
ci: 打开全局包缓存,pin 到 2026.8.5.3
全量运行(改 validate.yml 会强制全量,这是刻意的)跑不完: linux 2h30m22s -> 跑满 150 分钟 timeout 被取消 windows 2h20m08s -> opencv-module / opencv-module-dnn 链接失败 macos 1h26m45s -> 通过 两个原因,各有各的修法。 ── 1. 每个 member 都从零重编所有依赖 ──────────────────────────────────────── 这一步一直设着 `MCPP_BUILD_CACHE: local`,把**全局包构建缓存**关掉了。它是 mcpp#344 的临时规避:对象路径消歧按「整个 build dir 的 basename 冲突」触发, 即取决于**消费方**拉了哪些包,而当时的缓存键只覆盖依赖自身,于是一个条目能装下 两种布局,ninja 在图加载阶段就死。 **#344 已在 2026.8.3.4 修掉**(per-package Merkle 键,覆盖随消费方变化的布局), 理由不存在了。而留着它是有代价的:59 个 member 大量共享 abseil / protobuf / opencv,关掉缓存意味着同一份源码被反复编译 —— opencv 系每个 10~20 分钟。 打开之后,同一个 (包, 版本, features, 工具链) 每次运行只建一次,后面的 member 直接命中。 > 注:CI 的 actions/cache 只缓存 `~/.mcpp/registry`(工具链与包源码),不缓存 > `~/.mcpp/build-cache`。所以本次拿到的是**同一次运行内**的复用 —— 而那正是 > 超时的来源。跨运行缓存是另一件事:GitHub 每仓库 10GB 上限,opencv 的产物有 > 撑爆并引发频繁驱逐的风险,先用数据说话再决定。 ── 2. windows 上 opencv 链接失败 ─────────────────────────────────────────── fatal error LNK1170: line in command file contains 135135 or more characters link.exe 的响应文件**单行**上限 128 KiB,而 mcpp 此前把所有对象写在一行。 mcpp 2026.8.5.3 改成按行分隔(`$in_newline`),上限不再随对象数增长。 编译完 795s / 1166s 之后才在最后一步倒下,这个代价尤其刺眼。 因此 pin 抬到 **2026.8.5.3**。`index.toml` 的 `min_mcpp` 不动 —— 这两条都不改变 任何描述符是否可被旧客户端读取。
1 parent e17da76 commit d2efefa

1 file changed

Lines changed: 42 additions & 31 deletions

File tree

.github/workflows/validate.yml

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@ on:
1414
workflow_dispatch:
1515

1616
env:
17-
# 2026.8.5.1 is a FLOOR, not a routine bump: `tools = [...]` — how a consumer
18-
# asks for a dependency's `kind = "bin"` target, which the new
19-
# tests/examples/protobuf-protoc member is built on — does not parse before
20-
# it ("tools must be a string, inline dep table, or nested table"). Note this
21-
# does NOT move index.toml's min_mcpp: exposing compat.protobuf's `protoc`
17+
# 2026.8.5.3 carries two things this workflow depends on:
18+
# .5.1 `tools = [...]` — how a consumer asks for a dependency's
19+
# `kind = "bin"` target, which tests/examples/protobuf-protoc is built
20+
# on. Before it: "tools must be a string, inline dep table, or nested
21+
# table".
22+
# .5.3 link response files separate objects by NEWLINES. link.exe caps a
23+
# response-file LINE at 128 KiB, and opencv-module / opencv-module-dnn
24+
# went past it on windows — after 795s / 1166s of compiling:
25+
# fatal error LNK1170: line in command file contains 135135 or
26+
# more characters
27+
# Together with re-enabling the global package cache below, this is
28+
# what makes a green FULL run possible again: .5.3 removes the
29+
# windows link failure, the cache removes the 150-minute timeout.
30+
#
31+
# Neither of them moves index.toml's min_mcpp: exposing compat.protobuf's `protoc`
2232
# target is additive, and 2026.8.3.3 still parses that descriptor with an
2333
# empty unknown_keys. The floor an index publishes decides whether older
2434
# clients keep working at all (mcpp#349), so it moves only when a descriptor
@@ -97,7 +107,7 @@ env:
97107
# 0.0.94 fixed feature-gated `sources` under `mcpp test` (mcpp#218); 0.0.91
98108
# added standard = "c++fly" to the resolver grammar, so c++fly descriptors
99109
# get the lint WARN below, not a hard grammar-parse rejection.
100-
MCPP_VERSION: "2026.8.5.1"
110+
MCPP_VERSION: "2026.8.5.3"
101111

102112
jobs:
103113
lint:
@@ -262,21 +272,21 @@ jobs:
262272
ext: tar.gz
263273
mcpp: bin/mcpp
264274
xlings: registry/bin/xlings
265-
mcpp_version: "2026.8.5.1" # keep in sync with env.MCPP_VERSION
275+
mcpp_version: "2026.8.5.3" # keep in sync with env.MCPP_VERSION
266276
- platform: macos
267277
os: macos-15
268278
suffix: macosx-arm64
269279
ext: tar.gz
270280
mcpp: bin/mcpp
271281
xlings: registry/bin/xlings
272-
mcpp_version: "2026.8.5.1" # keep in sync with env.MCPP_VERSION
282+
mcpp_version: "2026.8.5.3" # keep in sync with env.MCPP_VERSION
273283
- platform: windows
274284
os: windows-latest
275285
suffix: windows-x86_64
276286
ext: zip
277287
mcpp: bin/mcpp.exe
278288
xlings: registry/bin/xlings.exe
279-
mcpp_version: "2026.8.5.1" # keep in sync with env.MCPP_VERSION
289+
mcpp_version: "2026.8.5.3" # keep in sync with env.MCPP_VERSION
280290
env:
281291
MCPP_EFFECTIVE: ${{ matrix.mcpp_version }}
282292
steps:
@@ -446,29 +456,30 @@ jobs:
446456
shell: bash
447457
env:
448458
MCPP_INDEX_MIRROR: GLOBAL
449-
# Dependencies build inside each member's own target/ instead of
450-
# through the global package build cache (mcpp >= 2026.7.30.2).
451-
# That cache is unusable here: mcpp#233's object-path disambiguation
452-
# fires on basename collisions across the WHOLE build dir — i.e. on
453-
# which packages the CONSUMER pulls in — while the cache key covers
454-
# only the dependency itself, so one entry can hold two different
455-
# layouts. `tests/examples/archive` pulls zlib AND bzip2 (both ship
456-
# compress.c) and stores obj/compat_zlib/zlib-1.3.2/compress.o;
457-
# every zlib consumer without bzip2 then asks the same key for a
458-
# flat obj/compress.o and ninja dies at graph time with
459-
# "missing and no known rule to make it". Reproduced both ways round
460-
# on 2026.8.3.3 and filed as mcpp-community/mcpp#344. `local` still
461-
# caches the std BMI, which is the expensive one — only package
462-
# entries are bypassed.
459+
# The GLOBAL package build cache is on (mcpp >= 2026.7.30.2), which
460+
# is the default — this step used to set `MCPP_BUILD_CACHE: local`
461+
# and no longer does.
462+
#
463+
# That bypass existed for mcpp#344: object-path disambiguation fires
464+
# on basename collisions across the WHOLE build dir — i.e. on what
465+
# the CONSUMER pulls in — while the cache key covered only the
466+
# dependency, so one entry could hold two layouts and ninja died at
467+
# graph time with "missing and no known rule to make it". #344
468+
# landed in 2026.8.3.4 with per-package Merkle keys that cover the
469+
# consumer-dependent layout, so the reason is gone.
470+
#
471+
# Keeping it cost real time, and the full run is where it showed:
472+
# with `local`, EVERY member recompiles EVERY dependency from
473+
# scratch. 59 members that mostly share abseil / protobuf / opencv
474+
# meant the same sources were built over and over —
475+
#
476+
# linux 2h30m -> cancelled at the 150-minute timeout
477+
# windows 2h20m
478+
# macos 1h26m
463479
#
464-
# STATUS: #344 landed in 2026.8.3.4 (per-package Merkle keys that
465-
# cover the consumer-dependent layout), so as of the pin above this
466-
# bypass is no longer required. It is kept here deliberately:
467-
# re-enabling the global package cache changes how EVERY member
468-
# builds, and that deserves its own PR where a failure is
469-
# unambiguous rather than being attributed to whatever else shipped
470-
# alongside it.
471-
MCPP_BUILD_CACHE: local
480+
# — and a workspace cannot be validated by a job that cannot finish.
481+
# With the cache on, a given (package, version, features, toolchain)
482+
# is built once per run and every later member hits it.
472483
run: |
473484
"$MCPP" --version
474485
# No `timeout` wrapper: absent on macOS runners; job-level timeout-minutes bounds it.

0 commit comments

Comments
 (0)