Repository navigation
[pull] main from oven-sh:main - #7
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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=nehalembuild by removing baseline variants.Bug Fixes
ClassInfofor remaining byte-identical classes (WebAssembly*Constructor,JSTypedArrayViewConstructor,IntlLocaleConstructor, Temporal types,JSRawJSONObject).jscand fails on mergeds_infosymbols; integrated into Linux, musl, Android, FreeBSD, and macOS builds, and installedllvm-nm/llvm-cxxfilton macOS images for reliable symbol parsing.Migration
*-baseline*.tar.gzreferences with the unsuffixed names (e.g., usebun-webkit-linux-amd64.tar.gz).-march=nehalem; remove any Baseline flags/paths in your scripts if present.Written for commit c9296e3. Summary will update on new commits.