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

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.
This commit is contained in:
syntax.sculptor
2025-10-28 20:48:47 +05:30
committed by GitHub
parent 29e0948f7b
commit 21dfa8c732

View File

@@ -118,16 +118,16 @@ async function main () {
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,
cwd: NAN_DIR,
stdio: 'inherit',
shell: process.platform === 'win32'
});
if (installStatus !== 0 || signal != null) {
if (installStatus !== 0 || installSignal != null) {
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?.split(',');