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

Upgrade Ruby to 3.x? #594

Closed
traviswimer opened this issue Feb 6, 2023 · 5 comments
Closed

Upgrade Ruby to 3.x? #594

traviswimer opened this issue Feb 6, 2023 · 5 comments

Comments

@traviswimer
Copy link

Introduction

Currently, the .ruby-version file in RN projects sets the Ruby version to 2.7.6. From what I understand, Ruby's support for 2.7 will end in April (it is already considered a "security maintenance" branch).

Is it possible to upgrade to Ruby 3 in the near future?

Details

I'm not sure why React Native depends on such an old version of Ruby, but I assume there is likely an important reason. What is preventing it from being upgraded?

Ruby 2.7's end-of-life came to my attention because the CI service I'm using is going to drop support. I'm sure I can find a way to work around this and install it manually, but it's representative of the types of problems that may arise in the future.

Also, there will no longer be any security fixes on 2.7. I'm not sure to what extent this should be concerning since in this context Ruby itself isn't used in production, but I would imagine there is still cause for concern.

Discussion points

  • Why is React Native currently using an outdated version?
  • What problems will result from Ruby 2.7's end-of-life?
  • Are there any security concerns?
  • Is it feasible to upgrade to Ruby 3.x?
@cipolleschi
Copy link

Hi @traviswimer, thank you for the question.

I started thinking that we should update to the latest stable ruby supported by CircleCI and by our internal CI system.
There is also a PR open already in the React Native repo facebook/react-native#36074 to do so, although it requires some more work.

Let's try to update the version of ruby and let's see what break. If they are just versions or few deprecated methods that have been removed and that are easily replaceable, we are good to go.

@traviswimer
Copy link
Author

@cipolleschi That's awesome to hear!

I'm a little confused what impact the upgrade would have. Is Ruby only used for installing/using cocoapods?

If so, I'm guessing this would mostly impact Hermes and Flipper?

Would it be likely to break many third-party libraries?

@cipolleschi
Copy link

Is Ruby only used for installing/using cocoapods?
If so, I'm guessing this would mostly impact Hermes and Flipper?

We use ruby to install Cocoapods and to run a bunch of other scripts (from this folder) that are triggered by this file.

So, the upgrade can break some tests and some of that logic.
I personally don't like this setup, I'd love to use ruby ONLY to install dependencies. But currently that's the situation.

Would it be likely to break many third-party libraries?

I don't think so, at least not "normal" libraries that are installed via yarn add <library> without doing anything specific. some advanced user may have customized their Podfile and monkey-patched ruby files with some personal script, though... But it should not our responsibility to fix them. We will provide support, if needed.

@mjmasn
Copy link

mjmasn commented Feb 9, 2023

Some anecdata: we've been using 3.0.0 with no ill effects for a while now - just a case of changing the version numbers in .ruby-version and Gemfile. Only slightly annoying thing not having ruby 2.7 installed is for new RN apps pods will fail to install when generating the project (claims cocoapods is not installed), but this will work again after manually updating the version numbers and re-running pod install.

@traviswimer
Copy link
Author

The maintainers chose to start supporting a range of Ruby versions rather than one specific version, so Ruby 3 is now supported.

Read these comments for more info:

I'm closing this issue since it is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants