mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
f98a3f1101
## What Use sccache, backed by the Vercel artifact cache, when compiling Rust code. ## Why Each CI runner compiles ~960 external Rust crates from scratch (~5 min) on binary cache misses, even though `Cargo.lock` rarely changes between commits. Some workflows don't cache and always build from scratch. ## Notes Builds will use a local cache on each runner, but we've got a lot of these runners and they'll take some time to populate that local, fastest level of cache. Windows builds are currently hitting ~68% of cached compilations for a reason that isn't totally clear. Linux builds are caching correctly, however. A follow-up pass at this work will use an incremental turborepo caching strategy to improve this, and another pass will experiment with cross-compiling Windows from Linux which will likely also help. Linux builds that don't change Rust files at all are nearly instantaneous (as before), and Linux builds that change Rust files will complete in approximately 1/2 the time. `check` builds are ~1min faster (~25% faster). LTO-heavy runs like the benchmark builders are currently still slow (approx unchanged), needs further investigation (may be related to git hash embedding?).
13 lines
297 B
Bash
13 lines
297 B
Bash
#!/usr/bin/env bash
|
|
|
|
echo "=== sccache stats ==="
|
|
sccache --show-stats || true
|
|
sccache --stop-server 2>/dev/null || true
|
|
|
|
# Show server error log if present
|
|
LOG="${RUNNER_TEMP:-/tmp}/sccache-error.log"
|
|
if [ -f "$LOG" ]; then
|
|
echo "=== sccache error log (last 30 lines) ==="
|
|
tail -30 "$LOG"
|
|
fi
|