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 Windows + JRuby no longer being able to install git sources #4196

Merged
merged 4 commits into from
Dec 28, 2020

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Dec 24, 2020

What was the end-user or developer problem that led to this PR?

The problem is that bundler 2.2 can no longer install git sources under Windows + JRuby.

What is your fix for the problem, implemented in this PR?

First I considered it could be a Windows escaping issue, so I made some changes so that the git commands bundler runs under the hood no longer use a shell but call git directly. This is similar to #4190, but for bundler. I'm unsure whether that fixed anything regarding this issue, but I'd say no because Ruby on Windows CI was previously passing, so it must be something specific to jruby. Anyways, this change seems like a good move anyways, so I left it there.

After that, I remembered being hit by some issues with jruby not properly handling the :chdir parameter to Process.spawn and friends. See jruby/jruby#6153.

So to workaround this issue I tried using the -C CLI flag to git instead of the :chdir parameter to Process.spawn, and that worked just fine!

I also added a bare integration test to specifically check this simple case on JRuby + Windows.

Fixes #4195.

Make sure the following tasks are checked

@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Dec 24, 2020

The last commit in this branch seems to fix #4195!

@deivid-rodriguez deivid-rodriguez force-pushed the no_subshells_for_git_commands branch 3 times, most recently from ce5e013 to b4f84ec Compare December 28, 2020 12:53
@deivid-rodriguez deivid-rodriguez changed the title Avoid subshells when running git commands Fix Windows + JRuby no longer being able to install git sources Dec 28, 2020
@deivid-rodriguez deivid-rodriguez merged commit 93e97c9 into master Dec 28, 2020
@deivid-rodriguez deivid-rodriguez deleted the no_subshells_for_git_commands branch December 28, 2020 14:52
deivid-rodriguez added a commit that referenced this pull request Dec 29, 2020
Fix Windows + JRuby no longer being able to install git sources

(cherry picked from commit 93e97c9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Regression] bundle 2.2.x fails to install dependencies from Git on JRuby + Windows
2 participants