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
2 changes: 2 additions & 0 deletions .buildkite/ci.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const buildPlatforms = [
// these are the darwin artifacts the release ships.
{ os: "darwin", arch: "aarch64", crossCompile: true, distro: "amazonlinux", release: "2023", features: ["docker"] },
{ os: "darwin", arch: "x64", crossCompile: true, distro: "amazonlinux", release: "2023", features: ["docker"] },
{ os: "darwin", arch: "x64", baseline: true, crossCompile: true, distro: "amazonlinux", release: "2023", features: ["docker"] },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the relevant file and surrounding symbols
ast-grep outline .buildkite/ci.mjs --view expanded || true

# Show the relevant section with line numbers
sed -n '120,220p' .buildkite/ci.mjs | cat -n

# Find WebKit pin / artifact naming logic
rg -n "baseline|baseline-LTO|bun-darwin-x64-baseline|webkit|artifact|triplet|crossCompile" .buildkite/ci.mjs

Repository: oven-sh/bun

Length of output: 14910


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the file that defines the platform matrix and any related WebKit pin configuration.
git ls-files | rg '(^|/)\.buildkite/ci\.mjs$|webkit|WebKit|baseline|triplet|artifacts|bun-darwin'

Repository: oven-sh/bun

Length of output: 1440


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== .buildkite/ci.mjs excerpt =="
sed -n '130,210p' .buildkite/ci.mjs | cat -n

echo
echo "== references =="
rg -n "baseline|baseline-LTO|bun-darwin-x64-baseline|triplet|webkit|artifact" .buildkite/ci.mjs

Repository: oven-sh/bun

Length of output: 11124


🌐 Web query:

Bun WebKit baseline artifact bun-darwin-x64-baseline baseline-LTO WebKit autobuild

💡 Result:

The bun-darwin-x64-baseline artifact in Bun is intended to provide a version of the Bun runtime compatible with older Intel processors (pre-Haswell, such as Ivy Bridge) that lack support for advanced instruction sets like AVX2 and BMI2 [1][2]. However, historically, this artifact has faced technical issues regarding its WebKit dependency. Because Bun relies on a prebuilt WebKit library, a true "baseline" macOS x64 binary requires that the linked WebKit library also be compiled for a baseline CPU target (e.g., -march=nehalem) [3][4]. In the past, the bun-darwin-x64-baseline artifact was often incorrectly linked against the standard "modern" macOS WebKit (which includes BMI2 instructions like shlx), causing the Bun binary to crash with an SIGILL (Illegal Instruction) error upon launch on older CPUs [3][1]. Key points regarding these artifacts include: * Architecture Compatibility: The standard Bun binary requires AVX2 support [2]. The -baseline suffix signifies a build intended for CPUs that lack these instructions [2]. * WebKit Linking: Bun's build system uses specific suffixes (such as -baseline, -lto, or -musl) to select the appropriate prebuilt WebKit artifact [4][5]. For Linux and Windows x64, dedicated baseline WebKit artifacts exist [4]. For macOS, the lack of a corresponding baseline WebKit artifact has previously led to the bun-darwin-x64-baseline binary essentially acting as a non-baseline build, which can trigger crashes on unsupported hardware [3][6]. * Build System Enforcement: To prevent the distribution of misleading artifacts, the Bun build system has been updated to reject the creation of macOS "baseline" binaries unless a genuinely compatible baseline WebKit artifact is available [3]. * LTO (Link Time Optimization): The baseline-LTO terminology refers to a configuration that combines the baseline CPU target requirements with Link Time Optimization for performance. WebKit artifacts are often built with either LTO or debug symbols, and the build system ensures the suffix matches the artifact to avoid linking mismatches [4][5]. As of recent updates, the development team has been working on introducing specific baseline macOS WebKit lanes to properly resolve these crashes and provide a functional baseline experience for older macOS hardware [6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== scripts/build/deps/webkit.ts outline =="
ast-grep outline scripts/build/deps/webkit.ts --view expanded || true

echo
echo "== relevant webkit.ts lines =="
rg -n "baseline|LTO|artifact|darwin|macOS|webkit" scripts/build/deps/webkit.ts

echo
echo "== SetupWebKit.cmake lines =="
fd -a 'SetupWebKit.cmake' . || true

Repository: oven-sh/bun

Length of output: 3058


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package README excerpts =="
sed -n '1,220p' packages/bun-release/npm/@oven/bun-darwin-x64-baseline/README.md | cat -n
echo
sed -n '1,220p' packages/bun-release/npm/@oven/bun-darwin-x64/README.md | cat -n

echo
echo "== baseline package references =="
rg -n "bun-darwin-x64-baseline|baseline-LTO|WebKit" packages/bun-release/npm/@oven/bun-darwin-x64-baseline packages/bun-release/npm/@oven/bun-darwin-x64

Repository: oven-sh/bun

Length of output: 612


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== scripts/build/deps/webkit.ts relevant section =="
sed -n '1,260p' scripts/build/deps/webkit.ts | cat -n

echo
echo "== any baseline-specific references in webkit setup =="
rg -n "baseline|LTO|artifact|download|prebuilt|darwin|x64" scripts/build/deps/webkit.ts

Repository: oven-sh/bun

Length of output: 16062


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== SetupWebKit.cmake and related files =="
fd -a 'SetupWebKit.cmake' .
fd -a 'WebKit.cmake' .
fd -a 'webkit' cmake scripts | sed -n '1,200p'

echo
echo "== package and docs references to darwin x64 baseline =="
rg -n "bun-darwin-x64-baseline|baseline-LTO|WebKit" packages docs scripts cmake .claude -g '!**/node_modules/**'

Repository: oven-sh/bun

Length of output: 34822


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== scripts/build/config.ts relevant baseline/lto section =="
sed -n '730,790p' scripts/build/config.ts | cat -n

echo
echo "== scripts/build/profiles.ts relevant release/profile section =="
sed -n '130,170p' scripts/build/profiles.ts | cat -n

echo
echo "== scripts/build/deps/webkit.ts prebuilt and build usage =="
sed -n '188,430p' scripts/build/deps/webkit.ts | cat -n

Repository: oven-sh/bun

Length of output: 18811


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== test/build lane construction around baseline =="
sed -n '740,840p' .buildkite/ci.mjs | cat -n

echo
echo "== release step / artifact selection hints =="
sed -n '1040,1075p' .buildkite/ci.mjs | cat -n

echo
echo "== build step generation around triplets and prebuilt webkit =="
sed -n '540,700p' .buildkite/ci.mjs | cat -n

Repository: oven-sh/bun

Length of output: 14080


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tag="autobuild-4895f45dfbd0d1226c4d41799887bc0ecb9f341b"

echo "== release =="
gh api "repos/oven-sh/WebKit/releases/tags/${tag}" --jq '.tag_name, .name, .assets[].name' || true

echo
echo "== matching asset names =="
gh api "repos/oven-sh/WebKit/releases/tags/${tag}" --jq '.assets[].name' | rg 'bun-webkit-macos-amd64(-baseline)?(-lto)?\.tar\.gz|bun-webkit-macos-arm64'

Repository: oven-sh/bun

Length of output: 2123


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tag="autobuild-4895f45dfbd0d1226c4d41799887bc0ecb9f341b"

gh api "repos/oven-sh/WebKit/releases/tags/${tag}" --jq '.assets[].name' | sort

Repository: oven-sh/bun

Length of output: 1739


Gate the darwin x64 baseline lanes until the matching WebKit tarball lands. The pinned autobuild-4895f45dfbd0d1226c4d41799887bc0ecb9f341b release only has bun-webkit-macos-amd64.tar.gz and bun-webkit-macos-amd64-lto.tar.gz; it does not publish bun-webkit-macos-amd64-baseline.tar.gz or bun-webkit-macos-amd64-baseline-lto.tar.gz, so the build will fail when fetching WebKit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.buildkite/ci.mjs at line 140, Gate or disable the darwin x64 baseline
configuration in the CI matrix until the pinned WebKit release provides the
required baseline tarballs. Update the entry identified by os "darwin", arch
"x64", and baseline true, while preserving the non-baseline darwin x64 lane.

{ os: "linux", arch: "aarch64", distro: "amazonlinux", release: "2023", features: ["docker"] },
{ os: "linux", arch: "x64", distro: "amazonlinux", release: "2023", features: ["docker"] },
{ os: "linux", arch: "x64", baseline: true, distro: "amazonlinux", release: "2023", features: ["docker"] },
Expand Down Expand Up @@ -191,6 +192,7 @@ const testPlatforms = [
{ os: "darwin", arch: "aarch64", release: "26", tier: "latest" },
{ os: "darwin", arch: "aarch64", release: "14", tier: "previous" },
{ os: "darwin", arch: "x64", release: "14", tier: "latest" },
{ os: "darwin", arch: "x64", baseline: true, release: "14", tier: "latest" },
{ os: "linux", arch: "aarch64", distro: "debian", release: "13", tier: "latest" },
{ os: "linux", arch: "x64", distro: "debian", release: "13", tier: "latest" },
{ os: "linux", arch: "x64", baseline: true, distro: "debian", release: "13", tier: "latest" },
Expand Down
5 changes: 3 additions & 2 deletions scripts/build/deps/webkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ function prebuiltSuffix(cfg: Config): string {
if (cfg.linux && cfg.abi === "musl") s += "-musl";
if (cfg.linux && cfg.abi === "android") s += "-android";
// Baseline WebKit artifacts (-march=nehalem, /arch:SSE2 ICU) exist for
// Linux amd64 (glibc + musl) and Windows amd64. No baseline variant for
// arm64 or macOS. Suffix order matches the release asset names:
// Linux amd64 (glibc + musl), Windows amd64, and macOS amd64. No baseline
// variant for arm64 (no AVX on arm64 — baseline is x64-only). Suffix order
// matches the release asset names:
// bun-webkit-linux-amd64-musl-baseline-lto.tar.gz
if (cfg.baseline && cfg.x64) s += "-baseline";
if (cfg.debug) s += "-debug";
Expand Down