Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .buildkite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG LLVM_VERSION="21"
ARG REPORTED_LLVM_VERSION="21.1.8"
ARG LLVM_VERSION="22"
ARG REPORTED_LLVM_VERSION="22.1.8"
ARG OLD_BUN_VERSION="1.3.13"
ARG BUILDKITE_AGENT_TAGS="queue=linux,os=linux,arch=${TARGETARCH}"

Expand Down
25 changes: 18 additions & 7 deletions .buildkite/ci.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import { join } from "node:path";
import {
getBootstrapVersion,
getBranchImageSuffix,
getBuildkiteEmoji,
getBuildMetadata,
getBuildNumber,
getCanaryRevision,
getCommitMessage,
getEmoji,
Expand Down Expand Up @@ -194,8 +194,8 @@ const testPlatforms = [
{ os: "linux", arch: "x64", profile: "asan", distro: "debian", release: "13", tier: "latest" },
{ os: "linux", arch: "aarch64", distro: "ubuntu", release: "25.04", tier: "latest" },
{ os: "linux", arch: "x64", distro: "ubuntu", release: "25.04", tier: "latest" },
{ os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.23", tier: "latest" },
{ os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.23", tier: "latest" },
{ os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.24", tier: "latest" },
{ os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.24", tier: "latest" },
{ os: "windows", arch: "x64", release: "2019", tier: "oldest" },
{ os: "windows", arch: "aarch64", release: "11", tier: "latest" },
];
Expand Down Expand Up @@ -272,7 +272,7 @@ function getImageLabel(platform) {
*/
function getImageName(platform, options) {
const { os, distro, crossCompile } = platform;
const { buildImages, publishImages, imageFilter } = options;
const { buildImages, publishImages, imageFilter, changedFiles = [] } = options;

const name = getImageKey(platform);

Expand All @@ -285,7 +285,15 @@ function getImageName(platform, options) {
const hostOs = os === "freebsd" || crossCompile ? "linux" : os;

if (buildImages && !publishImages && (!imageFilter || hostOs === imageFilter || distro === imageFilter)) {
return `${name}-build-${getBuildNumber()}`;
return `${name}-${getBranchImageSuffix()}`;
}

// Not a [build images] push: if this PR changes the bootstrap script for
// this host OS, the published -vN won't match what it needs. Request the
// branch-scoped image a prior [build images] push on this branch baked.
const bootstrapFile = hostOs === "windows" ? "scripts/bootstrap.ps1" : "scripts/bootstrap.sh";
if (!publishImages && !isMainBranch() && changedFiles.includes(bootstrapFile)) {
return `${name}-${getBranchImageSuffix()}`;
}

return `${name}-v${getBootstrapVersion(hostOs)}`;
Expand Down Expand Up @@ -681,7 +689,7 @@ function hasWebKitChanges(options) {
function getVerifyBaselineHost(platform) {
const { os, arch, abi } = platform;
if (os === "windows") return { os: "windows", arch, release: "2019" };
if (abi === "musl") return { os: "linux", arch, abi: "musl", distro: "alpine", release: "3.23" };
if (abi === "musl") return { os: "linux", arch, abi: "musl", distro: "alpine", release: "3.24" };
return { os: "linux", arch, distro: "debian", release: "13" };
}

Expand Down Expand Up @@ -843,8 +851,11 @@ function getTestBunStep(platform, options, testOptions = {}) {
* 1. Edit bootstrap.sh / bootstrap.ps1 and bump its `# Version:` line.
* 2. Open a PR whose **commit subject** contains `[build images]` (or
* `[build linux images]` / `[build windows images]` to scope it). This
* bakes throwaway `…-build-<buildNumber>` images and runs the full
* bakes throwaway `…-branch-<branchSlug>` images and runs the full
* build+test pipeline against them so you can verify the change.
* Subsequent pushes on the same branch reuse those images (because
* changedFiles includes the bootstrap script), so you can iterate
* without `[build images]` unless you change bootstrap.* again.
* 3. Once green, amend/force-push the subject to `[publish images]` (or the
* scoped variant). This bakes the real `…-vN` images that normal CI will
* pick up. Publishing replaces the live tag in place — for Windows it
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ The workflow runs all three formatters simultaneously:

#### 3. Tool Installation

##### Clang-format-21
##### Clang-format-22

- Installs ONLY `clang-format-21` package (not the entire LLVM toolchain)
- Installs ONLY `clang-format-22` package (not the entire LLVM toolchain)
Comment thread
robobun marked this conversation as resolved.
- Uses `--no-install-recommends --no-install-suggests` to skip unnecessary packages
- Quiet installation with `-qq` and `-o=Dpkg::Use-Pty=0`

Expand Down Expand Up @@ -97,7 +97,7 @@ The workflow runs all three formatters simultaneously:

```bash
# Test the clang-format script
export LLVM_VERSION_MAJOR=19
export LLVM_VERSION_MAJOR=22
./scripts/run-clang-format.sh format

# Test with check mode (no modifications)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

env:
BUN_VERSION: "1.3.2"
LLVM_VERSION_MAJOR: "21"
LLVM_VERSION_MAJOR: "22"
# Pin the toolchain explicitly so rustup ignores rust-toolchain.toml's
# `targets` list (11 cross triples ≈ 450 MB of prebuilt std we don't need
# to lint the host). Keep in sync with `channel` in rust-toolchain.toml.
Expand All @@ -49,7 +49,7 @@ jobs:
bun-version: ${{ env.BUN_VERSION }}

- name: Setup system deps
# cmake/ninja for `--configure-only`; clang-21 for toolchain detection
# cmake/ninja for `--configure-only`; clang-22 for toolchain detection
# (configure resolves cfg.cc/cxx even though we won't compile C++).
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
merge_group:
env:
BUN_VERSION: "1.3.2"
LLVM_VERSION: "21.1.8"
LLVM_VERSION_MAJOR: "21"
LLVM_VERSION: "22.1.8"
LLVM_VERSION_MAJOR: "22"

jobs:
autofix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:

env:
BUN_VERSION: "1.3.2"
LLVM_VERSION_MAJOR: "21"
LLVM_VERSION_MAJOR: "22"
# Pin so rustup ignores rust-toolchain.toml's `targets` list (11 cross
# triples ≈ 450 MB we don't need). Keep in sync with `channel` there.
RUSTUP_TOOLCHAIN: nightly-2026-07-20
Expand Down
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $ sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config
```

```bash#Fedora
$ sudo dnf install clang21 llvm21 lld21 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
$ sudo dnf install clang22 llvm22 lld22 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
```

```bash#openSUSE Tumbleweed
Expand Down Expand Up @@ -94,17 +94,17 @@ Our build scripts will automatically detect and use `ccache` if available. You c

## Install LLVM

Bun requires LLVM 21.1.8 (`clang` is part of LLVM). This version is enforced by the build system — mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
Bun requires LLVM 22.1.8 (`clang` is part of LLVM). This version is enforced by the build system — mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:

{% codetabs group="os" %}

```bash#macOS (Homebrew)
$ brew install llvm@21
$ brew install llvm@22
```

```bash#Ubuntu/Debian
$ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu
$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 21 all
$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 22 all
```

```bash#Arch
Expand All @@ -116,17 +116,17 @@ $ sudo dnf install llvm clang lld-devel
```

```bash#openSUSE Tumbleweed
$ sudo zypper install clang21 lld21 llvm21
$ sudo zypper install clang22 lld22 llvm22
```

{% /codetabs %}

If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.8).
If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8).

Make sure Clang/LLVM 21 is in your path:
Make sure Clang/LLVM 22 is in your path:

```bash
$ which clang-21
$ which clang-22
```

If not, run this to manually add it:
Expand All @@ -135,13 +135,13 @@ If not, run this to manually add it:

```bash#macOS (Homebrew)
# use fish_add_path if you're using fish
# use path+="$(brew --prefix llvm@21)/bin" if you are using zsh
$ export PATH="$(brew --prefix llvm@21)/bin:$PATH"
# use path+="$(brew --prefix llvm@22)/bin" if you are using zsh
$ export PATH="$(brew --prefix llvm@22)/bin:$PATH"
```

```bash#Arch
# use fish_add_path if you're using fish
$ export PATH="$PATH:/usr/lib/llvm21/bin"
$ export PATH="$PATH:/usr/lib/llvm22/bin"
```

{% /codetabs %}
Expand Down Expand Up @@ -318,7 +318,7 @@ The issue may manifest when initially running `bun setup` as Clang being unable
```
The C++ compiler

"/usr/bin/clang++-21"
"/usr/bin/clang++-22"

is not able to compile a simple test program.
```
Expand Down
10 changes: 5 additions & 5 deletions docs/project/building-windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ winget install "Visual Studio Community 2022" --override "--add Microsoft.Visual

After Visual Studio, you need the following:

- LLVM 21.1.8
- LLVM 22.1.8
- Go
- Rust (via rustup)
- NASM
Expand All @@ -49,15 +49,15 @@ Use [Scoop](https://scoop.sh) to install these remaining tools.
irm https://get.scoop.sh | iex
scoop install nodejs-lts go rustup nasm ruby perl ccache
# scoop seems to be buggy if you install llvm and the rest at the same time
scoop install llvm@21.1.8
scoop install llvm@22.1.8
```

For Windows ARM64, download LLVM 21.1.8 directly from GitHub releases (first version with ARM64 Windows builds):
For Windows ARM64, download LLVM 22.1.8 directly from GitHub releases:

```ps1 ARM64
# Download and install LLVM for ARM64
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/LLVM-21.1.8-woa64.exe" -OutFile "$env:TEMP\LLVM-21.1.8-woa64.exe"
Start-Process -FilePath "$env:TEMP\LLVM-21.1.8-woa64.exe" -ArgumentList "/S" -Wait
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/LLVM-22.1.8-woa64.exe" -OutFile "$env:TEMP\LLVM-22.1.8-woa64.exe"
Start-Process -FilePath "$env:TEMP\LLVM-22.1.8-woa64.exe" -ArgumentList "/S" -Wait
```

<Note>
Expand Down
24 changes: 12 additions & 12 deletions docs/project/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config py
```

```bash Fedora
sudo dnf install clang21 llvm21 lld21 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
sudo dnf install clang22 llvm22 lld22 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
```

```bash openSUSE Tumbleweed
Expand Down Expand Up @@ -96,17 +96,17 @@ The build scripts detect and use `ccache` automatically if it's available. Check

## Install LLVM

Bun requires LLVM 21.1.8 (`clang` is part of LLVM). The build system enforces this version: a mismatched version causes memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
Bun requires LLVM 22.1.8 (`clang` is part of LLVM). The build system enforces this version: a mismatched version causes memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:

<CodeGroup>

```bash macOS (Homebrew)
brew install llvm@21
brew install llvm@22
```

```bash Ubuntu/Debian
# LLVM has an automatic installation script that is compatible with all versions of Ubuntu
wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 21 all
wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 22 all
```

```bash Arch
Expand All @@ -118,17 +118,17 @@ sudo dnf install llvm clang lld-devel
```

```bash openSUSE Tumbleweed
sudo zypper install clang21 lld21 llvm21
sudo zypper install clang22 lld22 llvm22
```

</CodeGroup>

If none of these work, install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.8).
If none of these work, install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8).

Make sure Clang/LLVM 21 is in your path:
Make sure Clang/LLVM 22 is in your path:

```bash
which clang-21
which clang-22
```

If not, add it manually:
Expand All @@ -137,13 +137,13 @@ If not, add it manually:

```bash macOS (Homebrew)
# use fish_add_path if you're using fish
# use path+="$(brew --prefix llvm@21)/bin" if you are using zsh
export PATH="$(brew --prefix llvm@21)/bin:$PATH"
# use path+="$(brew --prefix llvm@22)/bin" if you are using zsh
export PATH="$(brew --prefix llvm@22)/bin:$PATH"
```

```bash Arch
# use fish_add_path if you're using fish
export PATH="$PATH:/usr/lib/llvm21/bin"
export PATH="$PATH:/usr/lib/llvm22/bin"
```

</CodeGroup>
Expand Down Expand Up @@ -322,7 +322,7 @@ The issue may also surface when first running `bun run build`, with Clang unable
```txt
The C++ compiler

"/usr/bin/clang++-21"
"/usr/bin/clang++-22"

is not able to compile a simple test program.
```
Expand Down
10 changes: 5 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
};
};

# LLVM 21 - matching the bootstrap script (targets 21.1.8, actual version from nixpkgs-unstable)
llvm = pkgs.llvm_21;
clang = pkgs.clang_21;
lld = pkgs.lld_21;
# LLVM 22 - matching the bootstrap script (targets 22.1.8, actual version from nixpkgs-unstable)
llvm = pkgs.llvm_22;
clang = pkgs.clang_22;
lld = pkgs.lld_22;

# Node.js 26 - matching the bootstrap script (targets 26.3.0, actual version from nixpkgs-unstable)
nodejs = pkgs.nodejs_26;
Expand All @@ -42,7 +42,7 @@
pkgs.pkg-config
pkgs.ccache

# Compilers and toolchain - version pinned to LLVM 21
# Compilers and toolchain - version pinned to LLVM 22
clang
llvm
lld
Expand Down
4 changes: 2 additions & 2 deletions scripts/bootstrap.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version: 22
# Version: 24
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# A script that installs the dependencies needed to build and test Bun on Windows.
# Supports both x64 and ARM64 using Scoop for package management.
# Used by Azure [build images] pipeline.
Expand Down Expand Up @@ -256,7 +256,7 @@ function Install-CMake {
}

function Install-Llvm {
$LLVM_VERSION = "21.1.8"
$LLVM_VERSION = "22.1.8"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if (Which clang-cl) {
return
}
Expand Down
Loading
Loading