-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix crash on read-only filesystems in Ruby 3.4 #8372
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
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
Hi @Vasfed, thanks for the work on fixing this! My first idea for the fix was something a bit different. It was doing it in two steps:
What do you think? |
Hi @deivid-rodriguez at first only rescuing the exception was my first idea too, but in this case there're several warnings to stdout/stderr (from ruby itself and bundler). About breaking changes - me too never encountered when tmp home is needed and there's no workaround. As for warning - may be print it only if an exception actually occurs |
5a32ec3
to
1ca9085
Compare
Changed to only rescue exception |
1ca9085
to
351f66b
Compare
Sorry for the delay @Vasfed. This looks great! I rebased and made one change to convert the spec to a workflow that runs Bundler on a read-only system. The rationale being that the kind of test added in rubygems/bundler#6482 did not catch the issue introduced with Ruby 3.4, so I prefer to switch to something more realistic that will prevent the problem from being reintroduced in the future. |
351f66b
to
adad81c
Compare
adad81c
to
027cdc7
Compare
Thanks so much @Vasfed! |
Fix crash on read-only filesystems in Ruby 3.4 (cherry picked from commit 71442ad)
What was the end-user or developer problem that led to this PR?
This fixes #8369.
When running with readonly filesystem and no tmp directory on ruby 3.4 bundler raises exception on start
What is your fix for the problem, implemented in this PR?
While trying to check global installed plugins bundler internally tries to create tmp user home, which is not needed in this case. Added flag
writable
toBundler.user_bundle_path
(default true to keep previous behavior) to be able to determine whether intent is to have a writeable directory ornil
will suffice.Make sure the following tasks are checked