fix(build): make native ABI switching interruption-safe#446
Open
AmagiDDmxh wants to merge 1 commit into
Open
Conversation
AmagiDDmxh
force-pushed
the
feat/native-runtime-dx
branch
from
July 15, 2026 20:51
82cdf9a to
58b403d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Spool keeps one installed
better-sqlite3binary and switches it between the Node and Electron ABIs. Two parts of that workflow were costly or fragile:pretestrebuilt the Node addon unconditionally, even when the installed binary already matched the current Node ABI.with-electron-native.mjsused synchronous child processes, so an interrupt could terminate the wrapper before its Node-ABI restoration completed.What changed
better-sqlite3with a real in-memory query before rebuilding for Node; rebuild only when the load/query fails.SIGHUP,SIGINT, andSIGTERMto the active child while keeping the wrapper alive long enough to restore the Node ABI.Verification
pnpm run ensure:native:nodeand skipped compilation.better-sqlite3then loaded successfully under Node ABI 137 and executed an in-memory query.node --checkand focused Oxlint.pnpm checkreached the CLI suite, where 56/60 tests passed; four multi-process pin/unpin tests exceeded their existing 5-second timeout on this host. No timeout was changed or relaxed; PR CI remains the confirmation for those tests.