Skip to content

[pull] main from oven-sh:main - #7

Merged
pull[bot] merged 4 commits into
coleleavitt:mainfrom
oven-sh:main
Jul 21, 2026
Merged

pull[bot] merged 4 commits into
coleleavitt:mainfrom
oven-sh:main

Conversation

@pull

@pull pull Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )


Summary by cubic

Ensure JSC ClassInfo pointers stay unique to prevent LTO miscompiles, and simplify x64 releases to a single -march=nehalem build by removing baseline variants.

  • Bug Fixes

    • Pinned address-unique ClassInfo for remaining byte-identical classes (WebAssembly*Constructor, JSTypedArrayViewConstructor, IntlLocaleConstructor, Temporal types, JSRawJSONObject).
    • Added a post-link check script that scans jsc and fails on merged s_info symbols; integrated into Linux, musl, Android, FreeBSD, and macOS builds, and installed llvm-nm/llvm-cxxfilt on macOS images for reliable symbol parsing.
  • Migration

    • Only one x64 artifact ships per platform (nehalem floor). Replace any *-baseline*.tar.gz references with the unsuffixed names (e.g., use bun-webkit-linux-amd64.tar.gz).
    • Windows/macOS/Linux/FreeBSD/Android x64 builds now default to -march=nehalem; remove any Baseline flags/paths in your scripts if present.

Written for commit c9296e3. Summary will update on new commits.

Review in cubic

…ild time

Extends the CLASSINFO_KEEP_ADDRESS_UNIQUE sweep to every s_info in JSC that is
byte-identical to a sibling, and adds a post-link check so the next one fails
the build instead of a JS test on one platform months later.

An s_info pair can only fold if all of these match: the name string literal,
&Base::s_info, both static property tables null, InheritsTraits<X>::typeRange,
and everything else CREATE_METHOD_TABLE emits -- sizeof(X),
isResizableOrGrowableSharedTypedArray, and every MethodTable function pointer,
which are equal only when neither class overrides any entry. Applying that test
to the whole tree turns up three groups that were still unpinned:

  - "Function"_s + InternalFunction: the 13 WebAssembly*Constructor classes,
    JSTypedArrayViewConstructor and IntlLocaleConstructor. This is the same
    group as BooleanConstructor and friends.
  - "Object"_s + JSNonFinalObject, size 24: TemporalPlainDate,
    TemporalPlainYearMonth, TemporalPlainMonthDay, TemporalPlainTime. Size 32:
    TemporalPlainDateTime, TemporalInstant.
  - "Object"_s + JSNonFinalObject, size 16: JSRawJSONObject, identical to the
    already-pinned ObjectPrototype and RegExpPrototype. Being identical to a
    pinned class is not protection: ConstantMerge can merge an unnamed_addr
    global onto an address-significant one, not only the other way round.

None of these is broken today, unlike the typed array constructors. They are
all address-significant by accident: their createStructure body happens to sit
in the .cpp and calls info(). Most siblings have already moved createStructure
into an Inlines header, and doing that here would silently remove the
protection, so pin them explicitly.

Add Tools/Scripts/check-classinfo-uniqueness.py, which reads *::s_info out of a
linked binary with nm, groups by address, and fails on any collision with the
demangled names and a pointer at the macro. Wire it into all five build
Dockerfiles and mac-release.bash right after the jsc link.

The script is a canary, not a proof, and says so: it can only see folds that
leave both symbol names at one address, and it inspects jsc rather than the
lib/*.a Bun actually links. What crosses that boundary is the keeper macro plus
-faddrsig. It refuses to pass vacuously -- a symbol count below a floor is an
error, since ~70% of s_info are file-local and a partial strip would otherwise
leave a plausible-looking table. LTO-internalized names (.llvm.<hash>) are
matched and demangled rather than silently dropped. CLASSINFO_UNIQUENESS_CHECK=0
bypasses it while bisecting something unrelated.

The Windows cross lane is not covered: lld-link puts symbols in the PDB, so nm
on jsc.exe would have nothing to compare.

No-Verification-Needed: LTO-only miscompile, reproduces in CI not locally
The bun-webkit-windows-amd64-baseline-lto lane has been building on every run
since it was added, but the release job never collected it: the label is absent
from the download-artifact steps, from the mv list, and from the release asset
list. The build burned CI time and the tarball was discarded with the workflow
artifacts.

That left consumers with no baseline ThinLTO WebKit for Windows, so bun's
windows-x64-baseline release cannot do cross-language LTO -- the exact thing the
lane's own comment says it exists to enable. Linking the haswell -lto artifact
instead is not a substitute: it raises the CPU floor for baseline users.

Wire the artifact through the three places the other Windows variants already
appear.

No-Verification-Needed: CI workflow plumbing, no runtime surface to exercise
WebKit shipped two x64 builds of everything: a haswell one and a nehalem
"-baseline" one. That forced every consumer to choose, and the choice was easy
to get wrong in both directions -- link the default and you silently raise the
CPU requirement for your baseline release, link -baseline and you may find the
variant you need was never published. The Windows -baseline-lto lane was a live
example: it built on every run and the release job never collected it, so
Windows baseline had no ThinLTO WebKit at all.

Drop the second build instead of fixing the plumbing around it. Delete the six
-baseline / -baseline-lto lanes (linux glibc, linux musl, windows) and lower the
single remaining x64 floor to nehalem everywhere:

  - linux glibc and musl: the workflow's -march=haswell default, which was
    overriding the nehalem default already in release.sh / musl-release.sh
  - windows: windows-cross-release.sh, Dockerfile.windows, and the native
    windows-release.ps1 / build-icu.ps1 path
  - macos, freebsd: -march=haswell
  - android: -march=x86-64-v2, near-identical to nehalem in practice

The -Baseline switch and BASELINE env passthrough no longer select anything, so
remove them from windows-release.ps1, build-icu.ps1, and the workflow.

arm64 is untouched.

CONSUMER IMPACT: these release assets no longer exist --

  bun-webkit-linux-amd64-baseline{,-lto}.tar.gz
  bun-webkit-linux-amd64-musl-baseline{,-lto}.tar.gz
  bun-webkit-windows-amd64-baseline.tar.gz

Anything linking them must move to the unsuffixed name, which is now the
nehalem build. A consumer that wants a higher floor for its own code can still
set one; it just no longer gets it inside JSC.

No-Verification-Needed: CI workflow and release scripts, no runtime surface to exercise
The macOS cross job was the only one failing: Linux, musl, Android, FreeBSD and
Windows all passed the new check, macOS died on it and fail-fast cancelled the
other seven macOS variants. With the macos-cross job red the release job never
runs, so no autobuild is published at all.

Two causes, both macOS-specific:

Dockerfile.macos installs no binutils and symlinks only clang, clang++,
ld64.lld, lld, llvm-ar and llvm-ranlib out of the apt.llvm.org install, so there
was no `nm` of any kind on PATH under the unsuffixed name. Add llvm-nm (and
llvm-cxxfilt, so failures print demangled names) to that list; they ship in the
same llvm-N package as the llvm-ar the image already depends on.

Even with binutils present this would have failed, because that job links Mach-O
with ld64.lld on a Linux host and GNU nm cannot read Mach-O. The old probe ran
`nm --version`, which a GNU nm answers happily, and only then discovered it
could not read the file. Select nm by trying candidates against the actual
binary instead: prefer llvm-nm, fall back through the versioned names and the
/usr/lib/llvm*/bin directories, and treat "ran but found no ClassInfo" as the
wrong tool for the object format rather than as a verdict. The error now names
every candidate tried and says why GNU nm is not enough.

The glob makes the symlink redundant on any image where apt.llvm.org put
llvm-nm in /usr/lib/llvm-N/bin, which is belt and braces on purpose -- this
check failing closed takes the whole release with it.

No-Verification-Needed: build-image and CI script fix; script itself exercised end-to-end locally
@pull pull Bot locked and limited conversation to collaborators Jul 21, 2026
@pull pull Bot added the ⤵️ pull label Jul 21, 2026
@pull
pull Bot merged commit c9296e3 into coleleavitt:main Jul 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant