@@ -267,24 +267,14 @@ jobs:
267267 # writes ~5 GB into .next/cache — a sticky disk mounts it in ~1s where an
268268 # actions/cache round-trip would eat the warm-build win.
269269 #
270- # Scoped per branch, not just per event. A sticky disk is a single mutable
271- # volume per key: mounting clones the last committed snapshot and the job
272- # commits back last-write-wins. Keyed on event alone, every open PR shared
273- # one volume, so each run cloned a snapshot built from a *different*
274- # branch. Measured on the same staging commit, minutes apart: the push
275- # disk (single-writer, genuinely warm) compiled in 9.3 min while the
276- # shared pull_request disk took 14.0 min.
277- #
278- # Branch scoping is also the correctness-preserving choice —
279- # turbopackFileSystemCacheForBuild is beta, and cross-commit restore is
280- # not a documented-supported mode (vercel/next.js#87283 reports stale HTML
281- # from a cache built at another commit). Every other cache layer here
282- # already isolates by branch: GitHub's cache can't read sibling branches,
283- # and Blacksmith's own cache product branch-scopes by default. Only this
284- # key didn't.
285- #
286- # Cost of per-branch disks is bounded by ci-cache-cleanup.yml, which
287- # deletes a branch's disk when its PR closes.
270+ # Keyed per branch, not just per event. A sticky disk is one mutable volume
271+ # per key: mounting clones the last committed snapshot, job end commits back
272+ # last-write-wins. An event-only key had every open PR restoring a cache
273+ # built from a different branch — 14.0 min vs 9.3 min for the single-writer
274+ # push disk on the same commit. Branch scoping also keeps us off
275+ # cross-commit restore, which turbopackFileSystemCacheForBuild (beta) does
276+ # not document as supported (vercel/next.js#87283: stale HTML from a cache
277+ # built at another commit). ci-cache-cleanup.yml reclaims the disks.
288278 - name : Mount Next.js build cache
289279 uses : ./.github/actions/cache-mount
290280 with :
@@ -310,19 +300,12 @@ jobs:
310300 - name : Install dependencies
311301 run : bun install --frozen-lockfile --ignore-scripts
312302
313- # Whether the Turbopack cache was warm is otherwise invisible: the disk
314- # mounts successfully either way, and turbo buffers the build log so
315- # compile time only surfaces at the end. Without this, "is the cache
316- # working" can only be answered by diffing compile times across runs and
317- # guessing. Reported, never gated — this is a measurement, not a check.
318- - name : Report Next.js cache state (pre-build)
319- run : |
320- CACHE_DIR=apps/sim/.next/cache
321- if [ -d "$CACHE_DIR" ] && [ -n "$(ls -A "$CACHE_DIR" 2>/dev/null)" ]; then
322- echo "PRE_BUILD_CACHE=warm ($(du -sh "$CACHE_DIR" | cut -f1), $(find "$CACHE_DIR" -type f | wc -l) files)"
323- else
324- echo 'PRE_BUILD_CACHE=cold (empty or absent — expect a full compile)'
325- fi
303+ # The disk mounts successfully whether or not it carried anything and turbo
304+ # buffers the build log, so cache warmth is otherwise unobservable — #5859
305+ # shipped a cache that carried almost nothing and it took a PR to notice.
306+ # Reported, never gated.
307+ - name : Report Next.js cache size (pre-build)
308+ run : du -sh apps/sim/.next/cache 2>/dev/null || echo 'cold — no cache restored'
326309
327310 - name : Build application
328311 env :
@@ -336,18 +319,12 @@ jobs:
336319 ENCRYPTION_KEY : ' 7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
337320 TURBO_CACHE_DIR : .turbo
338321 # Opt into Turbopack's persistent build cache (beta) for this CI check
339- # build only. The 105s-cold/22s-warm figures behind this were measured
340- # locally and have never reproduced in CI, where compile has ranged
341- # 3.5-17.8 min — treat them as local numbers, not a CI target.
322+ # build only. #5869's 105s-cold/22s-warm was measured locally and has
323+ # never reproduced in CI ( compile has ranged 3.5-17.8 min) — local
324+ # numbers, not a CI target.
342325 NEXT_TURBOPACK_BUILD_CACHE : ' 1'
343326 run : bunx turbo run build --filter=sim
344327
345- - name : Report Next.js cache state (post-build)
328+ - name : Report Next.js cache size (post-build)
346329 if : always()
347- run : |
348- CACHE_DIR=apps/sim/.next/cache
349- if [ -d "$CACHE_DIR" ]; then
350- echo "POST_BUILD_CACHE=$(du -sh "$CACHE_DIR" | cut -f1) committed to the sticky disk for the next run on this branch"
351- else
352- echo 'POST_BUILD_CACHE=absent — the build wrote no cache'
353- fi
330+ run : du -sh apps/sim/.next/cache 2>/dev/null || echo 'no cache written'
0 commit comments