Repository navigation
Conversation
…export lists - `--wrap=mknod` and `--wrap=fstatat`, with `__wrap_mknod`, `__wrap_fstatat` and their version pins. libarchive was the one caller of both symbols, and #46638 removed libarchive. - The `thunk = "name"` option of `#[uws_callback]`. #42590 removed its one use. - The root re-exports `bun_tar::Reader` and `bun_archive::Plucker`. Every user names the defining module. - The `onClose` and `onDrain` members of the `NativePtr` type.
|
Updated 6:05 AM PT - Oct 28th, 2026
❌ @robobun, your commit 70fa650 has 6 failures in
🧪 To try this PR locally: bunx bun-pr 47156That installs a local version of the PR into your bun-47156 --bun |
|
Status: ready for review.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update GNU Linux wrapper bindings scripts/build/flags.ts, src/jsc/bindings/workaround-missing-symbols.cpp |
The wrapper list and stat compatibility block remove fstatat and mknod wrappers. The fstatat64 wrapper remains. |
uws_callback thunk parsing
| Layer / File(s) | Summary |
|---|---|
Fix thunk-name generation src/jsc_macros/lib.rs |
The macro documentation and parser remove the thunk override. Generated thunk identifiers use the __<method>_c form. |
Archive crate exports
| Layer / File(s) | Summary |
|---|---|
Update archive crate exports src/archive/lib.rs |
The crate root continues to re-export Context and ExtractOptions but no longer re-exports Plucker. |
NativePtr callbacks
| Layer / File(s) | Summary |
|---|---|
Remove NativePtr callback declarations src/js/internal/streams/native-readable.ts |
The internal NativePtr interface no longer declares the onClose and onDrain callbacks. |
Tar crate exports
| Layer / File(s) | Summary |
|---|---|
Update tar crate exports src/tar/lib.rs |
The crate root continues to re-export Charset, Dialect, Entry, Event, and Options but no longer re-exports Reader. |
Suggested reviewers: dylan-conway
Priority:
Merge Risk: 
Minimal · up to 70fa6
-
The reviewed dead-code removals have no established merge-blocking impact.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description explains the problem, fix, scope, behavior impact, verification steps, test results, and known unrelated failures. It does not use the exact template headings, but it provides the required information in equivalent sections.
-
- 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.
There was a problem hiding this comment.
LGTM — a pure dead-code deletion; each removed item has no remaining reference in the tree.
What was reviewed:
- The
fstatat/mknodwrap removal: no C/C++ source calls either; the onlylibc::fstatatcalls insrc/sys/lib.rsare#[cfg(not(linux))], and the Linux path goes through rustix's linux_raw backend (nouse-libcfeature), so nothing links against glibc's 2.33fstatat. Thefstatat64wrap that Ruststdneeds stays. thunk =on#[uws_callback]: no use anywhere in Rust sources, so dropping the parser arm cannot break an in-tree caller.bun_tar::Reader/bun_archive::Plucker: every consumer imports viareader::/archiver::; no crate-root path or glob import exists.NativePtr.onClose/onDrain: no read or write innative-readable.ts; no stale symbol lists inverify-binary.tsor elsewhere name the deleted thunks.
Extended reasoning...
The change is a single commit deleting 28 lines across six files: two glibc --wrap entries plus their C++ thunks and extern/symver declarations, one unused attribute option of a proc macro, two crate-root re-exports, and two unused TypeScript interface members. It touches no security-sensitive surface; the only correctness exposure is the Linux glibc symbol-version floor, which I verified is unaffected by grepping all C/C++ and Rust callers and confirming the remaining libc::fstatat calls are cfg-gated off Linux, with CI's verify-binary.ts ceiling scan as a backstop. No CODEOWNERS entry covers the changed files, there are no third-party reviews or objections, and the bug hunt ran dry, so approval is warranted.
Problem
--wrap=mknodand--wrap=fstatatguard glibc symbols that nothing calls. libarchive was the one caller of both, and Replace libarchive with a tar reader and writer in safe Rust #46638 removed libarchive. The shims__wrap_mknodand__wrap_fstatat(src/jsc/bindings/workaround-missing-symbols.cpp) stayed.thunk = "name"option of#[uws_callback], two crate-root re-exports, and two members of theNativePtrtype.Fix
mknodorfstatat. The debug binary of this branch and the canarybun-profilefor linux x64 and aarch64 import neither.bun bd,bun run rust:check-all(12 targets),cargo check --workspace --all-targetsandobjdump -T. The Notes list the tests.Background
-Wl,--wrap=<symbol>for each glibc symbol newer than 2.17.__wrap_<symbol>calls an older versioned symbol.test/js/bun/symbols.test.tsfails when the binary imports a newer one.#[uws_callback]generates anextern "C"thunk for a method. All 45 uses passexport, which names the symbol.Downsides
thunkon a line that Bun.ModuleGraph: a context per graph for timers and I/O, per-graph CommonJS #42590 removed from main. It conflicts with main today.mknodorfstatatmust restore the wrap. The symbols test reports that case.Behaviour change: none
Notes
Removed
"mknod"and"fstatat"in the-Wl,--wrap=list ofscripts/build/flags.ts.__wrap_mknod,__wrap_fstatat, the__xmknodand__fxstatatdeclarations with theirBUN_SYMVERpins, and_MKNOD_VER.git grep -wfinds no othermknod. The only otherfstatatisbun_sys::fstatat, which is a raw syscall on Linux and Android (src/sys/lib.rs).llvm-nm -uover the 1,489 link inputs of the debug build finds no undefinedmknodorfstatat. Ruststdstill refers tofstatat64, so that wrap stays.objdump -T build/debug/bun-debugon this branch shows__fxstat,__fxstat64and__fxstatat64, and nofstatat,__fxstatat,mknodor__xmknod.bun-profileof main 11c3671, for linux x64 and for linux aarch64, has no__wrap_mknodand no__wrap_fstatatsymbol, and imports neither__xmknodnor__fxstatat.thunk = "name"of#[uws_callback](src/jsc_macros/lib.rs). The one use, onSubprocess::handle_abort_signal, went in Bun.ModuleGraph: a context per graph for timers and I/O, per-graph CommonJS #42590.bun_tar::Readerandbun_archive::Plucker. Every user writesreader::Readerandarchiver::Plucker.Pluckerwas unused before Replace libarchive with a tar reader and writer in safe Rust #46638 too. Both items staypubin their modules.cargo mordantdoes not report an unusedpub usepath, so these two are a hand-found sample and not the whole class.NativePtr.onCloseandNativePtr.onDrain(src/js/internal/streams/native-readable.ts). Nothing reads or writes them.Open pull requests
git merge-tree) with main and with this branch gives the same result for each: 9 merge cleanly both ways, 69 conflict with main already, and this branch adds a conflicted file or hunk to none.mknod, a libcfstatat,thunk = ",bun_tar::Reader,bun_archive::Pluckerand the twoNativePtrmembers:#[bun_uws_shim::uws_callback(thunk = "on_abort_signal_c")], a copy of the line that Bun.ModuleGraph: a context per graph for timers and I/O, per-graph CommonJS #42590 removed.scripts/jsc-exception-lint/summaries/bun.tsv, a generated table with rows for__wrap_mknodand__wrap_fstatat.fstatatin a shim for HarmonyOS, which is not a glibc target. node:fs, Bun.write, fetch: retry EINTR in the bun_sys wrappers instead of surfacing it #45929 edits thelibc::fstatatcall that is compiled off Linux only.pub use archiver::{...}line at its old pathsrc/libarchive/lib.rs. It conflicts with main since Replace libarchive with a tar reader and writer in safe Rust #46638.Found dead in this run, and left alone
scid_lenanddelay_onclose, thebun_uws::uws_resre-export and a commented-out call inFetchHeaders.cpp(http: consolidate the open fetch, Bun.serve, node:http, node:http2 and HTTP/3 pull requests #46528). 36 unused<Class>_getterfunctions inZigGlobalObject.cpp(Resolve runtime globals in builtin modules to the intrinsic, not globalThis #40303).macro(onClose)andmacro(onDrain)inBunBuiltinNames.h(Remove dead code from the class and sink codegen, the streams bindings, and bun_runtime #42266).macro(stream)there, whose$streamdeclarations are in Remove dead code from bun_css, bun_react_compiler, bun_jsc, and smaller crates #40690 and Remove dead code from the class and sink generators, JSBuffer, the bake client, bun-error, and the build scripts #43378.expectedEnumerationValuesand theIDLByteandIDLShortconverters (bun:dom and the Vitest work in one tree (not for merging) #45415), theIDLLongLongconverter (bindgen: deleteb.anyand.variadic#46789),FlagsFormatter(Diagnostics: identify the double close behind the async Closer EBADF assertion on the asan lane #38630),LIBUS_USE_QUIC(Bun.serve: WebSockets over HTTP/3 (RFC 9220) #44165), therustABI of// HOST_EXPORT(Blob, Bun.file: remove unsafe from Blob.rs, read_file.rs, copy_file.rs and Store.rs #40221, S3 client + Bun.WebView host: remove unsafe from webcore/s3 and webview #40252, Bun.build / Bun.Transpiler: remove unsafe from JSBundler, the completion task and JSTranspiler #40405, webcore: remove unsafe from Response/Request/Body/ReadableStream/FileReader/Sink #40411, Worker / console / --hot: remove unsafe from web_worker, ConsoleObject, hot_reloader #40420), the#elsebranch at the end ofroot_certs.cpp(tls: refuse a certificate of the Windows Disallowed stores with --use-system-ca #46929).GlobalObject::promiseHandlerID(Compile TypeScript to machine code ahead of time:bun build --compile --aot#45631).fstatat64,copy_file_rangeandposix_spawn_file_actions_addchdir_np(Ruststd), andlog2f.no_catchof#[uws_callback]is parsed and discarded, and 20 of the 45 uses pass it.bun_clapusesbun_clap::parse_params!.How the candidates were found
-Wl,--gc-sections,--print-gc-sections, joined withllvm-nm -l, maps each discarded function to its source.cargo mordantwithunused_pubonly, over linux, windows and macOS with--all-targets: 146 findings, all already inmordant-baseline.toml.cargo checkput 196 back. The other 32 stay for the reasons Remove dead code: 49 trait impls nothing uses, across 12 crates #43664 gives.node:perf_hookshistograms #46650, Replace bytemuck with an in-tree crate, bun_pod #47037, bindgen: move the remaining 61 classes to schemas and deletegenerate-classes.ts#46329, bindgen: move every Rust function that takes aCallFrameto schemas and delete#[host_fn],$rustand$newRustFunction#46540 and bindgen: move the stream sinks to a schema and deletegenerate-jssink.ts#46641 left behind, and onsrc/js,packages/bun-usockets,packages/bun-uws,src/codegenandscripts.Rejected from the self-review
BunBuiltinNames.handbuiltins.d.ts. Open pull requests hold those lines.BunBuiltinNames.hthat nothing reads, and a refile of the open sweeps that conflict with main. Each is a separate change.Tests, debug build of this branch
cargo clippy -p bun_jsc_macros -p bun_tar -p bun_archive --no-deps: no finding.test/js/bun/archive.test.ts,test/js/node/stream/node-stream.test.js,test/js/node/http/node-http-server-abort-events.test.ts: all pass.test/js/bun/http/bun-serve-ssl.test.ts: 39 of 41 pass in the full file. The other two reach their 5 s limit on this machine, and pass when they run alone.test/js/bun/symbols.test.tsfails on the local debug build for seven symbols that this change does not touch (hypot,hypotf,arc4random,pidfd_spawnp,pidfd_getpid,__isoc23_strtoul,__isoc23_strtoull). Its list has nomknodorfstatat.