We're consolidating on `actions/cache` now that we got rid of
self-hosted runners. This doesn't remove all of the uses of turborepo's
cache (notably sccache), but this does eliminate the remote turborepo
cache for the native build cache and the docker image.
These build steps use docker so that we're building against an old
pinned glibc (2.31), and so that we can have access to both `aarch64`
and `x86_64` musl sysroots.
## Testing
**Local Build:** `node scripts/docker-native-build.js` still works (this
script just exists for being able to debug these builds locally)
**CI Build:**
- Run an automated-preview CI job, but cancel it before the native build
succeeds to test writing to the docker cache but not the native cache:
https://github.com/vercel/next.js/actions/runs/26986955366/job/79638633136?pr=94319
- Re-run the job with only the docker image cache, see that we get a
cache hit for the docker image:
https://github.com/vercel/next.js/actions/runs/26986955366/job/79639365126?pr=94319
- Re-run the job again and see that we hit the native build cache hit
and don't touch docker at all:
https://github.com/vercel/next.js/actions/runs/26986955366/job/79647324952?pr=94319
- Manually trigger the job to do a full preview build:
https://github.com/vercel/next.js/actions/runs/26989861549
## What
Replace duplicated Rust input globs across every turbo task with a
single rust-fingerprint task that computes a TURBO_HASH stamp file. All
Rust build/check tasks now depend on this stamp instead of repeating the
full glob list.
Also add `SCCACHE_*` to `globalPassThroughEnv` so `sccache` env vars are
available to turbo tasks.
## Why
`SCCACHE_*` and `RUSTC_WRAPPER` env vars are required to build under
sccache, but do not affect the build in a material way.
This simplifies the repeated constructs that are unfortunately difficult
to factor out, but is provably the same as listing all the files each
time (the rust-fingerprint file's content is its `TURBO_HASH`).