Commit a94cf0a
committed
build(ci): cap macOS build parallelism + wire shared sccache/Depot compiler cache
Two complementary fixes for the macOS build, behind a new `use_cache`
workflow_dispatch input (default true). Phase 1 = macOS only.
BUILD_JOBS knob (previously investigated, never landed): build.sh now honors
$BUILD_JOBS for the cmake -j level (default = all cores; portable nproc/sysctl
detection), and the 3 macOS build jobs set BUILD_JOBS=2. GitHub's ~7 GB macOS arm64
runners OOM under -j$(nproc) when the 16.6k-line httplib.cpp co-schedules with the model
TUs; the runner is then killed as SIGTERM/143 ("received a shutdown signal") — not a
real timeout. Capping concurrent compiles bounds peak memory.
sccache -> Depot Cache (WebDAV): build.sh routes the compiler through sccache
(-DCMAKE_*_COMPILER_LAUNCHER) only when USE_CACHE=true AND sccache + a cache token are
present, then prints `sccache --show-stats`. The 3 macOS jobs brew-install sccache and
set SCCACHE_WEBDAV_ENDPOINT=https://cache.depot.dev +
SCCACHE_WEBDAV_TOKEN=${{ secrets.DEPOT_TOKEN }}. Because llama.cpp is pinned, the ~280
upstream object files are content-identical every run, so a warm cache recompiles only
changed files — staying -O3, bit-identical and release-safe. Depot's cache is shared
across all branches, so every branch builds incrementally (and warm builds also cut the
macOS memory pressure further).
Safety: inert until the DEPOT_TOKEN secret exists and on fork PRs (secrets hidden) —
those just compile normally; the install step is continue-on-error and use_cache=false
forces a clean from-scratch build. build.sh gating verified locally across all four
cases (warm / Linux-untouched / no-token / explicit-off).
Phase 2 (later): dockcross Linux/Android/CUDA (needs the token + sccache binary passed
into the container), Windows, and the Linux-host test-cpp job.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdLpWD8nedY7LwNnHefZLF1 parent fae2b90 commit a94cf0a
2 files changed
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
311 | 320 | | |
312 | 321 | | |
313 | 322 | | |
| |||
327 | 336 | | |
328 | 337 | | |
329 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
330 | 343 | | |
331 | 344 | | |
332 | 345 | | |
| |||
344 | 357 | | |
345 | 358 | | |
346 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
347 | 365 | | |
348 | 366 | | |
349 | 367 | | |
| |||
363 | 381 | | |
364 | 382 | | |
365 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
366 | 388 | | |
367 | 389 | | |
368 | 390 | | |
| |||
476 | 498 | | |
477 | 499 | | |
478 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
479 | 506 | | |
480 | 507 | | |
481 | 508 | | |
| |||
495 | 522 | | |
496 | 523 | | |
497 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
498 | 529 | | |
499 | 530 | | |
500 | 531 | | |
| |||
0 commit comments