-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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(git-spawn): Add custom Batch wrapper when using plink.exe (#4729) #4805
Conversation
…using plink on Windows Fixes yarnpkg#4729.
This change will increase the build size from 9.94 MB to 9.94 MB, an increase of 1.71 KB (0%)
|
1 similar comment
This change will increase the build size from 9.94 MB to 9.94 MB, an increase of 1.71 KB (0%)
|
Unfortunately that won't work with the single-file releases, so I don't think we can merge it :( |
@arcanis Oh, I didn't think of that. 😢 But actually, I think I found another (even better) way of doing this! Apparently |
@neonowy are you sure it is not this line forcing everything to be lower case: yarn/src/util/git/git-spawn.js Line 17 in 6b185c2
|
@BYK I've tested it and it doesn't make any difference. If I understand this code right, we're using |
Closing in favor of #4806. |
**Summary** Fixes #4729. Previous version in #4805. Manually specify `GIT_SSH_VARIANT` in order to get package download via `git+ssh` with a non-standard port when using `plink.exe` working. Without `GIT_SSH_VARIANT` set properly, Git won't convert `-p` into `-P` and `plink.exe` will throw an error about unknown `-p` parameter. **Test plan** *Before:*  *After:*  Also got `git-spawn.js` test suite updated for testing `GIT_SSH_VARIANT`.
**Summary** Fixes yarnpkg#4729. Previous version in yarnpkg#4805. Manually specify `GIT_SSH_VARIANT` in order to get package download via `git+ssh` with a non-standard port when using `plink.exe` working. Without `GIT_SSH_VARIANT` set properly, Git won't convert `-p` into `-P` and `plink.exe` will throw an error about unknown `-p` parameter. **Test plan** *Before:*  *After:*  Also got `git-spawn.js` test suite updated for testing `GIT_SSH_VARIANT`.
Summary
Fixes #4729.
The main issue is that we use
GIT_SSH_COMMAND
instead ofGIT_SSH
, as we have to pass-batch
argument in order to usessh
/plink
in the non-interactive mode. Unfortunately, Git converts-p
to-P
forplink.exe
only when usingGIT_SSH
.The only way I could find to get out of this tricky issue is to create a wrapper script responsible for the
-p
/-P
conversion and use it whenplink.exe
is provided viaGIT_SSH
.Similar issue was also described here: https://jira.atlassian.com/browse/SRCTREEWIN-5600?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
I'm not quite sure if the
bin/
directory is the best place for the wrapper scriptyarn-plink.cmd
, wouldscripts/
be a better choice?Test plan
Before:
After:
I've also updated the test suite for
git-spawn.js
accordingly, but couldn't figure out how to test theyarn-plink.cmd
wrapper script.