Changelog

oven-sh/bun · · 18 commits

Threading races, stats fixes, and web socket safety

Bun fixed a lost-wakeup threadpool bug, corrected fs Stats behavior, and patched several crashes and data-corruption edge cases.

ThreadPool lost-wakeup and warmup bugs fixed (dylan-conway770893d, dylan-conway10a573c)

Bun tightened the threadpool synchronization so notifications participate in the proper modification order, closing a race that could strand queued work and hang callers on aarch64. It also fixed warm() so it actually spawns the requested threads instead of incrementing a phantom counter and stopping early.

fs.Stats constructor and prototype behavior corrected (dylan-conwayfb92d63, dylan-conway5c97292)

The Stats/BigIntStats bindings now write fields in Node's expected slot order and share the right prototype, which fixes scrambled constructor output and instanceof Stats failures. In the same area, inode and other stat fields now preserve full u64 values instead of collapsing high inode numbers to INT64_MAX.

WebSocket upgrade inputs now preserve UTF-8 correctly (robobun05c966a)

The WebSocket HTTP upgrade path now materializes strings through BunString wrappers instead of slicing raw ZigString views, so non-ASCII Latin1 and UTF-16 inputs are encoded correctly before request construction. This avoids malformed upgrade requests when headers, paths, or proxy settings contain non-ASCII text.

bun build --compile normalizes Nix interpreter paths (Jarred-Sumner42f462e)

Compiled binaries on NixOS now rewrite /nix/store or /gnu/store PT_INTERP values back to the standard FHS loader path. That makes bun build --compile artifacts portable across Nix generations instead of tying them to the exact build environment.

HTTP body streaming no longer delivers empty terminal races (dylan-conway479d29f)

Fetch now guards against a stale body task delivering a zero-length non-terminal chunk after JS has already drained the buffered bytes. This fixes a pipeline stall/hang scenario where Readable.fromWeb(res.body) could get stuck and spin.

CLI and DNS edge cases fixed (aliia3b22b3, robobunfd75aa4, Jarred-Sumner1b009ee)

--elide-lines no longer errors outside a terminal, Bun.dns.setServers() stops asserting on non-int32 values, and a flaky HTMLRewriter error was patched. These are targeted correctness fixes that remove surprising failures in scripting and networking paths.

Buildkite CI reliability improved (dylan-conway329ea9d, dylan-conway8417664, dylan-conway1afabdd, dylan-conwayb6a45f9, dylan-conwayc98509b)

CI now fails loudly on artifact download timeouts, retries flaky annotate calls instead of posting bogus errors, and fixes the binary-size job’s agent/image selection. Binary-size reporting also shows sub-megabyte deltas in KB for readability.

Environment loading now preserves inherited vars under EACCES (robobund63aa71)

runEnvLoader() now loads process environment variables before directory traversal, so unreadable parent directories no longer wipe out process.env. This fixes a nasty case where inherited env vars vanished entirely when the current directory couldn’t be read.

Other misc changes