Skip to content
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

Fix spawn calls for node LTS versions #13614

Merged
merged 4 commits into from
Apr 25, 2024
Merged

Fix spawn calls for node LTS versions #13614

merged 4 commits into from
Apr 25, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Apr 17, 2024

What it does

Closes #13613

  1. Updates node-pty to 0.11.0-beta24, as our currently used version uses a spawn call that leads to errors on current LTS versions of node
  2. Updates our child_process#spawn calls to use the { shell: true } options. This circumvents the changes for the LTS versions.

How to test

Confirm that the CI is green on Windows

Otherwise, perform a manual smoke test on Windows with focus on the terminal functionality.

Follow-ups

Review checklist

Reminder for reviewers

@msujew msujew added the OS/Windows issues related to the Windows OS label Apr 17, 2024
@msujew msujew force-pushed the msujew/node-lts branch 6 times, most recently from c66fe2c to f0ce4c6 Compare April 18, 2024 13:20
@tsmaeder
Copy link
Contributor

@msujew I guess this one's not ready for review with the PR checks failing?

@msujew
Copy link
Member Author

msujew commented Apr 18, 2024

@tsmaeder Nope, there seem to be some pretty major changes in node-pty (on Unix, it still works as expected on Windows) in more current versions related to the error behavior. I.e. spawning a process on a non-existing file doesn't throw anymore but instead just prints to the console and exits with exit code 1. I'm currently working on consolidating those changes with our expectations.

@msujew
Copy link
Member Author

msujew commented Apr 18, 2024

@tsmaeder No idea what Microsoft has done there (note that I'm exclusively working on fixing breaking changes due to the updated version of node-pty), I can't even reproduce the error the CI gets on Windows, since the process just freezes. I've tried fixing this for the past 4 hours, I'm done for the week :)

@msujew msujew marked this pull request as draft April 22, 2024 08:48
@msujew
Copy link
Member Author

msujew commented Apr 24, 2024

@planger Can I ask you to take a look at the playwright test errors (or can we just merge independent of these errors)? I'm not too deep in there and it would be good to have this fix for tomorrows release.

@msujew msujew marked this pull request as ready for review April 24, 2024 12:58
@msujew msujew requested a review from tsmaeder April 24, 2024 12:58
@msujew
Copy link
Member Author

msujew commented Apr 24, 2024

@tsmaeder I found an earlier version of node-pty that doesn't have the erroneous install script, while still using the old (non-breaking) behavior. This seems to satisfy all our tests (except for the Playwright tests, which is probably alright for now). Asking nicely for a review so we can have this in tomorrows release :)

@planger
Copy link
Contributor

planger commented Apr 24, 2024

@msujew Sure, I'm just quite busy the next few days. So I suggest to just skip the failing tests for now and please create an issue for re-enabling them with a fix. I'm happy to look into it next week. Thank you very much!

Copy link
Contributor

@tsmaeder tsmaeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you find a description of the fix that explains what adding "shell: true" is the right workaund? I haven't been able to find a description of what nodejs actually changed.

@msujew
Copy link
Member Author

msujew commented Apr 25, 2024

Did you find a description of the fix that explains what adding "shell: true" is the right workaund? I haven't been able to find a description of what nodejs actually changed.

Not really. The changelog just states that they fixed an issue when not using shell: true, see here. The consequence is that by not using shell: true the spawn call will just fail with EINVAL. See also other projects that suffer from this issue like forcedotcom/cli#2843.

@tsmaeder
Copy link
Contributor

I think this one is a good description: nodejs/node#52681 (comment). I guess always using "shell: true" won't hurt, usually. As for when we construct the process execution ourselves, we could differentiate between scrips and executables.

@msujew msujew merged commit de86a44 into master Apr 25, 2024
13 of 14 checks passed
@msujew msujew deleted the msujew/node-lts branch April 25, 2024 15:23
@github-actions github-actions bot added this to the 1.49.0 milestone Apr 25, 2024
@msujew
Copy link
Member Author

msujew commented Apr 29, 2024

@planger False alarm. It wasn't a false positive, but I actually broke terminals for Unix. I've fixed it again and the tests are green now, so no need for action on your side :)

@planger
Copy link
Contributor

planger commented Apr 29, 2024

@msujew Oh, ok great that you've fixed it and that the tests actually helped revealing a real issue 💯 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS/Windows issues related to the Windows OS
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Build fails on Windows on latest Node versions
3 participants