-
Notifications
You must be signed in to change notification settings - Fork 290
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: fix stdio and tons of windows issues #684
base: master
Are you sure you want to change the base?
Conversation
This PR adds back stdio for output priting and the `shell: true` to spawn method so it can properly run in Windows. This was broken in serverless@937fa56
Hello @jeanbmar - could you share more what exactly was broken? How can I reproduce it to validate the bug? |
We can see in 937fa56 that: serverless-python-requirements/lib/pip.js Line 256 in f2d73ea
was changed to: serverless-python-requirements/lib/pip.js Line 275 in 937fa56
4 years after the
This recent PR #679 is dirty because it will print interesting information when an exception is thrown. Except that bad things happening in Docker don't necessary crash the spawn process, and thus don't throw an exception. To reproduce what I'm saying, add a private package to your requirements.txt and try building your python requirements without adding the SSH key. Your build will fail and you will get no log. I come to the second point. As a work around for this lack of std, I ran the This is because PowerShell uses a shell and the dockerRunCmdExtraArgs:
- '-e'
- 'GIT_SSH_COMMAND="cp ~/.ssh/id_rsa ~/id_rsa && chmod 600 ~/id_rsa && ssh -i ~/id_rsa"' This won't work if the spawn process isn't a shell because embedded commands can't be evaluated. tl;dr let spawnArgs = { shell: true };
spawnArgs.stdio = 'inherit';
/* ... */
await spawn(cmd, args, spawnArgs); |
Hey @jeanbmar - sorry for not taking care of this PR earlier, I missed it, and then didn't have time to dedicate to this project. I'll try to review it more deeply in the coming days/weeks. Thanks for your work 🙇 |
This PR adds back stdio for output priting and the
shell: true
to spawn method so it can properly run on Windows.This was broken in 937fa56