#48639: fix: use correct signal variable in nan-spec-runner install check
The install process spawn was not capturing its own signal variable, causing the error check to incorrectly reference the build signal instead. This could lead to:
- Install termination by signal going undetected
- False positive errors when build was killed but install succeeded
This commit ensures the install signal is properly captured and checked, matching the pattern used for the build process.
Description of Change
In script/nan-spec-runner.js, the yarn install spawn (line 115) only destructured status but the error check (line 122) referenced signal from the build process instead of the install process signal. This fix captures the install signal and uses it correctly in the error check.
FIxes #48636
Before:
const { status: installStatus } = cp.spawnSync(...)
if (installStatus !== 0 || signal != null) { // 'signal' is from build ,not install
After:
const { status: installStatus, signal: installSignal } = cp.spawnSync(...)
if (installStatus !== 0 || installSignal != null) {
Checklist
- PR description included and stakeholders cc'd
-
npm testpasses - tests are changed or added
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixed incorrect signal variable reference in nan-spec-runner that could cause install failures to go undetected.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron