@@ -263,24 +263,12 @@ jobs:
263263 key : ${{ github.repository }}-turbo-cache-build-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}
264264 path : ./.turbo
265265
266- # Turbopack's persistent build cache (NEXT_TURBOPACK_BUILD_CACHE below)
267- # writes ~5 GB into .next/cache — a sticky disk mounts it in ~1s where an
268- # actions/cache round-trip would eat the warm-build win.
269- #
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.
278- - name : Mount Next.js build cache
279- uses : ./.github/actions/cache-mount
280- with :
281- provider : ${{ vars.CI_PROVIDER }}
282- key : ${{ github.repository }}-nextjs-cache-${{ github.event_name }}${{ github.event.pull_request.head.repo.fork && '-fork' || '' }}-${{ github.head_ref || github.ref_name }}
283- path : ./apps/sim/.next/cache
266+ # No `.next/cache` mount: the Turbopack persistent build cache is off. A
267+ # controlled A/B on one branch (PR #6078) with a byte-identical module graph
268+ # measured compile at 113s with the cache off, 162s cold with it on, and
269+ # 360s warm — the cache made the same build 3.2x slower, and it grew
270+ # 5.1 GB -> 12 GB across two runs of an unchanged tree, so a disk degrades
271+ # the more it is used. Mounting a disk nothing reads would only cost storage.
284272
285273 # Running out of RAM kills the whole VM and surfaces only as "the runner
286274 # has received a shutdown signal" — no mention of memory, ~12 min in. Warn
@@ -300,13 +288,6 @@ jobs:
300288 - name : Install dependencies
301289 run : bun install --frozen-lockfile --ignore-scripts
302290
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'
309-
310291 - name : Build application
311292 env :
312293 NODE_OPTIONS : ' --no-warnings --max-old-space-size=8192'
@@ -318,13 +299,4 @@ jobs:
318299 AWS_REGION : ' us-west-2'
319300 ENCRYPTION_KEY : ' 7cf672e460e430c1fba707575c2b0e2ad5a99dddf9b7b7e3b5646e630861db1c' # dummy key for CI only
320301 TURBO_CACHE_DIR : .turbo
321- # Opt into Turbopack's persistent build cache (beta) for this CI check
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.
325- NEXT_TURBOPACK_BUILD_CACHE : ' 1'
326302 run : bunx turbo run build --filter=sim
327-
328- - name : Report Next.js cache size (post-build)
329- if : always()
330- run : du -sh apps/sim/.next/cache 2>/dev/null || echo 'no cache written'
0 commit comments