mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
[publish images] Remove sccache, use ccache only (#25682)
## Summary - Remove sccache support entirely, use ccache only - Missing ccache no longer fails the build (just skips caching) - Remove S3 distributed cache support ## Changes - Remove `cmake/tools/SetupSccache.cmake` and S3 distributed cache support - Simplify `CMakeLists.txt` to only use ccache - Update `SetupCcache.cmake` to not fail when ccache is missing - Replace sccache with ccache in bootstrap scripts (sh, ps1) - Update `.buildkite/Dockerfile` to install ccache instead of sccache - Update `flake.nix` and `shell.nix` to use ccache - Update documentation (CONTRIBUTING.md, contributing.mdx, building-windows.mdx) - Remove `scripts/build-cache/` directory (was only for sccache S3 access) ## Test plan - [x] Build completes successfully with `bun bd` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,7 @@ After Visual Studio, you need the following:
|
||||
|
||||
```ps1 Scoop
|
||||
> irm https://get.scoop.sh | iex
|
||||
> scoop install nodejs-lts go rust nasm ruby perl sccache
|
||||
> scoop install nodejs-lts go rust nasm ruby perl ccache
|
||||
# scoop seems to be buggy if you install llvm and the rest at the same time
|
||||
> scoop install llvm@19.1.7
|
||||
```
|
||||
|
||||
@@ -28,7 +28,7 @@ Using your system's package manager, install Bun's dependencies:
|
||||
<CodeGroup>
|
||||
|
||||
```bash macOS (Homebrew)
|
||||
$ brew install automake cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby sccache
|
||||
$ brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
|
||||
```
|
||||
|
||||
```bash Ubuntu/Debian
|
||||
@@ -70,45 +70,28 @@ $ brew install bun
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Optional: Install `sccache`
|
||||
### Optional: Install `ccache`
|
||||
|
||||
sccache is used to cache compilation artifacts, significantly speeding up builds. It must be installed with S3 support:
|
||||
ccache is used to cache compilation artifacts, significantly speeding up builds:
|
||||
|
||||
```bash
|
||||
# For macOS
|
||||
$ brew install sccache
|
||||
$ brew install ccache
|
||||
|
||||
# For Linux. Note that the version in your package manager may not have S3 support.
|
||||
$ cargo install sccache --features=s3
|
||||
# For Ubuntu/Debian
|
||||
$ sudo apt install ccache
|
||||
|
||||
# For Arch
|
||||
$ sudo pacman -S ccache
|
||||
|
||||
# For Fedora
|
||||
$ sudo dnf install ccache
|
||||
|
||||
# For openSUSE
|
||||
$ sudo zypper install ccache
|
||||
```
|
||||
|
||||
This will install `sccache` with S3 support. Our build scripts will automatically detect and use `sccache` with our shared S3 cache. **Note**: Not all versions of `sccache` are compiled with S3 support, hence we recommend installing it via `cargo`.
|
||||
|
||||
#### Registering AWS Credentials for `sccache` (Core Developers Only)
|
||||
|
||||
Core developers have write access to the shared S3 cache. To enable write access, you must log in with AWS credentials. The easiest way to do this is to use the [`aws` CLI](https://aws.amazon.com/cli/) and invoke [`aws configure` to provide your AWS security info](https://docs.aws.amazon.com/cli/latest/reference/configure/).
|
||||
|
||||
The `cmake` scripts should automatically detect your AWS credentials from the environment or the `~/.aws/credentials` file.
|
||||
|
||||
<details>
|
||||
<summary>Logging in to the `aws` CLI</summary>
|
||||
|
||||
1. Install the AWS CLI by following [the official guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
|
||||
2. Log in to your AWS account console. A team member should provide you with your credentials.
|
||||
3. Click your name in the top right > Security credentials.
|
||||
4. Scroll to "Access keys" and create a new access key.
|
||||
5. Run `aws configure` in your terminal and provide the access key ID and secret access key when prompted.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Common Issues You May Encounter</summary>
|
||||
|
||||
- To confirm that the cache is being used, you can use the `sccache --show-stats` command right after a build. This will expose very useful statistics, including cache hits/misses.
|
||||
- If you have multiple AWS profiles configured, ensure that the correct profile is set in the `AWS_PROFILE` environment variable.
|
||||
- `sccache` follows a server-client model. If you run into weird issues where `sccache` refuses to use S3, even though you have AWS credentials configured, try killing any running `sccache` servers with `sccache --stop-server` and then re-running the build.
|
||||
|
||||
</details>
|
||||
Our build scripts will automatically detect and use `ccache` if available. You can check cache statistics with `ccache --show-stats`.
|
||||
|
||||
## Install LLVM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user