Commit Graph

10 Commits

Author SHA1 Message Date
Benjamin Woodruff f6d094061e [ci] Background some steps in build_reusable to reduce setup overhead, remove unneeded lld installation (#96195)
This is a pretty minor win, but it can save a few seconds per job.


https://github.blog/changelog/2026-06-25-actions-steps-can-now-be-run-in-parallel/

Also remove the installation of `lld` for rustc with `apt-get`. It's
very slow, and rustc should already ship with `lld` these days? The
composite action to install the rust toolchain isn't run often (test
shards download a prebuilt native binary), but `build-native` it can
block other jobs from running and become a bottleneck.

Testing the full `build-and-deploy` job, which uses the rust install
action: https://github.com/vercel/next.js/actions/runs/30138483769
2026-07-28 22:49:20 -07:00
Benjamin Woodruff 4e6331397d [ci] Also pin first-party GH actions (#93609)
We were already pinning nearly all of our third-party GitHub actions,
but this also pins our first-party ones (things starting with
`actions/*`.

This gets us closer to being able to enforcing pinning at the repository
level:
![Screenshot 2026-05-06 at
4.39.46 PM.png](https://app.graphite.com/user-attachments/assets/ced0b3f2-7de8-4a9a-aa79-8d3efa74197d.png)

The one remaining blocker is this self-reference in a
`pull_request_target` action:
https://github.com/vercel/next.js/blob/c06d94ba22d0156e8bff28c81f7874b73d80ed03/.github/workflows/pull_request_auto_label.yml#L65

I'm still figuring out the best approach to do there, and I'll submit
that in a separate PR.

Discussion here about enforcing this org-wide:
https://vercel.slack.com/archives/C0AM84PRSGL/p1778110550384279
2026-05-08 20:10:55 +00:00
Matt Mastracci 3e847dfe0b Switch to cargo-binstall and pre-built sccache binaries (#92911)
## 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 -->
2026-04-17 17:09:11 +00:00
Benjamin Woodruff 163a9a32ba fix(CI): Wait for lock when running apt-get (#78979)
Sometimes this step can fail because something else has the lock (I'm
not sure what, as I thought these things run in isolated containers),
but we can mitigate this by waiting for the lock up to 60 seconds.

![Screenshot 2025-05-08 at
9.33.10 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/HAZVitxRNnZz8QMiPn4a/f12de549-6cf0-48f0-959f-cf7595994e15.png)

We also call `apt` instead of `apt-get` in some of our CI scripts, but
use of `apt` in scripts is discouraged as the CLI interface is unstable.
`apt` does automatically wait for the lock, so those places don't have
this problem.

More details here:
https://blog.sinjakli.co.uk/2021/10/25/waiting-for-apt-locks-without-the-hacky-bash-scripts/
2025-05-09 16:23:18 +00:00
Benjamin Woodruff 1eb5944b3c Switch from ld (the default linker) to using lld for GNU Linux targets (#65898)
Copies changes from https://github.com/vercel/turbo/pull/8166, and
updates contributing documentation to include the installation of lld.

> **What's wrong with `ld`?** It's very slow and uses a lot of memory.
>
> **Why `lld`?** It's fast, mature, and well-supported. Meta and Google
use it for all their linking workloads. We're already using it for macos
and x86-64 Windows. There is [ongoing work to make it the default for
rustc](https://github.com/rust-lang/rust/issues/71515), and it already
is default on a few platforms.
>
> **Why not `mold`?** Mold is generally faster, but the margin is slim
enough for our workloads that it doesn't really matter. Mold only
recently got support for LTO, doesn't support v0 rust symbol demanging,
doesn't support BOLT (though we don't use that yet), etc. Mold is
maturing quickly, but `lld` still seems like the "safer" choice.
2024-08-05 17:30:35 -07:00
hrmny ce69d02cf9 chore: remove unused rust dependencies (#62176)
### What?

Toolchain is updated as well.

Should improve compile times marginally, also added the new parallel
frontend.

Depends on https://github.com/vercel/turbo/pull/7409

Closes PACK-2526
2024-04-16 17:48:06 +02:00
JJ Kasper 41ce805de5 Revert "Next Build Turbo POC (#49942)" (#51538)
This reverts commit 7d0bdab83e.

This is failing all builds blocking releases so this reverts it for now
to allow further investigation async.
2023-06-19 21:54:04 -07:00
Tobias Koppers 4cc5715848 Fix native build (#51522)
CI runs with root, there is no sudo
2023-06-19 21:32:08 +02:00
Alex Kirszenberg 7d0bdab83e Next Build Turbo POC (#49942)
This contains the original POC for `next build --turbo`. The implementation is _just enough_ to get pages building, and doesn't support the app router yet.

I'll write more details here on the implementation and what the next steps are next week.

Necessary changes on the Turbo side: https://github.com/vercel/turbo/pull/4998
2023-06-19 14:36:05 +00:00
Leah ded54923a0 better rust setup in CI (#50905)
### Description

Set some environment variables that reduce size on disk and make the
build a little faster.

Also, read the toolchain from the `rust-toolchain` file, so it's not
duplicated in every workflow.

Ported over from the `turbo` repo.
2023-06-07 09:53:50 -07:00