-
Notifications
You must be signed in to change notification settings - Fork 533
Remove calls to Dir.chdir #673
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
5d269d8
to
618743e
Compare
I rewrote the functionality using Open3 library instead of IO.popen. This should fix the issues with jruby on windows not supporting chdir. |
cc @jcouball |
@fxposter thank you very much for this PR and #675 This PR is still failing for JRuby on Windows. I faced the same problems when trying to solve these problems and more (#355, #363, #441, #495, #516, #574). I almost have that solution over the finish line with #617. This is (to the best I can tell) only missing one JRuby issue which is tracked in jruby/jruby#7515. I am wondering if you gave #617 a try? I would love feedback on that one. |
I'll take a look, but do you really believe that you need to have "process execution" abstraction instead of using the existing ones? :) PS. I'll get to a windows machine on the weekend, will try to check what is going on there, cause open3 specifically have code that should handle chdir/etc: https://github.com/ruby/open3/blob/master/lib/open3/jruby_windows.rb#L81 |
618743e
to
9a573a3
Compare
@jcouball can you review and run tests again?
to avoid that I do |
Also, before merging: I rewrote code like
to
The end result is the same, but |
Thanks @fxposter, we are getting very close! Only one error left in the Windows JRuby build. I see that the failure is in My first comment is that I am not a fan of this test case since it is just one big test case with a lot of state changing and asserts sprinkled through the method. An isolated, minimal, failing test case would be ideal but not necessary. The first think I would try is to use I honestly don't understand why the Beyond that, maybe something related to the changes you are making might stick out to you. I have changed the configuration of the GitHub actions for the CI build so that the build will run when you push changes. This way you won't have to wait for me or another contributor for feedback. |
:( I hoped that the last change fixes everything on jruby on windows. The tricky part here is that locally some tests are always failing for me on both Mac and Windows (while they pass in CI), so I assumed I fixed everything. I'll try to focus on the failing one, as I have access to windows machine during the weekend. |
Regarding your comment about which Ruby release should be supported, here is release information for some Ruby releases from the Ruby Maintenance Branches page:
I think for this PR we could change the required version of Ruby in the gemspec to 2.5. I notice that the CI build only goes back to 2.7 so there should probably be a build added for MRI 2.5 on Linux at least. It would be my intention to follow up with an explicit policy that this gem follows for supported Ruby version in a separate PR. The policy could be something like "Support all non-EOL Ruby minor versions" (currently 3.0, 3.1, and 3.2). We could possibly include the latest EOL minor version as well (which would add 2.7 until 3.0 is EOL'd in March 2024). |
Huh, that shouldn't be and is concerning. If the CI builds pass and the local build works for me (which it does), they I'd accept the pull request. If you want to share details of your failure(s) we can try to debug. I am on Mac so that is where I can be most helpful. |
sure. this is what I get on my mac by default (probably it's related to my user git's config, but I didn't try to debug that yet, since it failed on master as well):
|
@fxposter what is the output of
|
Looks like you might have |
and lots of others, probably unrelated |
It looks like |
@fxposter if you rebase with master, test_push(TestRemotes) should pass in on your Mac now. |
37f92a1
to
079893d
Compare
In multithreaded environment Dir.chdir changes current directory of all process' threads, so other threads might misbehave. Base#chdir, Base#with_working and Base#with_temp_working were left intact, cause they are not used internally, so it's an explicit user decision to use them. Signed-off-by: Pavel Forkert <fxposter@gmail.com>
079893d
to
65c0cc6
Compare
Your checklist for this pull request
🚨Please review the guidelines for contributing to this repository.
Description
In multithreaded environment Dir.chdir changes current directory of all process' threads, so other threads might misbehave.
Base#chdir, Base#with_working and Base#with_temp_working were left intact, cause they are not used internally, so it's an explicit user decision to use them.
Fixes #355