estrella
estrella copied to clipboard
Terminating subprocess on Windows when "running" is flaky
"estrella": "^1.4.0",
This config:
estrella.build({
watch: true,
run: "node build/index.js" // this process not killing
})
Temporary solution:
let childProcess = null
estrella.build({
onEnd: () => {
if (childProcess) {
childProcess.kill('SIGINT')
}
childProcess = spawn('node', ['build/index.js'], {
stdio: [process.stdin, process.stdout, process.stderr],
})
},
})
What OS are you using? (Estrella uses Nodejs's child_process module and process groups on POSIX systems to allow for process tree control)
Also can you please provide a complete repro? (ideally as a gist or a zip or tar archive)
FTR, the signalling code is here:
https://github.com/rsms/estrella/blob/7294055202b0ea6004ed4cac2fd22e8079497f17/src/exec.ts#L272-L320
What OS are you using? (Estrella uses Nodejs's child_process module and process groups on POSIX systems to allow for process tree control)
windows 10 of course
Ah, yeah you're going to have some issues if the process is not responding to hangup or int signals. You could try WSL or run your build manually (either in a BAT script or from js in onEnd, but you'll likely run into similar issues as with estrella using nodejs.)
Why you not use this code in windows platforms? =) This fix works on me:
let childProcess = null
estrella.build({
onEnd: () => {
if (childProcess) {
childProcess.kill('SIGINT')
}
childProcess = spawn('node', ['build/index.js'], {
stdio: [process.stdin, process.stdout, process.stderr],
})
},
})
i can use WSL or WSL2 or docker or my macbook, but we need fix the bug, not hide the bug)