Skip to content

Add x64 baseline WebKit builds for Linux and Windows#171

Merged
dylan-conway merged 2 commits intomainfrom
claude/webkit-baseline-builds
Mar 5, 2026
Merged

Add x64 baseline WebKit builds for Linux and Windows#171
dylan-conway merged 2 commits intomainfrom
claude/webkit-baseline-builds

Conversation

@dylan-conway
Copy link
Member

Linux x64 WebKit has been -march=nehalem for all builds since 596e48e. This splits it: default → haswell, new -baseline artifacts → nehalem.

Windows had no -march at all. Both WebKit (clang-cl) and ICU (cl.exe via MSBuild) were compiling with whatever the toolchain defaulted to — recent MSVC auto-vectorizes to AVX2/AVX-512 in ICU with no CPUID gate. Now windows-release.ps1 takes -Baseline and threads /clang:-march= into CMake; build-icu.ps1 injects /arch:SSE2 or /arch:AVX2 into the vcxproj patches.

New artifacts:

  • bun-webkit-linux-amd64-baseline{,-lto}
  • bun-webkit-linux-amd64-musl-baseline{,-lto}
  • bun-webkit-windows-amd64-baseline

Supersedes #137. Related: oven-sh/bun#26071.

Note: ICU is still built with cl.exe (MSBuild). Switching to clang-cl is a follow-up.

Linux x64 was pinned to -march=nehalem for all builds in 596e48e. This
splits that: default entries get -march=haswell (matching bun's non-baseline
target), new -baseline entries keep -march=nehalem.

Windows had no arch pin at all. Both WebKit (clang-cl) and ICU (MSVC cl.exe
via MSBuild) compiled without -march / /arch:, letting the auto-vectorizer
emit AVX2/AVX-512 in ICU's hash and decimal loops with no CPUID gate. Now
windows-release.ps1 takes -Baseline and threads /clang:-march= into CMake
flags; build-icu.ps1 injects /arch: into the .vcxproj patches (/arch:SSE2
for baseline, /arch:AVX2 otherwise).

New artifacts:
  bun-webkit-linux-amd64-baseline{,-lto}
  bun-webkit-linux-amd64-musl-baseline{,-lto}
  bun-webkit-windows-amd64-baseline

Supersedes #137.
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 12f5e726-07a3-4e32-bfc0-b7c197bc8b87

📥 Commits

Reviewing files that changed from the base of the PR and between 164c1fb and 4a1e450.

📒 Files selected for processing (1)
  • mac-release.bash

Walkthrough

Adds baseline build variants across CI and release workflows for Linux, musl, and Windows. Introduces a Baseline switch and architecture flag logic in Windows scripts, updates MARCH_FLAG selection, and adjusts packaging to include baseline artifacts. Also changes mac C++ compiler default to clang++-21.

Changes

Cohort / File(s) Summary
GitHub workflow & release packaging
.github/workflows/build-reusable.yml
Adds baseline matrix entries for Linux (amd64-baseline, baseline-lto), musl (amd64-musl-baseline, baseline-lto), and Windows (amd64-baseline). Updates MARCH_FLAG fallback behavior, downloads/uploads baseline artifacts, and includes baseline variants in rename/output packaging and release tarballs.
Windows release script
windows-release.ps1
Adds [switch]$Baseline parameter; computes MarchFlag based on Platform and Baseline (uses baseline/Haswell/ARM64 logic); replaces hardcoded march flags in CMake flags with computed MarchFlag; passes Baseline through ICU build invocation.
ICU build script
build-icu.ps1
Adds [switch]$Baseline parameter; computes ArchFlag (e.g., /arch:SSE2 for x64 baseline, /arch:AVX2 otherwise) and injects it into patched ICU vcxproj ClCompile AdditionalOptions when set.
macOS build change
mac-release.bash
Changes default CMAKE_CXX_COMPILER selection from clang++ to clang++-21 when not explicitly set.
🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides detailed explanation of the changes but does not follow the required template structure (no bug reference, no Bugzilla link, no formal template formatting). Follow the repository's PR template: include a Bugzilla bug reference/link, use the specified format with 'Reviewed by' section, and list changed files with function/class changes as required.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding x64 baseline WebKit builds for both Linux and Windows platforms with new artifact variants.

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


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build-icu.ps1`:
- Around line 117-119: The current insertion always appends a new
<AdditionalOptions> node via the $content -replace using $ArchFlag, which
duplicates /arch: values on repeated runs; modify the patch logic (the block
that checks $ArchFlag and updates $content) to be idempotent by detecting an
existing <AdditionalOptions> element and either updating any existing /arch:
token to the new $ArchFlag or replacing the whole AdditionalOptions value, and
only inserting a new <AdditionalOptions> element when none exists; ensure the
implementation targets the same pattern currently matched and preserves other
%(AdditionalOptions) entries while removing or replacing any prior /arch:
setting so rerunning the script does not accumulate multiple /arch: flags.

In `@windows-release.ps1`:
- Around line 46-52: Add a guard that fails fast when the Baseline switch is set
but the Platform is not x64: check $Baseline together with $Platform and if
$Baseline is true and $Platform is not "x64" (e.g., equals "ARM64") write an
error and exit with a non‑zero code instead of silently falling through; update
the logic around the $Platform/$Baseline decision that currently sets $MarchFlag
to ensure you validate $Baseline first (referencing the $Platform, $Baseline and
$MarchFlag variables) so misconfiguration is rejected immediately.

ℹ️ Review info
Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6f621466-a6e0-4f75-9c05-3d153579f45a

📥 Commits

Reviewing files that changed from the base of the PR and between 5197a6a and 164c1fb.

📒 Files selected for processing (3)
  • .github/workflows/build-reusable.yml
  • build-icu.ps1
  • windows-release.ps1

Comment on lines +117 to +119
if ($ArchFlag) {
$content = $content -replace '(<ClCompile>)', "`$1`n <AdditionalOptions>$ArchFlag %(AdditionalOptions)</AdditionalOptions>"
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Make the vcxproj arch patch idempotent.

Line [118] always inserts a new <AdditionalOptions> node. Re-running in the same output tree can accumulate conflicting /arch: values.

♻️ Proposed fix
-    if ($ArchFlag) {
-        $content = $content -replace '(<ClCompile>)', "`$1`n      <AdditionalOptions>$ArchFlag %(AdditionalOptions)</AdditionalOptions>"
-    }
+    if ($ArchFlag) {
+        if ($content -match '/arch:(SSE2|AVX2)') {
+            $content = $content -replace '/arch:(SSE2|AVX2)', $ArchFlag
+        } else {
+            $content = $content -replace '(<ClCompile>)', "`$1`n      <AdditionalOptions>$ArchFlag %(AdditionalOptions)</AdditionalOptions>"
+        }
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ($ArchFlag) {
$content = $content -replace '(<ClCompile>)', "`$1`n <AdditionalOptions>$ArchFlag %(AdditionalOptions)</AdditionalOptions>"
}
if ($ArchFlag) {
if ($content -match '/arch:(SSE2|AVX2)') {
$content = $content -replace '/arch:(SSE2|AVX2)', $ArchFlag
} else {
$content = $content -replace '(<ClCompile>)', "`$1`n <AdditionalOptions>$ArchFlag %(AdditionalOptions)</AdditionalOptions>"
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build-icu.ps1` around lines 117 - 119, The current insertion always appends a
new <AdditionalOptions> node via the $content -replace using $ArchFlag, which
duplicates /arch: values on repeated runs; modify the patch logic (the block
that checks $ArchFlag and updates $content) to be idempotent by detecting an
existing <AdditionalOptions> element and either updating any existing /arch:
token to the new $ArchFlag or replacing the whole AdditionalOptions value, and
only inserting a new <AdditionalOptions> element when none exists; ensure the
implementation targets the same pattern currently matched and preserves other
%(AdditionalOptions) entries while removing or replacing any prior /arch:
setting so rerunning the script does not accumulate multiple /arch: flags.

Comment on lines +46 to +52
if ($Platform -eq "ARM64") {
$MarchFlag = "/clang:-march=armv8-a+crc /clang:-mtune=ampere1"
} elseif ($Baseline) {
$MarchFlag = "/clang:-march=nehalem"
} else {
$MarchFlag = "/clang:-march=haswell"
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Fail fast when -Baseline is used on non-x64 targets.

Right now, -Baseline on ARM64 is silently ignored. A guard would prevent accidental misconfiguration.

💡 Proposed guard
 $env:CC = "clang-cl"
 $env:CXX = "clang-cl"
 
+if ($Baseline -and $Platform -ne "x64") {
+    throw "-Baseline is only supported for x64 builds."
+}
+
 if ($Platform -eq "ARM64") {
     $MarchFlag = "/clang:-march=armv8-a+crc /clang:-mtune=ampere1"
 } elseif ($Baseline) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ($Platform -eq "ARM64") {
$MarchFlag = "/clang:-march=armv8-a+crc /clang:-mtune=ampere1"
} elseif ($Baseline) {
$MarchFlag = "/clang:-march=nehalem"
} else {
$MarchFlag = "/clang:-march=haswell"
}
$env:CC = "clang-cl"
$env:CXX = "clang-cl"
if ($Baseline -and $Platform -ne "x64") {
throw "-Baseline is only supported for x64 builds."
}
if ($Platform -eq "ARM64") {
$MarchFlag = "/clang:-march=armv8-a+crc /clang:-mtune=ampere1"
} elseif ($Baseline) {
$MarchFlag = "/clang:-march=nehalem"
} else {
$MarchFlag = "/clang:-march=haswell"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@windows-release.ps1` around lines 46 - 52, Add a guard that fails fast when
the Baseline switch is set but the Platform is not x64: check $Baseline together
with $Platform and if $Baseline is true and $Platform is not "x64" (e.g., equals
"ARM64") write an error and exit with a non‑zero code instead of silently
falling through; update the logic around the $Platform/$Baseline decision that
currently sets $MarchFlag to ensure you validate $Baseline first (referencing
the $Platform, $Baseline and $MarchFlag variables) so misconfiguration is
rejected immediately.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Preview Builds

Commit Release Date
4a1e4502 autobuild-preview-pr-171-4a1e4502 2026-03-05 05:14:36 UTC
164c1fb9 autobuild-preview-pr-171-164c1fb9 2026-03-04 06:00:55 UTC

The C compiler was pinned (clang-21) but the C++ compiler was
unqualified clang++. GH Actions macOS runner image changed between
Feb 24 and Mar 3 so clang++ now resolves to Apple Clang instead of
homebrew LLVM 21.

Apple Clang's libc++ doesn't define _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY,
so LibcxxHashMemoryShim.cpp compiles to an empty object (__TEXT=0).
Bun then fails to link with undefined std::__1::__hash_memory.
@dylan-conway dylan-conway merged commit 1c67da0 into main Mar 5, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant