Skip to content

bun: 1.3.14 -> 1.4.2 on llvm-23 (off frozen llvm-21) - #1477

Closed
bryan-minimal wants to merge 5 commits into
mainfrom
bun-1.4.4-llvm23
Closed

bryan-minimal wants to merge 5 commits into
mainfrom
bun-1.4.4-llvm23

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Moves bun off the frozen llvm-21 (pkgs#1339) onto LLVM 23, at bun 1.4.2.

Why 1.4.2 and not 1.4.4: bun 1.4.3 and 1.4.4 (nightly-2026-09-15) call core::mem::type_info::of (bun_collections multi_array_list.rs:321). That function first ships in Rust 1.100.0, and pkgs rust is 1.99.1, so the build-bot run on 942d51e failed with E0425. bun 1.4.0–1.4.2 pin nightly-2026-07-20, which predates the 1.99 beta branch. 1.4.4 has to wait for the pkgs rust 1.100 bump, because it needs core::mem::type_info::of (Rust ≥ 1.100).

LLVM

  • 1.4.2 pins LLVM 21.1.8 (scripts/build/tools.ts, which accepts only 21.1.x). Its documented override is BUN_TOOLCHAIN_LLVM, an LLVM prefix (the directory holding bin/clang). Once it's set, configure looks only in that bin/ and skips the version check. It also turns workarounds.ts's expiry tripwires from errors into warnings.
  • build.sh sets BUN_TOOLCHAIN_LLVM=/usr/lib/llvm-23 and puts its bin/ first on PATH, so CC and the cargo linker use the same clang. It then fails unless all of these hold:
    • clang, clang++, ld.lld, llvm-ar and llvm-ranlib exist there;
    • that clang reports clang version 23.;
    • command -v clang is that clang;
    • tools.ts still reads BUN_TOOLCHAIN_LLVM and still pins 21;
    • rustc's LLVM is 23 (cross-language LTO can't take a rustc LLVM newer than clang's).
  • Imports llvm-23 (prefixed) and nasm. 1.4.2 uses ninja from PATH, so our ninja package runs the build and nothing fetches bun-ninja.

Carried changes, checked against the 1.4.2 tree

  • Rust: rust-toolchain.toml is emptied (it's a ninja input), with a guard that upstream still pins a nightly there. RUSTC_BOOTSTRAP=1 is set, and build.sh checks that rust-src is in the sysroot (-Zbuild-std). 1.4.2 has no Zig, so the zig and lol-html workarounds stay removed.

  • CVE-2026-111943: crypto: update root certificates oven-sh/bun#46159 is not in 1.4.2. Its store is the binary packages/bun-usockets/root_certs.der (u32 count, u32 offsets[count+1], then the DERs). build.sh rewrites that file with the bootstrap bun:

    • it is pinned to 1.4.2's file sha256 c17ba7ff…4a29;
    • it drops exactly the three emSign DERs, matched by sha256, so 121 roots become 118;
    • it removes their labels from root_certs.txt.

    I checked the filter locally on a copy of the 1.4.2 file: the other 118 entries are identical and in order, and a second run on the already-filtered file fails. The control is once again the stock bootstrap bun, which must fail the check and name all three roots. The built binary is still fingerprinted.

  • system-ca-store-default.patch, re-ported: 1.4.2 still has Bun__Node__CAStore (Bundled/Openssl/System) in src/runtime/cli/Arguments.rs, so the patch flips its default to System, as on 1.3.14. root_certs.cpp is byte-identical between 1.4.2 and 1.4.4, so its hunk is the same as in the 1.4.4 port. The patch applies cleanly to bun-v1.4.2 and is rejected by 1.4.4. Every grep guard passes on the patched tree.

Hashes (verified)

  • Source bun-v1.4.2: e14670b117d69012d828514d657f0a3133d1c25d13d69461184d05b6a8e9a876 (codeload refs/tags/bun-v1.4.2, top directory bun-bun-v1.4.2/).
  • bun-linux-x64.zip: 36368faef7527875d5ffa52e53cd48021741f2a83eb6208a8dd64068d422a913. bun-linux-aarch64.zip: 54328bbc2d9c8e0c9f892c544d66c57a83b84139e34909e5ee81758f1ac8fda7. Both match the release's SHASUMS256.txt.

All URLs are upstream GitHub, so there's nothing to mirror.

What 1.4.3/1.4.4 fix that we don't get yet

Upstream's release notes mark nothing as a security fix. Going by commit titles in bun-v1.4.2..bun-v1.4.4, these are the security-relevant ones:

  • #36230 node:http2: per-connection stream-reset rate limit (CVE-2023-44487 Rapid Reset, CVE-2025-8671 MadeYouReset).
  • #46300 tls: reject chains containing blocked public keys, and roots updated to NSS 3.131.1. #46159 updated the roots; our emSign drop covers only its CVE-2026-111943 part.
  • #44290 node:tls: check the server's name for a handshake that completes after end().
  • #4b02e1031d --hot: a use-after-free of the entry point's promise (dev mode).
  • The TLS robustness series: #44618, #46335, #45422, #45139 and others.

Risks (nothing built locally)

  • Clang 23 runs against a tree written for 21. New clang warnings or diagnostics could break it. The fix would be a carried flag or patch, not a pin.
  • Stable rust 1.99.1 with RUSTC_BOOTSTRAP=1 is building code written for nightly-2026-07-20.

Follow-ups (pkgmgr-rs)

  • data/series_pins.toml [bun] series = "1.3": change it to 1.4.2 (exact), with "until rust ≥ 1.100" as the reason.
  • data/pkgs_fixtures.toml tracks packages/bun/build.ncl, so fixture drift will flag it.

Rebuilds: bun plus hunk, opencode and plannotator.

🤖 Generated with Claude Code

bun 1.4 pins LLVM 23.1.x (scripts/build/ci-images/spec.ts; tools.ts accepts
>=23.1.0 <23.1.99) and is a Rust rewrite with no Zig left, so the recipe
moves to the prefixed llvm-23 and its 1.3.x workarounds are retired:

- build.sh: /usr/lib/llvm-23/bin first on PATH, guarded on clang 23.1.x, on
  spec.ts's pinned LLVM still being 23.1.x, and on rustc's LLVM being 23
  (bun's configure refuses a clang/rustc LLVM-major mismatch).
- build.sh: bun 1.4 needs a nightly (#![feature] gates, -Zbuild-std always).
  Keep removing rust-toolchain.toml, set RUSTC_BOOTSTRAP=1 so minimal's
  stable rust accepts them, and check rust-src is in the sysroot.
- Dropped the lol-html -Zbuild-std sed (lol-html is a workspace crate now)
  and the arm64 zig codegen-shard cap (no Zig in 1.4).
- CVE-2026-111943: oven-sh/bun#46159 is in 1.4.x, so the emSign patch is
  dropped. build.sh checks root_certs.txt and still fingerprints the built
  binary; the negative control is now the check with ISRG Root X1 swapped in,
  since the stock bootstrap bun no longer bundles the emSign roots.
- system-ca-store-default.patch: ported to 1.4.4 (Global.rs + the lazy-set
  root_certs.cpp), same behaviour. oven-sh/bun#46542 is not in 1.4.4.
- build:release timeout 60 -> 120 min: every Rust crate and std now compile
  from source and there is no 1.4 build-bot timing yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

bryan-minimal and others added 3 commits November 12, 2026 19:42
…chain")

bun 1.4's own build assembles libjpeg-turbo's x86_64 SIMD sources with nasm
(scripts/build/deps/libjpeg-turbo.ts, compile.ts nasm()). 1.3.x did not need
it. The rest of 1.4.4's required tools (cmake, perl, GNU strip, git, unzip,
tar, the LLVM tools, rustc/cargo) are already in the closure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…put)

build-bot on 5748e42: "ninja: error: rebuilding 'build.ninja':
'../../rust-toolchain.toml', needed by 'rust-target/plan.json', missing and
no known rule to make it". bun 1.4's scripts/build/rust.ts lists the file
among the plan edge's inputs. Its only other use is reading `channel` into
RUSTUP_TOOLCHAIN, which an empty file skips. A guard fails the build if
upstream stops pinning a nightly there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-bot on 942d51e failed in bun_collections: `core::mem::type_info::of`
(multi_array_list.rs:321) first ships in Rust 1.100.0, and pkgs rust is
1.99.1. bun 1.4.3/1.4.4 pin nightly-2026-09-15 and use it; 1.4.0-1.4.2 pin
nightly-2026-07-20, which predates the 1.99 beta branch.

- version 1.4.2, verified source + bootstrap zip sha256s (the zips match the
  release's SHASUMS256.txt).
- LLVM: 1.4.2 pins 21.1.x. build.sh sets its documented override
  BUN_TOOLCHAIN_LLVM=/usr/lib/llvm-23 (an LLVM prefix; configure then looks
  only in its bin/ and skips the version check), puts the same bin/ first on
  PATH, and fails unless clang there reports 23.*, `command -v clang` is that
  clang, tools.ts still reads the variable and still pins 21.
- CVE-2026-111943: oven-sh/bun#46159 is not in 1.4.2, which embeds the store
  as the binary root_certs.der. build.sh rewrites it with the bootstrap bun
  (pinned to 1.4.2's file sha256), dropping exactly the three emSign DERs by
  sha256 (121 -> 118), and their labels from root_certs.txt. The control is the
  stock bootstrap bun again (it still bundles all three).
- system-ca-store-default.patch re-ported: 1.4.2 still has Arguments.rs's
  Bun__Node__CAStore (Bundled/Openssl/System), so its default flips to System
  as on 1.3.14; root_certs.cpp (identical in 1.4.2 and 1.4.4) reads it.
- 1.4.2 uses ninja from PATH (our ninja package): no bun-ninja fetch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal bryan-minimal changed the title bun: 1.3.14 -> 1.4.4 on llvm-23 (off frozen llvm-21) bun: 1.3.14 -> 1.4.2 on llvm-23 (off frozen llvm-21) Nov 13, 2026
build-bot: highway_strings.cpp:2628 'alias and aliasee have different types'
[-Werror,-Wattribute-alias]. bun-v1.4.4 (oven-sh/bun 38afee6) replaced the
alias with a forwarding definition; carry that hunk for 1.4.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

Superseded by #1492 (bun 1.4.4, green on build-bot, fixes the 3 HIGHs that 1.4.2 does not).

1.4.2 on clang 23 also needs C++ fixes (-Wattribute-alias on memmem, then "void lambda should not return a value" in JSCommonJSModule.cpp/JSMockFunction.cpp) that upstream made inside large 1.4.4 rewrites, so there is no reason to keep carrying it.

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