Repository navigation
Conversation
…sed Cargo dependencies - bun_sys: O::NOFOLLOW_ANY and posix::s_isdir have no user on any target. - bun_boringssl_sys: the SSL_set0_verify_cert_store declaration has no Rust caller. - bun_format: nothing formats verify::Difference with Display. - bun_runtime: the CLI and PathWatcherManager log scopes have no log statement. - bun_css_jsc does not use bstr. bun_spawn does not use bun_crash_handler. - scripts/build/config.ts: resolveConfig rejects asan with valgrind, so the bun-asan-valgrind name in bunExeName is unreachable.
|
Updated 7:15 AM PT - Oct 24th, 2026
✅ @robobun, your commit 2ac1d8587d8570f5c466a8c676d197e14eeb2e42 passed in 🧪 To try this PR locally: bunx bun-pr 46728That installs a local version of the PR into your bun-46728 --bun |
|
Status: ready for review.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Executable naming scripts/build/config.ts |
When ASAN and Valgrind are both enabled, bunExeName now returns bun-asan through the existing ASAN branch. |
Rust declarations and helpers src/boringssl_sys/boringssl.rs, src/format/verify.rs, src/sys/lib.rs |
The changes remove SSL_set0_verify_cert_store, the Difference formatter, O::NOFOLLOW_ANY, and posix::s_isdir. |
Dependencies and logging scopes src/css_jsc/Cargo.toml, src/spawn/Cargo.toml, src/spawn/lib.rs, src/runtime/cli/mod.rs, src/runtime/node/win_watcher.rs |
The changes remove the bstr and bun_crash_handler dependencies, update the spawn dependency documentation, and remove the CLI and PathWatcherManager logging-scope declarations. |
Suggested reviewers: dylan-conway
Priority:
Merge Risk: 
Minimal · up to ef39e
-
No concrete behavior regression or repository-contract violation is established; the PR is mergeable.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description is complete and relevant. It explains the problem, lists the removed items and dependency changes, states the behavior impact, and documents verification steps and test limitations. It does not use the exact template headings, but it provides the required information.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Problem
bun_sysitems, one BoringSSL declaration, oneDisplayimpl, two log scopes, and two Cargo dependency edges.dead_codelint exemptspubitems, trait impls, and thepub staticthatdeclare_scope!emits.Fix
bun_sys::O::NOFOLLOW_ANY,bun_sys::posix::s_isdir, theSSL_set0_verify_cert_storedeclaration,impl Display for bun_format::verify::Difference, and theCLIandPathWatcherManagerlog scopes.bstrfrombun_css_jscandbun_crash_handlerfrombun_spawn. Remove thebun-asan-valgrindbranch ofbunExeName, becauseresolveConfigrejects that combination.cargo check --workspace --all-targetson linux,cargo check --workspaceon the other 11 targets, a check with the release cfgs,cargo fmt --all --check,bun bd, and 10 test files.Background
declare_scope!declares. A scope with noscoped_log!call does nothing.bunExeNamemaps a build configuration to the name of the binary.#[deprecated]and reads the use sites that rustc reports. The other relinks the debug build with--gc-sections. The Notes list what the checks rejected.Downsides
src/,packages/,scripts/,docs/,clippy.toml,hawk.toml, and the generated code for each name.Behaviour change: none
Notes
Removed items
bun_sys::O::NOFOLLOW_ANY(src/sys/lib.rs, both cfg arms and their comment).rg -w NOFOLLOW_ANYfinds only the two definitions.bun_sys::posix::s_isdir(src/sys/lib.rs).rg -w s_isdirfinds only the definition.SSL_set0_verify_cert_store(src/boringssl_sys/boringssl.rs). The only caller is C code (packages/bun-usockets/src/crypto/openssl.c:1769), which uses the BoringSSL header.impl Display for Difference(src/format/verify.rs).verify::comparehas one caller (src/lint/driver/fmt/mod.rs:940). It tests.is_ok()and never formats the value. The linker drops thefmtfunction from the debug build.declare_scope!(CLI, hidden)(src/runtime/cli/mod.rs) anddeclare_scope!(PathWatcherManager, visible)(src/runtime/node/win_watcher.rs). Noscoped_log!names them. The two Windows targets compile without the second one.bstrinsrc/css_jsc/Cargo.toml. No source in the crate names it. 6292c65 removed the last use.bun_crash_handlerinsrc/spawn/Cargo.toml. No source in the crate names it. a950fc5 removed the last use. The crate doc insrc/spawn/lib.rslisted it, so that sentence changes.if (cfg.asan && cfg.valgrind) return "bun-asan-valgrind"inscripts/build/config.ts.resolveConfigasserts!(asan && valgrind).rg asan-valgrindfinds no other use.Method
pubin one crate topub(crate)and runcargo checkon that crate. rustc then reports each item that the crate itself does not use. This gave 41,479 candidates in 116 crates.#[deprecated(note = "<id>")]and runcargo check --workspace --all-targetswith--force-warn deprecated. rustc reports each resolved use site, which includes method calls and names that a text search cannot tell apart.bun_debug,bun_asan), with the release cfgs (bun_codegen_embed,--release, a release codegen directory), with--cfg miri, withbun_react_compiler/fixtures, and for the Windows shim binary. Seven items had no use. A second pass started from the Windows target to cover code that linux does not compile.--gc-sections --print-gc-sectionslists 135 hand-written impl blocks with no kept method. Open PRs already delete 70 of them, and 37 more areDebugimpls. I deleted nine of the other 28 as a test: one is in this diff (Display for Difference), and the workspace needs the other eight. I kept the remaining 19 after reading them: a doc comment describes them, a bound needs them, they areDropimpls, a unit test uses them, or they print a value for debugging (Display for FilePoll,CodePath,Segment).Candidates that stayed
Default for store::Bytes(Windows,src/runtime/webcore/blob/read_file.rs),From<bun_sys::Error> for bun_watcher::Error(macOS and FreeBSD,KEventWatcher.rs).CloneIn for ArenaBoxand fiveSpannedimpls insrc/format/js/print/.HasLen for boolandu64,JobContext for Never, andPartialEq for PackQueueItemserve a bound, a const assertion, and a supertrait. I read those from the source and did not delete them.#[derive(css::Parse, css::ToCss)]:Ellipse::parse,Ellipse::to_css,Circle::parse,Circle::to_css(src/css/values/gradient.rs). rustc does not report deprecated uses inside derive output, so I checked these by hand.bun_core::output::pretty_errorlnhas no caller, butclippy.tomlnames it.Tag::fchownatand 23 errno constants insrc/errno/windows_errno.rshave no user. They are entries of complete tables, so they stay.bun_errno::posix::mode_thas no user on linux. The macOS and FreeBSD arm was not checked.Not in this diff
bun_sys::O::NOATIMEhas no user on any target (three cfg arms). The comment above the Windows arm saysopenat_windows_impltests it, and it does not. Left for a follow-up because it needs a comment change.bun_sys::UTIME_NOWandbun_sys::umaskhave no user on Windows.LibUVBackend,ResolveInfoRequest(src/runtime/dns_jsc/dns.rs) andModuleLoader(src/jsc/ModuleLoader.rs) are log scopes with no log statement. They are next to lines that Remove dead code: 17 log scopes nothing logs to and four fields nothing reads, in 10 crates #44050 and Remove dead code from bun_collections, bun_core, the JSC bindings, and 37 re-exports #41268 delete, so this PR leaves them to avoid a conflict.Debugimpls are never formatted. Remove dead code: 49 trait impls nothing uses, across 12 crates #43664 kept them as a debugging aid.WebCore::ResourceTiminghas a private constructor and no factory, soPerformanceResourceTiming::createhas no caller. Removing that path is a refactor of about 130 lines of C++.bun_core::output::IS_GITHUB_ACTIONis written once and never read. Its store also makes the first call tois_github_action(), so removing it can change when the environment is read.scripts/build/deps/libarchive.tsdefinesHAVE_STRUCT_STAT_ST_BIRTHTIMfor FreeBSD. libarchive 3.8.9 reads onlyHAVE_STRUCT_STAT_ST_BIRTHTIMEandHAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC. This looks like a misspelling, not dead code.mordant-baseline.tomlrecords 55unused_pubfindings forsrc/sys/lib.rs. This PR removes threepubitems from that file. I did not regenerate the baseline, becausecargo mordantis not installed where I ran the checks.bun run rust:mordant:baselinecan lower the count.Tests (debug build with ASAN)
test/cli/format/sort-imports.test.ts(107 pass),test/cli/format/toml-layout.test.ts(38),test/js/bun/spawn/spawn-env.test.ts(2),test/js/bun/spawn/exit-code.test.ts(5),test/js/node/fs/fs-stats-constructor.test.ts(7),test/js/node/fs/fs-open-cloexec.test.ts(5),test/cli/bun.test.ts(53),test/js/node/dns/dns-resolver-class.test.ts(16),test/js/node/dns/dns-lookup-keepalive.test.ts(4),test/js/bun/resolve/import-meta.test.js(34).sort-imports.test.tsis not stable in the debug build: of four runs, two passed all 107 tests and two had tests that hit the 5 s default timeout (6 tests, then 1 test).test/cli/format/format.test.tsran once on an earlier build of this branch: 1546 pass, 81 fail. Each failure is the 5 s default timeout. A sample of nine tests from the same groups passes when run alone.[policy-decision:dep] gate passed · iteration 1 · 10 files touched
passes on PR (with fix)
Dependency/toolchain change; no test proof to run.diff hotspot
gate history · 1 passed · 0 rejected · iteration 1
evidence per changed file