Repository navigation
Description
Summary
There is no baseline build for x64 macOS
@oven/bun-darwin-x64-baseline ships the same binary as @oven/bun-darwin-x64 — the AVX2 (-march=haswell) build.
Linux, by contrast, ships a genuine baseline.
Why it matters
On a pre-AVX2 Mac (Sandy/Ivy Bridge — no AVX2/FMA) that binary crashes, and there is no baseline package to fall back to.
This is the upstream cause of downstream reports like anomalyco/opencode#29039 — opencode's -baseline Mac binary SIGILLs on Ivy Bridge.
Who hits it
Pre-Haswell Intel Macs running a macOS that bun supports. Quoting the reports:
macOS: 13.7.4
Machine: Macmini6,2 (Intel Ivy Bridge, 2012)
CPU: x86_64 (supports AVX, but NOT AVX2)
macOS 13.7.4 clears bun's 13.0 deployment target; the CPU has no AVX2. That combination is the gap. Same reporter:
This makes the tool unusable on: Intel Macs pre-Haswell (≈ 2013 and earlier) / Any x86_64 CPU without AVX2 support. These machines are still relatively common in development environments.
MacBook Pro, Intel Core i7-3520M @ 2.90GHz
macOS 24.6.0 (Darwin)
sysctl -n hw.optional.avx2_0returns 0 — no AVX2 support
That reporter independently confirmed the packaging bug straight from the Mach-O header:
otool -hshows cpusubtype 3 (CPU_SUBTYPE_X86_64_H — Haswell) for both
For my part, I run OpenCore Legacy Patcher on my mom's 2013 Intel Mac — current macOS, so it clears the deployment target, and the CPU is the only blocker.
Evidence
Every step is reproducible with curl — no bun internals involved.
1. The two darwin packages ship the same binary.
Download both npm packages and hash the bun binary inside each:
ea2f223e94bb2f4bf3050895113c3cf346438f6fa0501c8532284e063f72f7a0 @oven/[email protected]
ea2f223e94bb2f4bf3050895113c3cf346438f6fa0501c8532284e063f72f7a0 @oven/[email protected]
Identical hash, identical 69,173,328 bytes — byte-for-byte the same file. The "baseline" package is not a distinct build.
2. That binary is the AVX2 build.
Disassembling it (Mach-O, x86_64) finds 248,019 AVX2 (ymm) + 7,049 AVX-512 (zmm) instructions — i.e. the modern (-march=haswell) build, which a pre-AVX2 CPU can't run.
3. Linux ships a real baseline; darwin doesn't.
Same comparison on the linux packages — default and baseline are different binaries:
9fd36f87e4b90b07632b987a2e4ec81ca15a62c81bf983190cea6d715be2ad74 @oven/[email protected]
a8f9ebd1770ddc8e55dab7a68d4ec1ec1eebf374bb97cc65cf2c3cb373fc6791 @oven/[email protected]
And the linux baseline carries ~24× fewer AVX2 instructions:
| npm package | default vs baseline | AVX2 instruction count |
|---|---|---|
@oven/bun-linux-x64 (default) |
— | 299,928 |
@oven/bun-linux-x64-baseline |
distinct | 12,328 |
@oven/bun-darwin-x64 (default) |
— | 248,019 |
@oven/bun-darwin-x64-baseline |
identical | 248,019 (same file) |
4. Systemic, not a 1.3.14 regression.
bun-darwin-x64 == bun-darwin-x64-baseline at 1.2.20 as well.
5. Confirmed on real pre-AVX2 hardware.
On a rented Sandy Bridge Xeon (AVX + SSE4.2, no AVX2/FMA), the AVX2 build — once it touches the simdutf text-processing path — crashes with a segfault after ~21s / ~3.9 GB RSS. The real SSE4.2 baseline build runs fine on the same machine. So the AVX2 build is what crashes, and a proper darwin baseline would work.
Root cause
The baseline WebKit prebuilt doesn't exist for macOS
From scripts/build/deps/webkit.ts:
"Baseline WebKit artifacts (-march=nehalem, /arch:SSE2 ICU) exist for Linux amd64 (glibc + musl) and Windows amd64. No baseline variant for arm64 or macOS."
bun links a prebuilt WebKit, so with no macOS baseline WebKit there's no macOS baseline bun.
For arm64 that's correct — there's no AVX on arm64, so baseline is x64-only. macOS x64 looks like it got grouped in by accident.
The knock-on effects
.buildkite/ci.mjsbuildPlatformshas no darwin baseline lane (linux has one).packages/bun-release/src/platform.ts:41still declares thebun-darwin-x64-baselinenpm package, so it publishes anyway — fed the default binary.prebuiltSuffix()already appends-baselinefor any x64 target, so bun's URL was always right. Only the artifact was missing.
Fix
I've built the missing artifact and confirmed it works.
Using oven-sh/WebKit's own unmodified macos-cross-release.sh with MACOS_ARCH=x86_64 MARCH_FLAG="-march=nehalem", the baseline macOS WebKit builds cleanly:
libJavaScriptCore.a |
AVX2 (%ymm) |
|---|---|
-march=nehalem (this build) |
0 |
existing bun-webkit-macos-amd64 (-march=haswell) |
58,967 |
So it's two small changes, both mirroring lanes that already exist:
- oven-sh/WebKit — add a
bun-webkit-macos-amd64-baselinelane (+ forwardMARCH_FLAG): macOS: build a baseline (non-AVX2) x64 WebKit WebKit#290 - oven-sh/bun — add
{ os: "darwin", arch: "x64", baseline: true, … }tobuildPlatforms, and correct the now-stale comment: macOS: build a real darwin-x64 baseline #34207 (draft, gated on the WebKit PR)
Prebuilt artifacts from this recipe (a baseline bun + an opencode compiled against it), if anyone with a pre-AVX2 Mac wants to test: https://github.com/tobocop2/opencode-bun-pre-avx2-mac
Activity
github-actions commentedon Jul 15, 2026
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
robobun commentedon Jul 15, 2026
✅ Confirmed:
@oven/bun-darwin-x64-baseline1.3.14 is byte-identical to the AVX2 default; root cause is the missingbun-webkit-macos-amd64-baselineprebuilt. Issue closed as duplicate of #32511.Fix tracked on oven-sh/WebKit#290 (baseline + baseline-lto macOS WebKit lanes, artifacts verified AVX-free via the preview build on oven-sh/WebKit#291) and #34207 (the
bun-darwin-x64-baselineCI lane +WEBKIT_VERSIONbump once the WebKit side merges).tobocop2 commentedon Jul 15, 2026
Closing as a duplicate of #32511 (and #26872), which reported this first — the auto-triage bot was right.
Leaving the root-cause analysis here for reference, but the fix work is tracked on those:
bun-webkit-macos-amd64-baseline+-baseline-lto). This is the artifact build: reject prebuilt baseline macOS builds (no Nehalem macOS WebKit) #32512 identifies as required and notes could not be produced in that environment; it builds cleanly with WebKit's own unmodifiedmacos-cross-release.sh, giving alibJavaScriptCore.awith 0%ymmvs 58,967 in the shipped Haswell one.darwin-x64-baselinebuild lane once the artifact exists.Builds for anyone with a pre-AVX2 Mac willing to test: https://github.com/tobocop2/opencode-bun-pre-avx2-mac