mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## What - Use `cargo binstall` instead of `cargo install` for Rust tools in the Docker image - Download pre-built vercel/sccache from GitHub releases instead of compiling from git ## Why `cargo install` compiles from source which is slow on cache miss. `cargo binstall` downloads pre-built binaries in seconds. The vercel/sccache fork now publishes release binaries, eliminating the need for the `build-sccache` turbo task (~2-3 min compile). ## Changes **Dockerfile:** - Install cargo-binstall at pinned version (1.18.1), use it for cargo-rustflags - Remove sccache from Docker image (not needed inside container) **CI sccache:** - Download pre-built binary from `vercel/sccache` GitHub releases (~11MB) - Cache in `~/.cache/sccache-<version>` on self-hosted runners - Delete `scripts/build-sccache.js`, remove turbo task and package.json entry - `scripts/sccache-version` now contains just the release tag <!-- NEXT_JS_LLM_PR -->
91 lines
2.8 KiB
JSON
91 lines
2.8 KiB
JSON
{
|
|
"$schema": "https://turborepo.org/schema.json",
|
|
"extends": ["//"],
|
|
"tasks": {
|
|
// Fingerprint all Rust inputs into a single stamp file so other tasks
|
|
// only need inputs: [stamp file] instead of repeating the full glob list.
|
|
"rust-fingerprint": {
|
|
"inputs": [
|
|
"../../.cargo/**",
|
|
"../../crates/**",
|
|
"../../turbopack/crates/**",
|
|
"!../../crates/*/tests/**",
|
|
"!../../turbopack/crates/*/tests/**",
|
|
"../../**/Cargo.toml",
|
|
"../../Cargo.lock",
|
|
"../../rust-toolchain.toml",
|
|
],
|
|
"outputs": ["../../target/.rust-fingerprint"],
|
|
"cache": false,
|
|
},
|
|
"build-native-auto": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": [
|
|
"native/*.node",
|
|
"native/index.d.ts",
|
|
"../../packages/next/src/build/swc/generated-native.d.ts",
|
|
],
|
|
},
|
|
"build-native": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["native/*.node", "native/index.d.ts"],
|
|
},
|
|
"build-native-release": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["native/*.node", "native/index.d.ts"],
|
|
},
|
|
"build-native-release-with-assertions": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["native/*.node", "native/index.d.ts"],
|
|
},
|
|
"build-wasm": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["../../crates/wasm/pkg/*"],
|
|
},
|
|
"build-native-wasi": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["native/*"],
|
|
},
|
|
"cache-build-native": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"outputs": ["native/*.node", "native/index.d.ts"],
|
|
},
|
|
"rust-check": {
|
|
"dependsOn": [
|
|
"rust-check-clippy",
|
|
"rust-check-doc",
|
|
"rust-check-fmt",
|
|
"rust-check-napi",
|
|
],
|
|
},
|
|
"rust-check-clippy": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
},
|
|
"rust-check-doc": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
},
|
|
"rust-check-fmt": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
"cache": false,
|
|
},
|
|
"rust-check-napi": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
},
|
|
"test-cargo-unit": {
|
|
"dependsOn": ["rust-fingerprint"],
|
|
"inputs": ["../../target/.rust-fingerprint"],
|
|
},
|
|
},
|
|
}
|