Skip to content

build: upgrade Bun to 1.4.2 - #990

Merged
benvinegar merged 5 commits into
mainfrom
poc/bun-1.4.1-memory
Sep 5, 2026
Merged

build: upgrade Bun to 1.4.2#990
benvinegar merged 5 commits into
mainfrom
poc/bun-1.4.1-memory

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

  • upgrade the development, CI, npm fallback, and compiled runtime toolchain from Bun 1.3.14 to stable Bun 1.4.2
  • preserve Hunk's hoisted workspace layout under Bun 1.4 and update simple-git-hooks for linked-worktree support
  • make Nix compile Hunk with the pinned Bun 1.4.2 archive instead of nixpkgs' older Bun
  • scope downloaded compile-target caches by Bun version so switching runtimes cannot silently embed a stale cached runtime

@types/bun remains at 1.4.1 because Bun has not published a 1.4.2 release of that package.

User-visible comparison

Compiled binaries were built from the same Hunk source. Measurements used a real PTY on Linux x64, one pinned CPU, a warm filesystem, 20 fresh launches per runtime, and 600 hunk navigations per runtime.

Metric Bun 1.3.14 Bun 1.4.2 Change
hunk diff to first visible diff, median 373 ms 234 ms -37.2%
Next-hunk navigation, p95 55.2 ms 37.3 ms -32.5%
RSS when the first diff is visible, median 137.9 MiB 101.7 MiB -26.3%

The fixture contained six files and 96 changed lines in a 120×20 split-view terminal. Extensions and the session bridge were disabled. Raw local results are stored in the ignored benchmark-results directory.

Bugs fixed during validation

  • Nix previously compiled with nixpkgs' Bun 1.3.13 rather than the repository-pinned runtime.
  • .bun-install could reuse a compile target downloaded by a different Bun version. The cache now uses both BUN_INSTALL and BUN_INSTALL_CACHE_DIR beneath a versioned directory.
  • simple-git-hooks 2.13.1 attempted to create .git/hooks inside linked worktrees, where .git is a file. Version 2.14.0 resolves the common Git directory correctly.
  • Bun 1.4 changed extracted native-library artifact names. The compiled portability test now recognizes both naming schemes and uses a positive control that actually loads OpenTUI's native renderer.
  • The historical pnpm corruption VM fixture relied on an override file that pnpm 11 no longer read from its randomized global project. It now installs the exact historical Bun version as a direct global dependency, restoring the intended oracle.

Validation

  • bun install --frozen-lockfile
  • bun run format:check
  • bun run lint
  • bun run typecheck
  • bun run deps:check
  • bun run test — 1,999 passed, 2 skipped
  • bun run test:integration — 143 passed, 1 skipped
  • bun run test:tty-smoke — 9 passed
  • bun run check:pack
  • bun run build:prebuilt:npm
  • bun run check:prebuilt-pack
  • compiled headless portability tests — 7 passed
  • compiled binary version smoke test
  • sequential Bun 1.3.14 and 1.4.2 baseline builds
  • complete Firecracker install suite — 15/15 scenarios passed
  • complete Firecracker release-evidence validation passed

Nix lock and compiler-archive integrity hashes were checked against npm. A local Nix toolchain was unavailable, so the complete Nix build is left to CI.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 5, 2026 7:51pm UTC

Request Review

@socket-security

socket-security Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​types/​bun@​1.3.14 ⏵ 1.4.11001004893100
Updatedbun@​1.3.14 ⏵ 1.4.292 +11007997 +8100
Updatedsimple-git-hooks@​2.13.1 ⏵ 2.14.091 +110080 +1380100

View full report

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR consistently upgrades development, CI, release, npm fallback, and compiled runtime tooling to Bun 1.4.1 while preserving the workspace layout and isolating downloaded compile-target caches.

  • Updates Bun, Bun types, and simple-git-hooks dependencies and lock data.
  • Pins the Nix compiler to platform-specific Bun 1.4.1 archives.
  • Versions standalone compiler caches to prevent stale runtime reuse.
  • Updates workflows, contributor requirements, tests, and release metadata.

Confidence Score: 5/5

The PR appears safe to merge, with runtime pins aligned and no actionable correctness or security regression identified.

The upgraded runtime is consistently applied across build paths, the published prebuilt package continues filtering Bun, and the new cache-scoping logic directly addresses stale compile-target reuse with unit coverage.

Important Files Changed

Filename Overview
scripts/build-bin.ts Adds Bun-version-scoped install and compile-target cache directories while retaining host-specific baseline target selection.
scripts/build-bin.test.ts Verifies that compiler cache paths are separated across Bun versions.
nix/package.nix Replaces the nixpkgs compiler with platform-specific pinned Bun 1.4.1 archives and validates the compiler version before building.
package.json Aligns Bun, Bun types, simple-git-hooks, and package-manager metadata with the upgraded toolchain.
bunfig.toml Preserves the repository’s prior hoisted workspace layout under Bun 1.4.
bun.lock Updates resolved Bun runtime packages, types, and hook tooling to their intended versions.
nix/bun.lock.nix Updates Nix fetch definitions and integrity hashes to match the Bun 1.4.1 dependency graph.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[package.json: Bun 1.4.1] --> CI[CI and release workflows]
  P --> N[Nix platform archive selection]
  P --> L[bun.lock dependencies]
  CI --> B[Standalone binary build]
  N --> NB[Nix-compiled binary]
  B --> T[Host-specific compile target]
  T --> C[Version-scoped compiler cache]
  C --> A[Portable release artifact]
Loading

Reviews (1): Last reviewed commit: "build: upgrade Bun to 1.4.1" | Re-trigger Greptile

@benvinegar benvinegar changed the title build: upgrade Bun to 1.4.1 build: upgrade Bun to 1.4.2 Sep 5, 2026
@benvinegar
benvinegar merged commit f41a03d into main Sep 5, 2026
13 checks passed
@benvinegar
benvinegar deleted the poc/bun-1.4.1-memory branch September 5, 2026 21:48
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