Skip to content

fix(cmake): download baseline WebKit for x64 baseline builds#27007

Open
robobun wants to merge 1 commit intomainfrom
claude/fix-baseline-webkit-sigill-27006
Open

fix(cmake): download baseline WebKit for x64 baseline builds#27007
robobun wants to merge 1 commit intomainfrom
claude/fix-baseline-webkit-sigill-27006

Conversation

@robobun
Copy link
Copy Markdown
Collaborator

@robobun robobun commented Feb 13, 2026

Summary

  • Adds -baseline suffix to WebKit download URL when ENABLE_BASELINE is set for x64 builds, so baseline Bun links against a WebKit compiled without AVX/AVX2 instructions
  • Removes unused WEBKIT_PREVIEW_PR variable (WebKit PR Error using custom npm registry in bunfig.toml #140 was already merged)

Root cause

When ENABLE_BASELINE is set, Bun's own code is compiled with -march=nehalem (SSE4.2 only, no AVX). However, SetupWebKit.cmake was downloading the regular WebKit tarball (bun-webkit-linux-amd64.tar.gz) which is compiled with AVX/AVX2 support. When baseline Bun called into WebKit/JSC on a non-AVX CPU, it hit AVX instructions and crashed with SIGILL (exit code 132).

Fix

The suffix computation now includes a check for ENABLE_BASELINE:

if(ENABLE_BASELINE AND WEBKIT_ARCH STREQUAL "amd64")
  set(WEBKIT_SUFFIX "${WEBKIT_SUFFIX}-baseline")
endif()

This produces the correct artifact names matching oven-sh/WebKit PR #137:

  • bun-webkit-linux-amd64-baseline.tar.gz
  • bun-webkit-linux-amd64-baseline-lto.tar.gz
  • bun-webkit-linux-amd64-musl-baseline.tar.gz
  • bun-webkit-linux-amd64-musl-baseline-lto.tar.gz

Dependencies

This fix requires oven-sh/WebKit PR #137 to be merged first so that the baseline WebKit artifacts exist in releases. Until then, baseline CI builds will fail to download WebKit (which is the desired behavior - it's better to fail loudly at build time than to silently link AVX-enabled WebKit into a baseline binary).

Test plan

Closes #27006

🤖 Generated with Claude Code

When ENABLE_BASELINE is set for x64 builds, Bun is compiled with
-march=nehalem (no AVX/AVX2), but the prebuilt WebKit was downloaded
without a -baseline suffix, linking against a WebKit compiled with
AVX/AVX2 support. This caused SIGILL crashes on CPUs without AVX.

Add -baseline suffix to the WebKit download URL when ENABLE_BASELINE
is true for amd64 targets, matching the baseline artifact names from
oven-sh/WebKit PR #137.

Also remove unused WEBKIT_PREVIEW_PR variable (PR #140 was merged).

Closes #27006

Co-Authored-By: Claude <noreply@anthropic.com>
@robobun
Copy link
Copy Markdown
Collaborator Author

robobun commented Feb 13, 2026

Updated 1:19 PM PT - Feb 13th, 2026

❌ Your commit 883ea966 has 9 failures in Build #37200 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 27007

That installs a local version of the PR into your bun-27007 executable, so you can run:

bun-27007 --bun

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

Modified WebKit CMake configuration to remove WEBKIT_PREVIEW_PR definition and introduce baseline build suffix handling. When ENABLE_BASELINE is enabled and WEBKIT_ARCH is amd64, the script appends -baseline to WEBKIT_SUFFIX in two locations, affecting artifact naming and download URLs for baseline builds.

Changes

Cohort / File(s) Summary
WebKit Build Configuration
cmake/tools/SetupWebKit.cmake
Removed WEBKIT_PREVIEW_PR 140 definition. Added baseline build suffix (-baseline) to WEBKIT_SUFFIX when ENABLE_BASELINE is enabled and WEBKIT_ARCH is amd64, applied in two locations affecting WEBKIT_NAME, WEBKIT_FILENAME, and download URL construction.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (6 files):

⚔️ cmake/tools/SetupWebKit.cmake (content)
⚔️ src/CLAUDE.md (content)
⚔️ src/bun.js/bindings/webcore/SerializedScriptValue.cpp (content)
⚔️ src/linker.zig (content)
⚔️ src/logger.zig (content)
⚔️ src/s3/credentials.zig (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding baseline WebKit download functionality for x64 baseline builds, which is the primary purpose of this PR.
Description check ✅ Passed The PR description thoroughly covers both required template sections: a clear summary of what the PR does and comprehensive documentation of how the changes were verified and tested.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Feb 13, 2026

Code Review

Newest first

883ea — Looks good!

Reviewed 1 file in cmake/tools/: Adds a -baseline suffix to the WebKit download URL for x64 baseline builds to prevent SIGILL crashes on non-AVX CPUs, and removes unused WEBKIT_PREVIEW_PR variable.


Powered by Claude Code Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bun 1.3.9 (baseline/no_avx) crashes with SIGILL during bun install (esbuild postinstall) on non-AVX CPU in Docker

1 participant