Fix Core binary validation and process detection#16
Merged
Conversation
Copilot created this pull request from a session on behalf of
NamecoinGithub
July 9, 2026 14:13
View session
NamecoinGithub
marked this pull request as ready for review
July 9, 2026 14:13
There was a problem hiding this comment.
Pull request overview
Improves Nexus Core binary handling by tightening validation of configured/bundled binaries and making Core process detection/shutdown more reliable across platforms, while updating documented/tooling requirements and adding a Settings UI helper for selecting an external Core binary.
Changes:
- Hardened Core binary path normalization/validation (absolute-path requirement for overrides, clearer error reporting, Windows
.exevalidation, retain POSIX execute-bit checks). - Reworked Core PID detection to correctly parse
psoutput and match configured paths/realpaths/bundled names without substring false positives; made shutdown safer when no PID is found. - Updated toolchain requirements (README + engines) and added a “Browse” file picker for “Core Binary Path”.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/core.js | Adds stronger Core binary validation, improved PID detection, and safer shutdown behavior. |
| src/App/Settings/Core/EmbeddedCoreSettings.tsx | Adds a file-picker button to populate the Core binary path setting via IPC. |
| README.md | Updates build instructions to current Node/npm requirements. |
| package.json | Raises supported Node/npm versions via engines. |
| package-lock.json | Mirrors updated engines metadata in lockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+108
to
+118
| async function browseCoreBinary() { | ||
| let paths; | ||
| try { | ||
| paths = await ipcRenderer.invoke('show-open-dialog', { | ||
| title: __('Select Nexus Core binary'), | ||
| properties: ['openFile'], | ||
| filters: | ||
| process.platform === 'win32' | ||
| ? [{ name: 'Windows executable', extensions: ['exe'] }] | ||
| : undefined, | ||
| }); |
Comment on lines
201
to
205
| async function getCorePID() { | ||
| const { path: coreBinaryPath, name: resolvedCoreBinaryName } = | ||
| getExecutableCoreBinary(); | ||
| const status = getExecutableCoreBinary(); | ||
| const { path: coreBinaryPath, name: resolvedCoreBinaryName } = status; | ||
| const modEnv = { ...process.env, Nexus_Daemon: resolvedCoreBinaryName }; | ||
| let PID; |
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.
PR #15 exposed Core launch/stop correctness bugs around outdated toolchain docs, Windows executable checks, Linux PID lookup, and configurable binary handling. This narrows the fix to Core binary validation and process management while leaving broader Electron renderer hardening for a separate migration track.
Toolchain requirements
>=22.12.0/ npm>=10.xCore binary validation
.exeand leaves runtime validity to spawnCore process detection
-p 1restrictionCore shutdown
Settings UI