Move BufferEncodingType, JSBuffer, JSBufferEncodingType, JSBufferList,
JSStringDecoder from bindings/ to node/.
Updated BuildBun.cmake and NodeBufferModule.h, NodeStringDecoderModule.h.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move HTTPParsers, HeaderFieldTokenizer, RFC7230 from webcore/ to web/http/.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move SerializedScriptValue, StructuredClone, StructuredSerializeOptions,
JSStructuredSerializeOptions, JSDOMConvertSerializedScriptValue
from webcore/ to web/serialization/.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move JSMIMEBindings, JSMIMEParams, JSMIMEType from webcore/ to web/mime/.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move MessageChannel, JSMessageChannel files from webcore/ to web/messaging/.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move Worker, JSWorker, JSWorkerOptions, WorkerOptions, JSServiceWorker
from webcore/ to web/workers/.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move 8 WebSocket-related files from webcore/ to web/websocket/.
Includes WebSocket core, JSWebSocket bindings, and helpers.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move 60 performance-related files from webcore/ to web/performance/.
Includes Performance API, PerformanceObserver, Timing, Marks, Measures,
ResourceTiming, ServerTiming, and NetworkLoadMetrics.
Added JSDOMWrapperCache.h include to JSPerformanceEntryCustom.cpp.
Updated cmake/Sources.json and cmake/targets/BuildBun.cmake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move Event*, MessagePort*, BroadcastChannel*, AbortSignal,
EventTarget, EventEmitter, JS* event files from bindings/
and webcore/ to web/events/.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move Base64Helpers, TextCodec*, TextEncoder*, TextDecoder*,
EncodingLabel, encoding.zig and related files from bindings/
and webcore/ to web/encoding/.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move blob.cpp, DOMFormData, JSDOMFile, and JSDOMFormData
from bindings/ and webcore/ to web/blob/.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move DOMURL, URLSearchParams, URLPattern*, EncodeURIComponent,
decodeURIComponentSIMD, ObjectURLRegistry, NodeURL and related
files from bindings/ and webcore/ to web/url/.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move FetchHeaders, FetchTasklet, HTTPHeader*, JSFetchHeaders,
NodeFetch, Undici, and fetch.zig from bindings/ and webcore/
to web/fetch/.
This groups all fetch-related functionality in one directory
for easier navigation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move BunClientData, BunCommonStrings, BunGCOutputConstraint,
BunGlobalScope, BunIDL*, BunJSCEventLoop, BunObject, BunString,
and BunWorkerGlobalScope from bindings/ to core/.
This makes the purpose of these files clearer - they are core Bun
runtime infrastructure rather than JavaScript bindings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move process-related files from bindings/ to api/process/:
- BunProcess, ProcessBindingBuffer, ProcessBindingConstants
- ProcessBindingFs, ProcessBindingHTTPParser, ProcessBindingNatives
- ProcessBindingTTYWrap, ProcessBindingUV, ProcessIdentifier
- bun-spawn
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move napi files from bindings/ to compat/napi/
- Move module loader files from bindings/ to module/
- InternalModuleRegistry, JSModuleLoader, JSCommonJSModule, etc.
- Update all import paths and cmake configurations
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Move bindings/libuv/ to compat/libuv/ for libuv compatibility layer
- Move bindings/webcore/ to webcore/ (438 files)
- Update all include paths for webcore/ prefix removal
- Fix relative includes in webcrypto files
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Consolidate node compatibility files:
- Move node C++ files from bindings/node/ to buntime/node/
- Rename bindings/node/crypto to node/crypto_bindings for clarity
- Move webcrypto from bindings/ to webcore/webcrypto/
- Update cmake include paths and source patterns
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move webcrypto directory from bindings/ to webcore/webcrypto/ for
better organization of web-related APIs.
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Move v8 directory from bindings/ to compat/v8/ for better organization
of compatibility layers.
Part of source code reorganization to make code location "guessable".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Step 3 of source reorganization - move test runner files from
src/buntime/test/ to src/test_runner/ for better discoverability.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Step 1 of source reorganization - rename the JavaScript runtime
directory from bun.js to buntime for better discoverability.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Summary
- Fix CMake JSON parsing error when Buildkite API returns commit
messages with newlines
CMake's `file(READ ...)` reads files with literal newlines, which breaks
`string(JSON ...)` when the JSON contains escape sequences like `\n` in
string values (e.g., commit messages from Buildkite API).
Use `file(STRINGS ...)` to read line-by-line, then join with `\n` to
preserve valid JSON escape sequences while avoiding literal newlines.
## Test plan
- Verify CMake configure succeeds when Buildkite build has commit
messages with newlines
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do?
Enables `CHECK_REF_COUNTED_LIFECYCLE` in WebKit (
https://github.com/oven-sh/WebKit/pull/121 )
See also
a978fae619
#### `CHECK_REF_COUNTED_LIFECYCLE`?
A compile-time macro that enables lifecycle validation for
reference-counted objects in debug builds.
**Definition**
```cpp
#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
#define CHECK_REF_COUNTED_LIFECYCLE 1
#else
#define CHECK_REF_COUNTED_LIFECYCLE 0
#endif
```
**Purpose**
Detects three categories of bugs:
1. Missing adoption - Objects stored in RefPtr without using adoptRef()
2. Ref during destruction - ref() called while destructor is running
(causes dangling pointers)
3. Thread safety violations - Unsafe ref/deref across threads
**Implementation**
When enabled, RefCountDebugger adds two tracking flags:
- m_deletionHasBegun - Set when destructor starts
- m_adoptionIsRequired - Cleared when adoptRef() is called
These flags are checked on every ref()/deref() call, with assertions
failing on violations.
**Motivation**
Refactored debug code into a separate RefCountDebugger class to:
- Improve readability of core refcount logic
- Eliminate duplicate code across RefCounted, ThreadSafeRefCounted, etc.
- Simplify adding new refcount classes
**Overhead**
Zero in release builds - the flags and checks are compiled out entirely.
### How did you verify your code works?
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
## Summary
- Remove sccache support entirely, use ccache only
- Missing ccache no longer fails the build (just skips caching)
- Remove S3 distributed cache support
## Changes
- Remove `cmake/tools/SetupSccache.cmake` and S3 distributed cache
support
- Simplify `CMakeLists.txt` to only use ccache
- Update `SetupCcache.cmake` to not fail when ccache is missing
- Replace sccache with ccache in bootstrap scripts (sh, ps1)
- Update `.buildkite/Dockerfile` to install ccache instead of sccache
- Update `flake.nix` and `shell.nix` to use ccache
- Update documentation (CONTRIBUTING.md, contributing.mdx,
building-windows.mdx)
- Remove `scripts/build-cache/` directory (was only for sccache S3
access)
## Test plan
- [x] Build completes successfully with `bun bd`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
- WTFMove → WTF::move / std::move: Replaced WTFMove() macro with
WTF::move() function for WTF types, std::move() for std types
- SortedArrayMap removed: Replaced with if-else chains in
EventFactory.cpp, JSCryptoKeyUsage.cpp
- Wasm::Memory::create signature changed: Removed VM parameter
- URLPattern allocation: Changed from WTF_MAKE_ISO_ALLOCATED to
WTF_MAKE_TZONE_ALLOCATED
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
## Summary
- Add `bun_version` field to `link-metadata.json`
- Pass `VERSION` CMake variable to the metadata script as `BUN_VERSION`
env var
This ensures the build version is captured in the link metadata JSON
file, which is useful for tracking which version produced a given build
artifact.
## Test plan
- Build with `bun bd` and verify `link-metadata.json` includes
`bun_version`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
Fixes#24593 - WebSocket segfault on Windows when publishing large
messages with `perMessageDeflate: true`.
Also fixes#21028 (duplicate issue).
Also closes#25457 (alternative PR).
**Root cause:**
On Windows, the C++ code was compiled against system zlib headers
(1.3.1) but linked against Bun's vendored Cloudflare zlib (1.2.8).
This version mismatch caused `deflateInit2()` to return
`Z_VERSION_ERROR` (-6), leaving the deflate stream in an invalid state.
All subsequent `deflate()` calls returned `Z_STREAM_ERROR` (-2),
producing zero output, which then caused an integer underflow when
subtracting the 4-byte trailer → segfault in memcpy.
**Fix:**
Add `${VENDOR_PATH}/zlib` to the C++ include paths in
`cmake/targets/BuildBun.cmake`. This ensures the vendored zlib headers
are found before system headers, maintaining header/library version
consistency.
This is a simpler alternative to #25457 which worked around the issue by
using libdeflate exclusively.
## Test plan
- [x] Added regression test `test/regression/issue/24593.test.ts` with 4
test cases:
- Large ~109KB JSON message publish (core reproduction)
- Multiple rapid publishes (buffer corruption)
- Broadcast to multiple subscribers
- Messages at CORK_BUFFER_SIZE boundary (16KB)
- [x] Tests pass on Windows (was crashing before fix)
- [x] Tests pass on macOS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
### What does this PR do?
Adds [@mschwarzl's Fuzzilli Support
PR](https://github.com/oven-sh/bun/pull/23862) with the changes
necessary to be able to:
- Run it in CI
- Make no impact on `debug` and `release` mode.
### How did you verify your code works?
---------
Co-authored-by: Martin Schwarzl <mschwarzl@cloudflare.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Fixes ENG-21481
Updates ci_info to include more CIs. It makes it codegen the ci
detection based on the json from the ci-info package. Also it supports
setting CI=true to force ci detected.
---------
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>