diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile index f2bcac12a6b4..9c0ee515c6b1 100644 --- a/.buildkite/Dockerfile +++ b/.buildkite/Dockerfile @@ -1,5 +1,5 @@ -ARG LLVM_VERSION="21" -ARG REPORTED_LLVM_VERSION="21.1.8" +ARG LLVM_VERSION="22" +ARG REPORTED_LLVM_VERSION="22.1.8" ARG OLD_BUN_VERSION="1.3.13" ARG BUILDKITE_AGENT_TAGS="queue=linux,os=linux,arch=${TARGETARCH}" diff --git a/.buildkite/ci.mjs b/.buildkite/ci.mjs index 934901512c0b..6aac5710f723 100755 --- a/.buildkite/ci.mjs +++ b/.buildkite/ci.mjs @@ -8,9 +8,9 @@ import { join } from "node:path"; import { getBootstrapVersion, + getBranchImageSuffix, getBuildkiteEmoji, getBuildMetadata, - getBuildNumber, getCanaryRevision, getCommitMessage, getEmoji, @@ -194,8 +194,8 @@ const testPlatforms = [ { os: "linux", arch: "x64", profile: "asan", distro: "debian", release: "13", tier: "latest" }, { os: "linux", arch: "aarch64", distro: "ubuntu", release: "25.04", tier: "latest" }, { os: "linux", arch: "x64", distro: "ubuntu", release: "25.04", tier: "latest" }, - { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.23", tier: "latest" }, - { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.23", tier: "latest" }, + { os: "linux", arch: "aarch64", abi: "musl", distro: "alpine", release: "3.24", tier: "latest" }, + { os: "linux", arch: "x64", abi: "musl", distro: "alpine", release: "3.24", tier: "latest" }, { os: "windows", arch: "x64", release: "2019", tier: "oldest" }, { os: "windows", arch: "aarch64", release: "11", tier: "latest" }, ]; @@ -272,7 +272,7 @@ function getImageLabel(platform) { */ function getImageName(platform, options) { const { os, distro, crossCompile } = platform; - const { buildImages, publishImages, imageFilter } = options; + const { buildImages, publishImages, imageFilter, changedFiles = [] } = options; const name = getImageKey(platform); @@ -285,7 +285,15 @@ function getImageName(platform, options) { const hostOs = os === "freebsd" || crossCompile ? "linux" : os; if (buildImages && !publishImages && (!imageFilter || hostOs === imageFilter || distro === imageFilter)) { - return `${name}-build-${getBuildNumber()}`; + return `${name}-${getBranchImageSuffix()}`; + } + + // Not a [build images] push: if this PR changes the bootstrap script for + // this host OS, the published -vN won't match what it needs. Request the + // branch-scoped image a prior [build images] push on this branch baked. + const bootstrapFile = hostOs === "windows" ? "scripts/bootstrap.ps1" : "scripts/bootstrap.sh"; + if (!publishImages && !isMainBranch() && changedFiles.includes(bootstrapFile)) { + return `${name}-${getBranchImageSuffix()}`; } return `${name}-v${getBootstrapVersion(hostOs)}`; @@ -681,7 +689,7 @@ function hasWebKitChanges(options) { function getVerifyBaselineHost(platform) { const { os, arch, abi } = platform; if (os === "windows") return { os: "windows", arch, release: "2019" }; - if (abi === "musl") return { os: "linux", arch, abi: "musl", distro: "alpine", release: "3.23" }; + if (abi === "musl") return { os: "linux", arch, abi: "musl", distro: "alpine", release: "3.24" }; return { os: "linux", arch, distro: "debian", release: "13" }; } @@ -843,8 +851,11 @@ function getTestBunStep(platform, options, testOptions = {}) { * 1. Edit bootstrap.sh / bootstrap.ps1 and bump its `# Version:` line. * 2. Open a PR whose **commit subject** contains `[build images]` (or * `[build linux images]` / `[build windows images]` to scope it). This - * bakes throwaway `…-build-` images and runs the full + * bakes throwaway `…-branch-` images and runs the full * build+test pipeline against them so you can verify the change. + * Subsequent pushes on the same branch reuse those images (because + * changedFiles includes the bootstrap script), so you can iterate + * without `[build images]` unless you change bootstrap.* again. * 3. Once green, amend/force-push the subject to `[publish images]` (or the * scoped variant). This bakes the real `…-vN` images that normal CI will * pick up. Publishing replaces the live tag in place — for Windows it diff --git a/.github/workflows/CLAUDE.md b/.github/workflows/CLAUDE.md index 0a6214139973..2c1b002b1fb4 100644 --- a/.github/workflows/CLAUDE.md +++ b/.github/workflows/CLAUDE.md @@ -38,9 +38,9 @@ The workflow runs all three formatters simultaneously: #### 3. Tool Installation -##### Clang-format-21 +##### Clang-format-22 -- Installs ONLY `clang-format-21` package (not the entire LLVM toolchain) +- Installs ONLY `clang-format-22` package (not the entire LLVM toolchain) - Uses `--no-install-recommends --no-install-suggests` to skip unnecessary packages - Quiet installation with `-qq` and `-o=Dpkg::Use-Pty=0` @@ -97,7 +97,7 @@ The workflow runs all three formatters simultaneously: ```bash # Test the clang-format script -export LLVM_VERSION_MAJOR=19 +export LLVM_VERSION_MAJOR=22 ./scripts/run-clang-format.sh format # Test with check mode (no modifications) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index bd4d9f672f6e..fd995e7d813c 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -24,7 +24,7 @@ on: env: BUN_VERSION: "1.3.2" - LLVM_VERSION_MAJOR: "21" + LLVM_VERSION_MAJOR: "22" # Pin the toolchain explicitly so rustup ignores rust-toolchain.toml's # `targets` list (11 cross triples ≈ 450 MB of prebuilt std we don't need # to lint the host). Keep in sync with `channel` in rust-toolchain.toml. @@ -49,7 +49,7 @@ jobs: bun-version: ${{ env.BUN_VERSION }} - name: Setup system deps - # cmake/ninja for `--configure-only`; clang-21 for toolchain detection + # cmake/ninja for `--configure-only`; clang-22 for toolchain detection # (configure resolves cfg.cc/cxx even though we won't compile C++). run: | wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9dfbb49cb8fb..13467ea6cc0b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,8 +10,8 @@ on: merge_group: env: BUN_VERSION: "1.3.2" - LLVM_VERSION: "21.1.8" - LLVM_VERSION_MAJOR: "21" + LLVM_VERSION: "22.1.8" + LLVM_VERSION_MAJOR: "22" jobs: autofix: diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml index 6a71a0e306e0..890778fb6c95 100644 --- a/.github/workflows/miri.yml +++ b/.github/workflows/miri.yml @@ -34,7 +34,7 @@ on: env: BUN_VERSION: "1.3.2" - LLVM_VERSION_MAJOR: "21" + LLVM_VERSION_MAJOR: "22" # Pin so rustup ignores rust-toolchain.toml's `targets` list (11 cross # triples ≈ 450 MB we don't need). Keep in sync with `channel` there. RUSTUP_TOOLCHAIN: nightly-2026-07-20 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc351d4cb90f..8b56f142b2af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ $ sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config ``` ```bash#Fedora -$ sudo dnf install clang21 llvm21 lld21 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)' +$ sudo dnf install clang22 llvm22 lld22 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)' ``` ```bash#openSUSE Tumbleweed @@ -94,17 +94,17 @@ Our build scripts will automatically detect and use `ccache` if available. You c ## Install LLVM -Bun requires LLVM 21.1.8 (`clang` is part of LLVM). This version is enforced by the build system — mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager: +Bun requires LLVM 22.1.8 (`clang` is part of LLVM). This version is enforced by the build system — mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager: {% codetabs group="os" %} ```bash#macOS (Homebrew) -$ brew install llvm@21 +$ brew install llvm@22 ``` ```bash#Ubuntu/Debian $ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu -$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 21 all +$ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 22 all ``` ```bash#Arch @@ -116,17 +116,17 @@ $ sudo dnf install llvm clang lld-devel ``` ```bash#openSUSE Tumbleweed -$ sudo zypper install clang21 lld21 llvm21 +$ sudo zypper install clang22 lld22 llvm22 ``` {% /codetabs %} -If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.8). +If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8). -Make sure Clang/LLVM 21 is in your path: +Make sure Clang/LLVM 22 is in your path: ```bash -$ which clang-21 +$ which clang-22 ``` If not, run this to manually add it: @@ -135,13 +135,13 @@ If not, run this to manually add it: ```bash#macOS (Homebrew) # use fish_add_path if you're using fish -# use path+="$(brew --prefix llvm@21)/bin" if you are using zsh -$ export PATH="$(brew --prefix llvm@21)/bin:$PATH" +# use path+="$(brew --prefix llvm@22)/bin" if you are using zsh +$ export PATH="$(brew --prefix llvm@22)/bin:$PATH" ``` ```bash#Arch # use fish_add_path if you're using fish -$ export PATH="$PATH:/usr/lib/llvm21/bin" +$ export PATH="$PATH:/usr/lib/llvm22/bin" ``` {% /codetabs %} @@ -318,7 +318,7 @@ The issue may manifest when initially running `bun setup` as Clang being unable ``` The C++ compiler - "/usr/bin/clang++-21" + "/usr/bin/clang++-22" is not able to compile a simple test program. ``` diff --git a/docs/project/building-windows.mdx b/docs/project/building-windows.mdx index f170574ff770..c6958cb242a4 100644 --- a/docs/project/building-windows.mdx +++ b/docs/project/building-windows.mdx @@ -33,7 +33,7 @@ winget install "Visual Studio Community 2022" --override "--add Microsoft.Visual After Visual Studio, you need the following: -- LLVM 21.1.8 +- LLVM 22.1.8 - Go - Rust (via rustup) - NASM @@ -49,15 +49,15 @@ Use [Scoop](https://scoop.sh) to install these remaining tools. irm https://get.scoop.sh | iex scoop install nodejs-lts go rustup nasm ruby perl ccache # scoop seems to be buggy if you install llvm and the rest at the same time -scoop install llvm@21.1.8 +scoop install llvm@22.1.8 ``` -For Windows ARM64, download LLVM 21.1.8 directly from GitHub releases (first version with ARM64 Windows builds): +For Windows ARM64, download LLVM 22.1.8 directly from GitHub releases: ```ps1 ARM64 # Download and install LLVM for ARM64 -Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/LLVM-21.1.8-woa64.exe" -OutFile "$env:TEMP\LLVM-21.1.8-woa64.exe" -Start-Process -FilePath "$env:TEMP\LLVM-21.1.8-woa64.exe" -ArgumentList "/S" -Wait +Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/LLVM-22.1.8-woa64.exe" -OutFile "$env:TEMP\LLVM-22.1.8-woa64.exe" +Start-Process -FilePath "$env:TEMP\LLVM-22.1.8-woa64.exe" -ArgumentList "/S" -Wait ``` diff --git a/docs/project/contributing.mdx b/docs/project/contributing.mdx index daefc25cf170..22fed5d76881 100644 --- a/docs/project/contributing.mdx +++ b/docs/project/contributing.mdx @@ -37,7 +37,7 @@ sudo pacman -S base-devel cmake git go libiconv libtool make ninja pkg-config py ``` ```bash Fedora -sudo dnf install clang21 llvm21 lld21 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)' +sudo dnf install clang22 llvm22 lld22 cmake git golang libtool ninja-build pkg-config ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)' ``` ```bash openSUSE Tumbleweed @@ -96,17 +96,17 @@ The build scripts detect and use `ccache` automatically if it's available. Check ## Install LLVM -Bun requires LLVM 21.1.8 (`clang` is part of LLVM). The build system enforces this version: a mismatched version causes memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager: +Bun requires LLVM 22.1.8 (`clang` is part of LLVM). The build system enforces this version: a mismatched version causes memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager: ```bash macOS (Homebrew) -brew install llvm@21 +brew install llvm@22 ``` ```bash Ubuntu/Debian # LLVM has an automatic installation script that is compatible with all versions of Ubuntu -wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 21 all +wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 22 all ``` ```bash Arch @@ -118,17 +118,17 @@ sudo dnf install llvm clang lld-devel ``` ```bash openSUSE Tumbleweed -sudo zypper install clang21 lld21 llvm21 +sudo zypper install clang22 lld22 llvm22 ``` -If none of these work, install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.8). +If none of these work, install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8). -Make sure Clang/LLVM 21 is in your path: +Make sure Clang/LLVM 22 is in your path: ```bash -which clang-21 +which clang-22 ``` If not, add it manually: @@ -137,13 +137,13 @@ If not, add it manually: ```bash macOS (Homebrew) # use fish_add_path if you're using fish -# use path+="$(brew --prefix llvm@21)/bin" if you are using zsh -export PATH="$(brew --prefix llvm@21)/bin:$PATH" +# use path+="$(brew --prefix llvm@22)/bin" if you are using zsh +export PATH="$(brew --prefix llvm@22)/bin:$PATH" ``` ```bash Arch # use fish_add_path if you're using fish -export PATH="$PATH:/usr/lib/llvm21/bin" +export PATH="$PATH:/usr/lib/llvm22/bin" ``` @@ -322,7 +322,7 @@ The issue may also surface when first running `bun run build`, with Clang unable ```txt The C++ compiler - "/usr/bin/clang++-21" + "/usr/bin/clang++-22" is not able to compile a simple test program. ``` diff --git a/flake.nix b/flake.nix index 38667c11dfb3..a7c3588863cd 100644 --- a/flake.nix +++ b/flake.nix @@ -26,10 +26,10 @@ }; }; - # LLVM 21 - matching the bootstrap script (targets 21.1.8, actual version from nixpkgs-unstable) - llvm = pkgs.llvm_21; - clang = pkgs.clang_21; - lld = pkgs.lld_21; + # LLVM 22 - matching the bootstrap script (targets 22.1.8, actual version from nixpkgs-unstable) + llvm = pkgs.llvm_22; + clang = pkgs.clang_22; + lld = pkgs.lld_22; # Node.js 26 - matching the bootstrap script (targets 26.3.0, actual version from nixpkgs-unstable) nodejs = pkgs.nodejs_26; @@ -42,7 +42,7 @@ pkgs.pkg-config pkgs.ccache - # Compilers and toolchain - version pinned to LLVM 21 + # Compilers and toolchain - version pinned to LLVM 22 clang llvm lld diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 42776496a344..a470fb314d54 100755 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -1,4 +1,4 @@ -# Version: 22 +# Version: 24 # A script that installs the dependencies needed to build and test Bun on Windows. # Supports both x64 and ARM64 using Scoop for package management. # Used by Azure [build images] pipeline. @@ -256,7 +256,7 @@ function Install-CMake { } function Install-Llvm { - $LLVM_VERSION = "21.1.8" + $LLVM_VERSION = "22.1.8" if (Which clang-cl) { return } diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 5509db83838e..2b8aa670b9da 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Version: 41 +# Version: 42 # A script that installs the dependencies needed to build and test Bun. # This should work on macOS and Linux with a POSIX shell. @@ -1174,7 +1174,7 @@ is_ci_build_host() { } llvm_version_exact() { - print "21.1.8" + print "22.1.8" } llvm_version() { @@ -1194,6 +1194,12 @@ install_llvm() { bash="$(require bash)" llvm_script="$(download_file "https://apt.llvm.org/llvm.sh")" + # apt.llvm.org stopped publishing focal arm64 binaries for the 22 + # release (binary-arm64 has only the Architecture:all packages); no CI + # lane runs bootstrap.sh on focal arm64, so fail clearly here. + if [ "$arch" = "aarch64" ] && [ "$release" = "20.04" ]; then + error "apt.llvm.org has no focal arm64 packages for LLVM $(llvm_version). Use a newer Ubuntu (22.04+) on arm64." + fi execute_sudo "$bash" "$llvm_script" "$(llvm_version)" all # Install llvm-symbolizer explicitly to ensure it's available for ASAN @@ -1206,12 +1212,16 @@ install_llvm() { install_packages "llvm@$(llvm_version)" ;; apk) + # alpine 3.24 ships clang22/llvm22/lld22 at 22.1.3; edge has 22.1.8. + # Tag the edge main repo so only the llvm packages come from there + # (musl is the same version in both, so edge's binaries run on 3.24). + append_file /etc/apk/repositories "@edge https://dl-cdn.alpinelinux.org/alpine/edge/main" install_packages \ - "llvm$(llvm_version)" \ - "clang$(llvm_version)" \ - "scudo-malloc" \ - "lld$(llvm_version)" \ - "llvm$(llvm_version)-dev" # Ensures llvm-symbolizer is installed + "llvm$(llvm_version)@edge" \ + "clang$(llvm_version)@edge" \ + "lld$(llvm_version)@edge" \ + "llvm$(llvm_version)-dev@edge" \ + "scudo-malloc" ;; esac } @@ -1265,7 +1275,7 @@ install_gcc() { ;; esac - llvm_v="21" + llvm_v="22" append_to_profile "export CC=clang-${llvm_v}" append_to_profile "export CXX=clang++-${llvm_v}" @@ -1545,7 +1555,7 @@ install_linux_glibc_sysroot() { alpine_sysroot_version() { # Keep in sync with the alpine release testPlatforms runs on. - print "3.23" + print "3.24" } install_linux_musl_sysroot() { diff --git a/scripts/build/config.ts b/scripts/build/config.ts index 62a91376f6e7..6f1f49d50efe 100644 --- a/scripts/build/config.ts +++ b/scripts/build/config.ts @@ -830,10 +830,8 @@ export function resolveConfig(partial: PartialConfig, toolchain: Toolchain): Con // LLVM, so it reads both rustc's bitcode (same version) and clang's // (older, hence readable). Swap it in as `ld` for the whole build — // it's a stock lld, just newer, so non-LTO objects and nested cmake - // deps link the same as before. - // - // Tracked in workarounds.ts ("rust-lld-for-crosslang-lto") so this - // branch self-obsoletes once clang's LLVM catches up to rustc's. + // deps link the same as before. Dormant while clang's LLVM major + // matches rustc's (the `rustLlvmMajor > clangMajor` gate). let ld = toolchain.ld; const clangMajor = majorOf(toolchain.clangVersion); const rustLlvmMajor = majorOf(toolchain.rustLlvmVersion); @@ -1131,12 +1129,12 @@ export function resolveConfig(partial: PartialConfig, toolchain: Toolchain): Con osxSysroot = resolveMacosSdkPath(partial.macosSdk, cacheDir, cwd); if (toolchain.ld64Lld === undefined) { throw new BuildError("Cross-compiling for macOS requires ld64.lld (lld's Mach-O port)", { - hint: "Install lld for the same LLVM version as clang: apt install lld-21 (or equivalent).", + hint: "Install lld for the same LLVM version as clang: apt install lld-22 (or equivalent).", }); } if (toolchain.llvmStrip === undefined) { throw new BuildError("Cross-compiling for macOS requires llvm-strip (GNU strip can't read Mach-O)", { - hint: "Install llvm for the same version as clang: apt install llvm-21 (or equivalent).", + hint: "Install llvm for the same version as clang: apt install llvm-22 (or equivalent).", }); } if (toolchain.clangResourceDir === undefined) { @@ -1146,7 +1144,7 @@ export function resolveConfig(partial: PartialConfig, toolchain: Toolchain): Con } if (toolchain.dsymutil === undefined) { throw new BuildError("Cross-compiling for macOS requires LLVM dsymutil", { - hint: "Install llvm for the same version as clang: apt install llvm-21 (or equivalent).", + hint: "Install llvm for the same version as clang: apt install llvm-22 (or equivalent).", }); } // The Mach-O flavor of whichever lld the rest of the config picked. diff --git a/scripts/build/deps/webkit.ts b/scripts/build/deps/webkit.ts index e50f02454d23..7217e297e3bc 100644 --- a/scripts/build/deps/webkit.ts +++ b/scripts/build/deps/webkit.ts @@ -8,7 +8,7 @@ // importing), every x64 at the nehalem floor (no separate -baseline variant), // typed-array constructor ClassInfo kept address-unique under LTO, and the // Windows ICU data table filtered + per-item zstd compressed. -export const WEBKIT_VERSION = "c9296e353e365ecf0de82f273bb0a88a3df465be"; +export const WEBKIT_VERSION = "autobuild-preview-pr-296-6144f510"; /** * WebKit (JavaScriptCore) — the JS engine. diff --git a/scripts/build/rules.ts b/scripts/build/rules.ts index e195b139eb10..96981381fd97 100644 --- a/scripts/build/rules.ts +++ b/scripts/build/rules.ts @@ -52,6 +52,6 @@ export function registerAllRules(n: Ninja, cfg: Config): void { // rust_build registerRustRules(n, cfg); - // shim_dylib (darwin+asan only) + // shim_cc / host_tool_cc / shim_crt_decompress registerShimRules(n, cfg); } diff --git a/scripts/build/rust.ts b/scripts/build/rust.ts index 7ceb5cc20653..cd19114c4f7b 100644 --- a/scripts/build/rust.ts +++ b/scripts/build/rust.ts @@ -570,7 +570,7 @@ export function emitRust(n: Ninja, cfg: Config, inputs: RustBuildInputs): string // LLVM bitcode is forward-compatible (newer reads older), so this works // when the linker's LLVM ≥ rustc's bundled LLVM. resolveConfig() swaps // `cfg.ld` to rustc's bundled rust-lld when rustc's LLVM major is ahead - // of clang's — see workarounds.ts "rust-lld-for-crosslang-lto". + // of clang's (see the wantRustLld swap in config.ts). rustflags.push("-Clinker-plugin-lto"); rustflags.push("-Cembed-bitcode=yes"); // EnableSplitLTOUnit consistency: lld errors with "inconsistent LTO Unit diff --git a/scripts/build/shims.ts b/scripts/build/shims.ts index f446d97f4d93..2dbad037348a 100644 --- a/scripts/build/shims.ts +++ b/scripts/build/shims.ts @@ -25,8 +25,6 @@ export interface ShimLinkOpts { implicitInputs: string[]; } -const ASAN_DYLD_SHIM = "asan-dyld-shim.dylib"; - /** * macOS-from-Linux cross links need a post-link fixup pass over every * Mach-O executable they produce (the linked bun-profile/bun-debug AND the @@ -160,17 +158,6 @@ const MUSL_CRT_OBJECTS = ["Scrt1.o", "crt1.o", "crti.o", "crtn.o"]; export function registerShimRules(n: Ninja, cfg: Config): void { const q = (p: string) => quote(p, false); - if (cfg.darwin && cfg.asan) { - // -install_name @rpath/ so dyld resolves it next to the - // executable via the -rpath @executable_path we add at link time. - // __DATA,__interpose only works from dylibs (not object files linked - // into the main binary), hence -dynamiclib. - n.rule("shim_dylib", { - command: `${q(cfg.cc)} -dynamiclib -O2 -install_name @rpath/$name -o $out $in`, - description: "shim $name", - }); - } - if (needsDarwinCpuModelShim(cfg)) { // Plain object compiled for the cross target; $flags carries // --target/-isysroot/-mmacosx-version-min from emitShims(). @@ -247,20 +234,6 @@ export function emitShims(n: Ninja, cfg: Config): ShimLinkOpts { implicitInputs.push(out); } - if (cfg.darwin && cfg.asan) { - // macOS 26.4 ASAN dyld deadlock — see shims/asan-dyld-shim.c. - const src = resolve(cfg.cwd, "scripts", "build", "shims", "asan-dyld-shim.c"); - const out = resolve(cfg.buildDir, ASAN_DYLD_SHIM); - n.build({ - outputs: [out], - rule: "shim_dylib", - inputs: [src], - vars: { name: ASAN_DYLD_SHIM }, - }); - ldflags.push(out, "-Wl,-rpath,@executable_path"); - implicitInputs.push(out); - } - if (needsMuslCrtDecompress(cfg)) { const crtDir = resolve(cfg.buildDir, "crt"); // Pre-create at configure time (matches configure.ts mkdirAll pattern; diff --git a/scripts/build/shims/asan-dyld-shim.c b/scripts/build/shims/asan-dyld-shim.c deleted file mode 100644 index b2bbeb6b48d1..000000000000 --- a/scripts/build/shims/asan-dyld-shim.c +++ /dev/null @@ -1,85 +0,0 @@ -// Workaround for macOS 26.4 + ASAN deadlock. -// https://github.com/llvm/llvm-project/issues/182943 -// -// macOS 26.4's Dyld.framework reimplemented dyld_shared_cache_iterate_text as -// a tail-call to a Swift version that allocates via _Block_copy. ASAN's -// get_dyld_hdr() calls this during InitializeShadowMemory() — before the -// malloc interceptor is ready. The allocation re-enters AsanInitFromRtl(), -// which spins on its own init lock forever. -// -// The upstream fix (merged to LLVM main, not yet released) switches to -// _dyld_get_dyld_header() which is a plain getter that doesn't allocate. -// We do the same: interpose the iterate function to synthesize what ASAN -// needs using the non-allocating API. -// -// Build: -// clang -dynamiclib -o asan-dyld-shim.dylib asan-dyld-shim.c -// -// Use: -// DYLD_INSERT_LIBRARIES=.../asan-dyld-shim.dylib ./bun-debug -// -// Remove once compiler-rt with the fix ships — LLVM 22.1.3+ via -// https://github.com/llvm/llvm-project/pull/188913 backport, or an Xcode -// update. - -#include -#include -#include -#include -#include - -// ASAN's GetDyldImageHeaderViaSharedCache (sanitizer_procmaps_mac.cpp) -// iterates, computes hdr = cacheStart + info->textSegmentOffset for each -// entry, and keeps the one where IsDyldHdr(hdr) matches. We give it exactly -// one entry with the offset that lands on dyld's header — obtained via the -// non-allocating _dyld_get_dyld_header() that the upstream fix uses. -// That symbol is private — present in libdyld at runtime but absent from -// the SDK's .tbd stubs — so a direct extern fails to link. dlsym it. -extern const void* _dyld_get_shared_cache_range(size_t* length); - -// Layout must match compiler-rt's copy of the struct. Fields ASAN reads: -// version (CHECK_GE 2) and textSegmentOffset. Rest unused but kept for size. -struct dyld_shared_cache_dylib_text_info { - uint64_t version; - uint64_t loadAddressUnslid; - uint64_t textSegmentSize; - uuid_t dylibUuid; - const char* path; - uint64_t textSegmentOffset; -}; -typedef void (^dsc_callback)(const struct dyld_shared_cache_dylib_text_info*); - -// Forward-declare the real symbol so the interpose table can reference it. -// Our own calls to it reach the system symbol: dyld does not interpose the -// image that defines the __interpose tuple (see Apple's dyld-interposing.h). -extern int dyld_shared_cache_iterate_text(const uuid_t, dsc_callback); - -static int shim_iterate(const uuid_t uuid, dsc_callback cb) { - typedef const struct mach_header* (*get_hdr_fn)(void); - get_hdr_fn get_hdr = (get_hdr_fn)dlsym(RTLD_DEFAULT, "_dyld_get_dyld_header"); - const struct mach_header* hdr = get_hdr ? get_hdr() : NULL; - size_t len; - const void* cacheStart = _dyld_get_shared_cache_range(&len); - // _dyld_get_dyld_header only exists on newer macOS. On older releases the - // real iterate has no 26.4 deadlock, so delegate rather than return -1 - // (ASAN CHECK_EQ(res, 0) aborts otherwise). Mirrors the upstream fix. - if (!hdr || !cacheStart) return dyld_shared_cache_iterate_text(uuid, cb); - if (!cb) return -1; - - struct dyld_shared_cache_dylib_text_info info; - memset(&info, 0, sizeof(info)); - info.version = 2; - info.textSegmentOffset = (uint64_t)((uintptr_t)hdr - (uintptr_t)cacheStart); - info.path = "/usr/lib/dyld"; - cb(&info); - return 0; -} - -// DYLD_INTERPOSE: tells dyld to redirect calls to the original symbol (from -// any image, including the ASAN runtime) to our replacement. The original -// pointer here is linker-resolved to the system's symbol. -__attribute__((used, section("__DATA,__interpose"))) -static struct { const void* replacement; const void* original; } interpose_tbl[] = { - { (const void*)(uintptr_t)&shim_iterate, - (const void*)(uintptr_t)&dyld_shared_cache_iterate_text }, -}; diff --git a/scripts/build/tools.ts b/scripts/build/tools.ts index 5bd38265c25f..18c0aaf59e71 100644 --- a/scripts/build/tools.ts +++ b/scripts/build/tools.ts @@ -262,10 +262,10 @@ export function findTool(spec: ToolSpec): FoundTool | undefined { /** * LLVM version constraint. Any version in the same major.minor range is - * accepted (e.g. Alpine 3.23 ships 21.1.2 while we target 21.1.8). + * accepted (e.g. Alpine 3.24 ships 22.1.3 while we target 22.1.8). */ -export const LLVM_VERSION = "21.1.8"; -const LLVM_MAJOR = "21"; +export const LLVM_VERSION = "22.1.8"; +const LLVM_MAJOR = "22"; const LLVM_MINOR = "1"; const LLVM_VERSION_RANGE = `>=${LLVM_MAJOR}.${LLVM_MINOR}.0 <${LLVM_MAJOR}.${LLVM_MINOR}.99`; @@ -316,7 +316,7 @@ function llvmSearchPaths(os: OS, arch: Arch): string[] { } /** - * Version-suffixed command names (e.g. clang-21, clang-21.1). + * Version-suffixed command names (e.g. clang-22, clang-22.1). * Unix distros often only ship these suffixed versions. */ function llvmNameVariants(name: string): string[] { diff --git a/scripts/build/workarounds.ts b/scripts/build/workarounds.ts index b97b59fb2325..ca5accda634e 100644 --- a/scripts/build/workarounds.ts +++ b/scripts/build/workarounds.ts @@ -65,25 +65,6 @@ export interface Workaround { } export const workarounds: Workaround[] = [ - { - id: "asan-dyld-shim", - issue: "https://github.com/llvm/llvm-project/issues/182943", - description: - "macOS 26.4 Dyld.framework reimplemented dyld_shared_cache_iterate_text in Swift; " + - "the _Block_copy allocation deadlocks ASAN init re-entrantly", - applies: cfg => cfg.darwin && cfg.asan, - expectedToBeFixed: cfg => { - // Fix merged to LLVM main. Backport to release/22.x is - // https://github.com/llvm/llvm-project/pull/188913 — lower this - // threshold to the exact 22.1.x once it lands. Apple clang is - // already excluded: resolveLlvmToolchain only accepts Homebrew - // llvm (LLVM_VERSION_RANGE is >=21 <23), so cfg.clangVersion is - // always LLVM clang's version here. - const FIXED_IN_LLVM = "22.1.4"; - return cfg.clangVersion !== undefined && satisfiesRange(cfg.clangVersion, `>=${FIXED_IN_LLVM}`); - }, - cleanup: `Delete scripts/build/shims/asan-dyld-shim.c, scripts/build/shims.ts, the emitShims() calls in bun.ts, registerShimRules in rules.ts, and this entry.`, - }, { id: "rustc-no-regular-lto-summary", issue: @@ -108,27 +89,6 @@ export const workarounds: Workaround[] = [ `rust.ts, unwrap its call sites in bun.ts, drop "llvm-tools" from rust-toolchain.toml's ` + `components, and delete this entry.`, }, - { - id: "rust-lld-for-crosslang-lto", - issue: "https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html", - description: - "rustc's bundled LLVM is newer than clang's, so clang's ld.lld can't read " + - "-Clinker-plugin-lto bitcode (forward-compatible only). Link with rust-lld instead " + - "(and compress ELF debug sections post-link via llvm-objcopy, since rust-lld lacks zlib).", - applies: cfg => cfg.crossLangLto && cfg.rustLlvmVersion !== undefined && cfg.clangVersion !== undefined, - expectedToBeFixed: cfg => { - // Obsolete once clang's LLVM major catches up to (or passes) rustc's — - // at that point clang's own ld.lld reads rustc's bitcode and the - // rust-lld swap in resolveConfig() never fires. - const clangMajor = Number(cfg.clangVersion!.split(".")[0]); - const rustMajor = Number(cfg.rustLlvmVersion!.split(".")[0]); - return clangMajor >= rustMajor; - }, - cleanup: - `Delete the rust-lld swap block in resolveConfig() (config.ts), findRustLld() and its call ` + - `in resolveLlvmToolchain() (tools.ts), the rustLld/rustLlvmVersion fields on Toolchain/Config, ` + - `and this entry.`, - }, { id: "darwin-cross-cpu-model", issue: "https://github.com/llvm/llvm-project/tree/main/compiler-rt/lib/builtins/cpu_model", @@ -191,9 +151,9 @@ export const workarounds: Workaround[] = [ // Only exercised when the rust-lld swap actually fired on a musl link. applies: cfg => cfg.linux && cfg.abi === "musl" && cfg.rustLld !== undefined && cfg.ld === cfg.rustLld, expectedToBeFixed: cfg => { - // Obsolete the same instant the rust-lld swap above is — once clang's - // ld.lld (built with zlib) reads rustc's bitcode, we never select - // rust-lld and the compressed CRTs are a non-issue. + // Obsolete whenever the wantRustLld swap in resolveConfig() is dormant: + // once clang's ld.lld (built with zlib) reads rustc's bitcode, we never + // select rust-lld and the compressed CRTs are a non-issue. const clangMajor = Number(cfg.clangVersion!.split(".")[0]); const rustMajor = Number(cfg.rustLlvmVersion!.split(".")[0]); return clangMajor >= rustMajor; diff --git a/scripts/machine.mjs b/scripts/machine.mjs index 8e79671642ca..dd67f75f716d 100755 --- a/scripts/machine.mjs +++ b/scripts/machine.mjs @@ -16,7 +16,7 @@ import { escapePowershell, getBootstrapVersion, getBranch, - getBuildNumber, + getBranchImageSuffix, getGithubApiUrl, getGithubUrl, getSecret, @@ -1171,13 +1171,13 @@ async function buildWindowsImageWithPacker({ os, arch, release, command, ci, age // Image naming must match getImageName() in ci.mjs: // [publish images] / normal CI: "windows-x64-2019-v13" - // [build images]: "windows-x64-2019-build-37194" + // [build images]: "windows-x64-2019-branch-my-pr-name" const imageKey = arch === "aarch64" ? "windows-aarch64-11" : "windows-x64-2019"; const imageDefName = command === "publish-image" ? `${imageKey}-v${getBootstrapVersion(os)}` : ci - ? `${imageKey}-build-${getBuildNumber()}` + ? `${imageKey}-${getBranchImageSuffix()}` : `${imageKey}-build-draft-${Date.now()}`; const galleryArch = arch === "aarch64" ? "Arm64" : "x64"; console.log(`[packer] Ensuring gallery image definition: ${imageDefName}`); @@ -1693,7 +1693,7 @@ async function main() { if (command === "publish-image") { suffix = `v${getBootstrapVersion(os)}`; } else if (isCI) { - suffix = `build-${getBuildNumber()}`; + suffix = getBranchImageSuffix(); } else { suffix = `draft-${Date.now()}`; } diff --git a/scripts/run-clang-format.sh b/scripts/run-clang-format.sh index ee44a40f12e3..43f712eced62 100755 --- a/scripts/run-clang-format.sh +++ b/scripts/run-clang-format.sh @@ -11,8 +11,8 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" # Default to format mode (modify files) MODE="${1:-format}" -# Use LLVM_VERSION_MAJOR from environment or default to 19 -LLVM_VERSION="${LLVM_VERSION_MAJOR:-21}" +# Use LLVM_VERSION_MAJOR from environment or default to 22 +LLVM_VERSION="${LLVM_VERSION_MAJOR:-22}" # Ensure we have the specific clang-format version CLANG_FORMAT="clang-format-${LLVM_VERSION}" diff --git a/scripts/update-test-durations.mjs b/scripts/update-test-durations.mjs index 37e71390dfa0..800b09684d68 100644 --- a/scripts/update-test-durations.mjs +++ b/scripts/update-test-durations.mjs @@ -42,7 +42,7 @@ if (!token) { const lanes = { default: "linux-x64-debian-13-test-bun", asan: "linux-x64-asan-debian-13-test-bun", - musl: "linux-x64-musl-alpine-323-test-bun", + musl: "linux-x64-musl-alpine-324-test-bun", windows: "windows-x64-2019-test-bun", }; diff --git a/scripts/utils.mjs b/scripts/utils.mjs index 4e6903907e03..ff08358887a7 100755 --- a/scripts/utils.mjs +++ b/scripts/utils.mjs @@ -1140,6 +1140,20 @@ export function getBuildNumber() { } } +/** + * Branch-scoped suffix for throwaway CI images. Using the branch instead of + * the build number lets subsequent pushes on the same PR reuse the images a + * prior `[build images]` push baked (see getImageName() in .buildkite/ci.mjs). + * @returns {string} + */ +export function getBranchImageSuffix() { + const branch = getBranch() || "unknown"; + return `branch-${branch + .replace(/[^A-Za-z0-9]+/g, "-") + .replace(/^-+|-+$/g, "") + .slice(0, 80)}`; +} + /** * @returns {URL | undefined} */ diff --git a/scripts/verify-baseline-static/allowlist-aarch64.txt b/scripts/verify-baseline-static/allowlist-aarch64.txt index 38f503017e97..1eed7553fe7c 100644 --- a/scripts/verify-baseline-static/allowlist-aarch64.txt +++ b/scripts/verify-baseline-static/allowlist-aarch64.txt @@ -108,6 +108,7 @@ _ZN3bun6N_SVE246IndexOfNeedsEscapeForJavaScriptStringImplQuoteEPKhmh [S _ZN3bun6N_SVE249IndexOfInterestingCharacterInMultilineCommentImplEPKhm [SVE] _ZN3bun6N_SVE249IndexOfNeedsEscapeForJavaScriptStringImplBacktickEPKhmh [SVE] _ZN3bun9N_SVE_25610MemMemImplEPKhmS2_m [SVE] +_ZN3bun9N_SVE_25613JsonIndexImplEPKhmmPjPmS4_S3_ [SVE] _ZN3bun9N_SVE_25614DecodeHex8ImplEPKhPhm [SVE] _ZN3bun9N_SVE_25614LowerAsciiImplEPKhmPh [SVE] _ZN3bun9N_SVE_25615CopyU16ToU8ImplEPKtmPh [SVE] @@ -262,6 +263,29 @@ _ZN9bun_image10N_SVE2_128L13Rotate180ImplEPKhmmPh [S _ZN9bun_image10N_SVE2_128L8VertPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] _ZN9bun_image10N_SVE2_128L9FlipHImplEPKhmmPh [SVE] _ZN9bun_image10N_SVE2_128L9HorizPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image5N_SVEL12ModulateImplEPhmff [SVE] +_ZN9bun_image5N_SVEL13Rotate180ImplEPKhmmPh [SVE] +_ZN9bun_image5N_SVEL8VertPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image5N_SVEL9FlipHImplEPKhmmPh [SVE] +_ZN9bun_image5N_SVEL9HorizPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image6N_SVE2L12ModulateImplEPhmff [SVE] +_ZN9bun_image6N_SVE2L13Rotate180ImplEPKhmmPh [SVE] +_ZN9bun_image6N_SVE2L8VertPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image6N_SVE2L9FlipHImplEPKhmmPh [SVE] +_ZN9bun_image6N_SVE2L9HorizPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image9N_SVE_256L12ModulateImplEPhmff [SVE] +_ZN9bun_image9N_SVE_256L13Rotate180ImplEPKhmmPh [SVE] +_ZN9bun_image9N_SVE_256L8VertPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] +_ZN9bun_image9N_SVE_256L9FlipHImplEPKhmmPh [SVE] +_ZN9bun_image9N_SVE_256L9HorizPassEPKhmmPhmPKNS_4SpanEPKsm [SVE] + + +# ---------------------------------------------------------------------------- +# Bun Highway NEON_BF16 target (highway_strings.cpp). clang >= 22 makes +# NEON_BF16 attainable; the DotProd lanes it uses are gated by +# hwy::SupportedTargets() via getauxval(AT_HWCAP). +# ---------------------------------------------------------------------------- +_ZN3bun11N_NEON_BF1633VisibleLatin1WidthExcludeANSIImplEPKhm [DotProd] # ---------------------------------------------------------------------------- diff --git a/shell.nix b/shell.nix index a4917ddfe1ec..ad0f11977579 100644 --- a/shell.nix +++ b/shell.nix @@ -8,9 +8,9 @@ pkgs.mkShell rec { # Core build tools (matching bootstrap.sh) cmake ninja - clang_21 - llvm_21 - lld_21 + clang_22 + llvm_22 + lld_22 nodejs_24 bun rustc @@ -77,10 +77,10 @@ pkgs.mkShell rec { ]; shellHook = '' - export CC="${pkgs.lib.getExe pkgs.clang_21}" - export CXX="${pkgs.lib.getExe' pkgs.clang_21 "clang++"}" - export AR="${pkgs.llvm_21}/bin/llvm-ar" - export RANLIB="${pkgs.llvm_21}/bin/llvm-ranlib" + export CC="${pkgs.lib.getExe pkgs.clang_22}" + export CXX="${pkgs.lib.getExe' pkgs.clang_22 "clang++"}" + export AR="${pkgs.llvm_22}/bin/llvm-ar" + export RANLIB="${pkgs.llvm_22}/bin/llvm-ranlib" export CMAKE_C_COMPILER="$CC" export CMAKE_CXX_COMPILER="$CXX" export CMAKE_AR="$AR" @@ -88,7 +88,7 @@ pkgs.mkShell rec { export CMAKE_SYSTEM_PROCESSOR=$(uname -m) export TMPDIR=''${TMPDIR:-/tmp} '' + pkgs.lib.optionalString pkgs.stdenv.isLinux '' - export LD="${pkgs.lib.getExe' pkgs.lld_21 "ld.lld"}" + export LD="${pkgs.lib.getExe' pkgs.lld_22 "ld.lld"}" export NIX_CFLAGS_LINK="''${NIX_CFLAGS_LINK:+$NIX_CFLAGS_LINK }-fuse-ld=lld" export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath packages}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" '' + '' diff --git a/src/jsc/bindings/highway_json.cpp b/src/jsc/bindings/highway_json.cpp index d3fba90f25a1..e6e1180cd2ce 100644 --- a/src/jsc/bindings/highway_json.cpp +++ b/src/jsc/bindings/highway_json.cpp @@ -1,6 +1,12 @@ // SIMD structural indexer for JSON (simdjson-style "stage 1"), runtime-dispatched via Google // Highway. Plain JSON only: a `/` or `'` outside a string sets BUN_JSON_IDX_ODDITY and returns. +// BitsFromMask needs a fixed-width vector; Highway only provides it for the +// fixed-size SVE_256/SVE2_128 variants, not scalable SVE/SVE2. clang >= 22 +// stops marking scalable SVE as HWY_BROKEN, so disable it here explicitly. +#undef HWY_DISABLED_TARGETS +#define HWY_DISABLED_TARGETS (HWY_SVE | HWY_SVE2) + #undef HWY_TARGET_INCLUDE #define HWY_TARGET_INCLUDE "highway_json.cpp" #include diff --git a/src/jsc/bindings/highway_sourcemap.cpp b/src/jsc/bindings/highway_sourcemap.cpp index 653cdb5ee8cf..46e0a27de005 100644 --- a/src/jsc/bindings/highway_sourcemap.cpp +++ b/src/jsc/bindings/highway_sourcemap.cpp @@ -34,6 +34,12 @@ // Muła, "SIMD base64 decoding" http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html // Lemire & Boytsov, "Masked VByte" https://arxiv.org/abs/1503.07387 +// BitsFromMask needs a fixed-width vector; Highway only provides it for the +// fixed-size SVE_256/SVE2_128 variants, not scalable SVE/SVE2. clang >= 22 +// stops marking scalable SVE as HWY_BROKEN, so disable it here explicitly. +#undef HWY_DISABLED_TARGETS +#define HWY_DISABLED_TARGETS (HWY_SVE | HWY_SVE2) + #undef HWY_TARGET_INCLUDE #define HWY_TARGET_INCLUDE "highway_sourcemap.cpp" #include // Must come before highway.h diff --git a/src/runtime/webview/ObjCRuntime.h b/src/runtime/webview/ObjCRuntime.h index a7456602c714..0983ee7684b3 100644 --- a/src/runtime/webview/ObjCRuntime.h +++ b/src/runtime/webview/ObjCRuntime.h @@ -256,10 +256,10 @@ struct NSWindow : Ref { { NSWindow win(msgCls(hostCls, s_alloc)); win.m_id = win.msg(s_initWithContentRect_styleMask_backing_defer, - CGRectMake(0, 0, w, h), - (unsigned long)0 /* NSWindowStyleMaskBorderless */, - (unsigned long)2 /* NSBackingStoreBuffered */, - (signed char)0 /* defer: NO */); + CGRectMake(0, 0, w, h), + (unsigned long)0 /* NSWindowStyleMaskBorderless */, + (unsigned long)2 /* NSBackingStoreBuffered */, + (signed char)0 /* defer: NO */); win.msg(s_setReleasedWhenClosed, (signed char)0); win.msg(s_setAlphaValue, (double)0.0); win.msg(s_setIgnoresMouseEvents, (signed char)1); @@ -319,7 +319,7 @@ struct NSImage : Ref { id cgImage() const { return msg(s_CGImageForProposedRect_context_hints, - (void *)nullptr, (id) nullptr, (id) nullptr); + (void *)nullptr, (id) nullptr, (id) nullptr); } }; @@ -361,7 +361,7 @@ struct NSProcessInfo : Ref { // Leak the assertion — process-lifetime. The return is autoreleased; // retain so ARPool pop doesn't release and end the activity. id assertion = info.msg(s_beginActivityWithOptions_reason, opts, - NSString::fromWTF("Bun WebView host"_s).m_id); + NSString::fromWTF("Bun WebView host"_s).m_id); Ref(assertion).msg(s_retain); } }; @@ -420,14 +420,14 @@ struct NSEvent : Ref { // Autoreleased. AppKit retains the event across sendEvent:/keyDown: so // the pool drain in the caller is sufficient. static NSEvent mouseEvent(unsigned long type, double x, double y, - unsigned long modifierFlags, double timestamp, long windowNumber, - long clickCount) + unsigned long modifierFlags, double timestamp, long windowNumber, + long clickCount) { return msgCls(cls, s_mouseEventWithType, - type, CGPointMake(x, y), modifierFlags, timestamp, - windowNumber, (id) nullptr /* context */, - (long)0 /* eventNumber */, clickCount, - (float)1.0 /* pressure */); + type, CGPointMake(x, y), modifierFlags, timestamp, + windowNumber, (id) nullptr /* context */, + (long)0 /* eventNumber */, clickCount, + (float)1.0 /* pressure */); } // Autoreleased. For text input, keyCode=0 + the character; WebContent @@ -435,14 +435,14 @@ struct NSEvent : Ref { // keyCode is the HID usage and characters is the corresponding control // character (\r, \t, \x1b, etc.). static NSEvent keyEvent(unsigned long type, unsigned long modifierFlags, - double timestamp, long windowNumber, NSString characters, - NSString charactersIgnoringModifiers, unsigned short keyCode) + double timestamp, long windowNumber, NSString characters, + NSString charactersIgnoringModifiers, unsigned short keyCode) { return msgCls(cls, s_keyEventWithType, - type, CGPointMake(0, 0), modifierFlags, timestamp, - windowNumber, (id) nullptr /* context */, - characters.m_id, charactersIgnoringModifiers.m_id, - (signed char)0 /* isARepeat */, keyCode); + type, CGPointMake(0, 0), modifierFlags, timestamp, + windowNumber, (id) nullptr /* context */, + characters.m_id, charactersIgnoringModifiers.m_id, + (signed char)0 /* isARepeat */, keyCode); } // Autoreleased. Deltas are pixels; positive dy scrolls viewport DOWN @@ -546,7 +546,7 @@ struct WKUserScript : Ref { { WKUserScript s(msgCls(cls, s_alloc)); s.m_id = s.msg(s_initWithSource_injectionTime_forMainFrameOnly, - source.m_id, (long)0, (signed char)0); + source.m_id, (long)0, (signed char)0); return s; } }; diff --git a/test/bundler/compile-sourcemap-internal.test.ts b/test/bundler/compile-sourcemap-internal.test.ts index 241dedd3ce15..d1a90f03174c 100644 --- a/test/bundler/compile-sourcemap-internal.test.ts +++ b/test/bundler/compile-sourcemap-internal.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "bun:test"; -import { bunEnv, bunExe, tempDir } from "harness"; -import { dirname, join } from "path"; +import { bunEnv, tempDir } from "harness"; +import { join } from "path"; // Asserts that `bun build --compile --sourcemap` embeds an InternalSourceMap // blob and that stack frames in the compiled executable remap to the correct @@ -43,13 +43,7 @@ test("compile --sourcemap remaps stack frames to original line:col", async () => await using proc = Bun.spawn({ cmd: [exe], - env: { - ...bunEnv, - // Debug ASAN builds embed an @executable_path rpath for asan-dyld-shim.dylib; - // the copied standalone exe lives elsewhere, so point dyld back at the - // original build dir so the shim resolves on macOS debug builds. - DYLD_FALLBACK_LIBRARY_PATH: dirname(bunExe()), - }, + env: bunEnv, cwd: String(dir), stdout: "pipe", stderr: "pipe", diff --git a/test/expected-durations.json b/test/expected-durations.json index c0b350cbb618..0aaf25db8274 100644 --- a/test/expected-durations.json +++ b/test/expected-durations.json @@ -11,7 +11,7 @@ "lanes": { "default": "linux-x64-debian-13-test-bun", "asan": "linux-x64-asan-debian-13-test-bun", - "musl": "linux-x64-musl-alpine-323-test-bun", + "musl": "linux-x64-musl-alpine-324-test-bun", "windows": "windows-x64-2019-test-bun" } }, diff --git a/test/internal/macos-cross-config.test.ts b/test/internal/macos-cross-config.test.ts index f196d6346598..8f362e549602 100644 --- a/test/internal/macos-cross-config.test.ts +++ b/test/internal/macos-cross-config.test.ts @@ -29,8 +29,8 @@ function mockToolchain(overrides: Partial = {}): Toolchain { return { cc: "/fake/llvm/bin/clang", cxx: "/fake/llvm/bin/clang++", - clangVersion: "21.1.8", - clangResourceDir: "/fake/llvm/lib/clang/21", + clangVersion: "22.1.8", + clangResourceDir: "/fake/llvm/lib/clang/22", ar: "/fake/llvm/bin/llvm-ar", ranlib: "/fake/llvm/bin/llvm-ranlib", ld: "/fake/llvm/bin/ld.lld", @@ -226,7 +226,13 @@ describe.skipIf(isMacOS)("macOS cross-compile config (non-darwin host)", () => { const linux = { os: "linux", arch: "x64", abi: "gnu", buildType: "Release", linuxSysroot: "/fake" } as const; const withRustLld = resolveConfig( { ...linux, lto: true }, - mockToolchain({ ld64Lld: undefined, llvmStrip: undefined, dsymutil: undefined, rustLld }), + mockToolchain({ + ld64Lld: undefined, + llvmStrip: undefined, + dsymutil: undefined, + rustLld, + rustLlvmVersion: "23.1.0", + }), ); expect(withRustLld.ld).toBe(rustLld); expect(computeFlags(withRustLld).ldflags).not.toContain("-Wl,--compress-debug-sections=zlib"); diff --git a/test/internal/source-lints/webkit-prebuilt-url.test.ts b/test/internal/source-lints/webkit-prebuilt-url.test.ts index 5a7ac2701e94..cd6d6bad8cd9 100644 --- a/test/internal/source-lints/webkit-prebuilt-url.test.ts +++ b/test/internal/source-lints/webkit-prebuilt-url.test.ts @@ -13,8 +13,8 @@ function mockToolchain(): Toolchain { cxx: "/fake/llvm/bin/clang++", hostCc: undefined, hostCxx: undefined, - clangVersion: "21.1.8", - clangResourceDir: "/fake/llvm/lib/clang/21", + clangVersion: "22.1.8", + clangResourceDir: "/fake/llvm/lib/clang/22", ar: "/fake/llvm/bin/llvm-ar", ranlib: "/fake/llvm/bin/llvm-ranlib", ld: "/fake/llvm/bin/ld.lld", diff --git a/test/internal/source-lints/windows-cross-config.test.ts b/test/internal/source-lints/windows-cross-config.test.ts index fbd2e375ecbc..4c558f0a8150 100644 --- a/test/internal/source-lints/windows-cross-config.test.ts +++ b/test/internal/source-lints/windows-cross-config.test.ts @@ -24,8 +24,8 @@ function mockToolchain(overrides: Partial = {}): Toolchain { return { cc: "/fake/llvm/bin/clang-cl", cxx: "/fake/llvm/bin/clang-cl", - clangVersion: "21.1.8", - clangResourceDir: "/fake/llvm/lib/clang/21", + clangVersion: "22.1.8", + clangResourceDir: "/fake/llvm/lib/clang/22", ar: "/fake/llvm/bin/llvm-lib", ranlib: undefined, ld: "/fake/llvm/bin/lld-link", @@ -128,7 +128,7 @@ describe.skipIf(isWindows)("Windows cross-compile LTO config (non-windows host)" }); test("the link uses rustc's lld-link sibling when rustc's LLVM is newer than clang's", () => { - // resolveConfig swaps cfg.ld so lld-link can read the LLVM-22 bitcode + // resolveConfig swaps cfg.ld so lld-link can read the newer bitcode // rustc emits under -Clinker-plugin-lto (bitcode is forward-compatible // only). rustc's gcc-ld/ ships every lld flavor; windows needs the // lld-link sibling of the host-flavored rust-lld that findRustLld() @@ -140,7 +140,7 @@ describe.skipIf(isWindows)("Windows cross-compile LTO config (non-windows host)" const rustLld = join(String(dir), "gcc-ld", "ld.lld"); const cfg = resolveWindowsCross( { lto: true, baseline: false }, - mockToolchain({ rustLld, rustLlvmVersion: "22.1.4" }), + mockToolchain({ rustLld, rustLlvmVersion: "23.1.0" }), ); expect(cfg.ld).toBe(join(String(dir), "gcc-ld", "lld-link")); // Cargo-driven links (bun_shim_impl.exe) must NOT follow the swap: rustc @@ -150,7 +150,7 @@ describe.skipIf(isWindows)("Windows cross-compile LTO config (non-windows host)" // Without LTO there's no bitcode skew to work around — keep the host // LLVM's lld-link. - const plain = resolveWindowsCross({ lto: false }, mockToolchain({ rustLld, rustLlvmVersion: "22.1.4" })); + const plain = resolveWindowsCross({ lto: false }, mockToolchain({ rustLld, rustLlvmVersion: "23.1.0" })); expect(plain.ld).toBe("/fake/llvm/bin/lld-link"); // If rustc's gcc-ld/ ever stops shipping lld-link, fall back to the host @@ -159,7 +159,7 @@ describe.skipIf(isWindows)("Windows cross-compile LTO config (non-windows host)" using bare = tempDir("win-cross-rust-lld-bare", { "gcc-ld/ld.lld": "" }); const bareCfg = resolveWindowsCross( { lto: true, baseline: false }, - mockToolchain({ rustLld: join(String(bare), "gcc-ld", "ld.lld"), rustLlvmVersion: "22.1.4" }), + mockToolchain({ rustLld: join(String(bare), "gcc-ld", "ld.lld"), rustLlvmVersion: "23.1.0" }), ); expect(bareCfg.ld).toBe("/fake/llvm/bin/lld-link"); }); diff --git a/test/napi/node-napi-tests/harness.ts b/test/napi/node-napi-tests/harness.ts index 46644c12659f..4f6d77adb8fe 100644 --- a/test/napi/node-napi-tests/harness.ts +++ b/test/napi/node-napi-tests/harness.ts @@ -12,7 +12,7 @@ const abortingJsNativeApiTests = ["test_finalizer/test_fatal_finalize.js"]; // Must match the npm_config_target passed to node-gyp below (without the leading "v"). const NODE_HEADERS_VERSION = "26.3.0"; -const linuxClang = !isMusl ? "/usr/lib/llvm-21/bin/clang" : "/usr/lib/llvm21/bin/clang"; +const linuxClang = !isMusl ? "/usr/lib/llvm-22/bin/clang" : "/usr/lib/llvm22/bin/clang"; interface GypTarget { target_name: string;