-
Notifications
You must be signed in to change notification settings - Fork 35
Do not bind SIGTERM in Windows #1031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
8c07835 to
443a2d9
Compare
|
Odd. It looks like the tests don't fail on Windows, but they don't pass either. |
|
It's wierd that looks like it succeeds, but I can reproduce it locally that in pwsh it's returning status code 1. It's defaulting to pwsh, but passes successfully on bash, so I'm just going to switch it to bash. |
2bb4609 to
87301b2
Compare
|
Now it's hanging on the main.test.ts in Windows bash. |
36fd4a9 to
ccc3d66
Compare
|
The test produced stderr which caused the test to fail in pwsh. In bash, it would hang because bash is capturing command's stderr which disrupted ctrlc-windows function. In @effectionx/process we use ctrlc-windows with a process in detached mode which bypasses this problem. Here, I had to use cmd shell which doesn't disrupt stderr like bash, nor fail the process when stderr is produced. |
ccc3d66 to
8da04ec
Compare
Additionaly: * use ctrlc-windows to terminate processes in Windows in tests
…ent line endings (LF) across all platforms, which should fix the "Text differed by line endings" error in CI.
8da04ec to
9e96b4b
Compare
Motivation
Problem 1: Binding SIGTERM in windows in Deno triggers this warning
Windows only supports ctrl-c (SIGINT), ctrl-break (SIGBREAK), and ctrl-close (SIGUP). We don't wantmainto produce any warnings.To verify that this is working on Windows, I ran tests on windows. Which lead to Problem 2:
TypeError: Windows only supports ctrl-c (SIGINT), ctrl-break (SIGBREAK), and ctrl-close (SIGUP), but got SIGTERM(note the but got SIGTERM)Approach
The solution to problem 1 is to avoid binding SIGTERM in Deno and Node using their platform flags.
The solution to problem 2 is to use ctrlc-windows instead of sending SIGINT to terminate in Windows.
The test produced stderr which caused the test to fail in pwsh. In bash, it would hang because bash is capturing command's stderr which disrupted ctrlc-windows function. In
@effectionx/processwe use ctrlc-windows with a process in detached mode which bypasses this problem. I usedcmdshell which doesn't disrupt stderr like bash, nor fails the process when stderr is produced.