Remove dead Windows error tables#31995
Conversation
|
Updated 12:05 AM PT - Jun 10th, 2026
❌ @robobun, your commit fdf490b has 2 failures in
🧪 To try this PR locally: bunx bun-pr 31995That installs a local version of the PR into your bun-31995 --bun |
|
@robobun adopt |
b500c6b to
4e22c28
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe pull request refactors Windows errno enum generation to use a unified X-macro scheme combining Linux and UV error lists, removes the ChangesWindows errno enum generation refactoring
Windows error API surface updates
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
Adopted and verified: deleted symbols have no callers, the E/SystemErrno macro expansion matches main exactly (-Zunpretty=expanded, x86_64-pc-windows-msvc), both Windows triples pass cargo check, review feedback addressed. Full equivalence proof in the PR body. Build 61611 finished: all Windows lanes passed, and they are the only lanes that compile this diff (all three files are Windows-gated or unreferenced declarations). The two red lanes are Linux-only flakes unrelated to the change: streams-leak.test.ts (wire-coalescing chunk count) on x64-baseline, and complex-workspace.test.ts (git killed with signal 9 during setup) plus html-rewriter-leak.test.ts (RSS threshold) on ASAN. Ready to merge. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/windows_sys/externs.rs`:
- Around line 952-954: Update the doc comment in externs.rs so it correctly
describes the tiering: state that the subset referenced by lower-tier crates is
the named subset, while errno/bun_errno mapping is a higher-tier concern (i.e.,
T0 must not depend on T1), not the other way around; specifically, replace the
sentence that says "`errno` is a lower-tier crate" with wording that identifies
`bun_errno`/`errno` as the higher-tier mapping and clarifies that new MS-ERREF
consts may be added without ABI change, matching the T0/T1 contract referenced
elsewhere.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4fd69d21-3e89-4ca9-a634-5e407a3ff86e
📒 Files selected for processing (3)
src/errno/windows_errno.rssrc/sys/windows/mod.rssrc/windows_sys/externs.rs
What this does
Removes dead Windows error-handling code and dedups the errno enum listings. Zero intended behavior change.
src/sys/windows/mod.rs: deletes the#[cfg(any())]-parked 1,188-variant MS-ERREF reference table (never compiled) andwin_sock_error_to_zig_error, which had no callers.src/windows_sys/externs.rs: deletes theWinsockErrornewtype, whose only consumer was that converter.bun_windows_sys::Win32Errorremains the single compiled WSA table (already the onebun_errnouses).src/errno/windows_errno.rs:enum Eandenum SystemErrnowere two hand-maintained 138-variant listings that must stay in lockstep (ordinals driveSystemErrno::to_e). Both are now emitted from one sharedfor_each_linux_errno!X-macro list, the same pattern the existingfor_each_uv_errno!tail already uses.Net -3.2k lines. Split from #31912 (closed in favor of module-scoped splits).
Verification
win_sock_error_to_zig_errorandWinsockErrorhave no references outside their own definition sites on main.bun_errno(-Zunpretty=expanded,x86_64-pc-windows-msvc) before and after: theenum Eandenum SystemErrnobodies are identical in variant names, values, and order. The only textual difference is a doc comment onENOTSUPthat became a regular comment in the macro list.cargo check --workspacepasses forx86_64-pc-windows-msvcandaarch64-pc-windows-msvc, the only targets that compilewindows_errno.rsandsys/windows/mod.rs(both#[cfg(windows)]-gated; theexterns.rshunk removes declarations only).rust-check-allalso passed all 10 targets on the original commit.No runtime test accompanies this PR because there is no behavior to pin down: the deleted items had zero references, and the enum dedup expands to identical code, so no test can distinguish before from after on any platform. The expansion diff above is the equivalence proof.