fix: use correct signal variable in nan-spec-runner install check (#48708)

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.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: KinshukSS2 <kinshuk380@gmail.com>
This commit is contained in:
trop[bot] 2025-10-29 14:11:29 +01:00 committed by GitHub
commit 8f23e5a426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,16 +116,16 @@ async function main () {
return process.exit(buildStatus !== 0 ? buildStatus : signal); return process.exit(buildStatus !== 0 ? buildStatus : signal);
} }
const { status: installStatus } = cp.spawnSync(NPX_CMD, [`yarn@${YARN_VERSION}`, 'install'], { const { status: installStatus, signal: installSignal } = cp.spawnSync(NPX_CMD, [`yarn@${YARN_VERSION}`, 'install'], {
env, env,
cwd: NAN_DIR, cwd: NAN_DIR,
stdio: 'inherit', stdio: 'inherit',
shell: process.platform === 'win32' shell: process.platform === 'win32'
}); });
if (installStatus !== 0 || signal != null) { if (installStatus !== 0 || installSignal != null) {
console.error('Failed to install nan node_modules'); console.error('Failed to install nan node_modules');
return process.exit(installStatus !== 0 ? installStatus : signal); return process.exit(installStatus !== 0 ? installStatus : installSignal);
} }
const onlyTests = args.only && args.only.split(','); const onlyTests = args.only && args.only.split(',');