Skip to content

Bump ruby version to 3.1.3#36074

Closed
spuyet wants to merge 6 commits into
react:mainfrom
spuyet:main
Closed

Bump ruby version to 3.1.3#36074
spuyet wants to merge 6 commits into
react:mainfrom
spuyet:main

Conversation

@spuyet

@spuyet spuyet commented Feb 6, 2023

Copy link
Copy Markdown

Summary

Ruby 2.7 EOL is in less than 2 months so we should bump the version to the latest one available.

This is could break some stuff, let's see if the CI is complaining 😉

Changelog

[GENERAL] [CHANGED] - Bump ruby version to 3.1.3

Test plan

No particular test plan.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Hi @spuyet!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@analysis-bot

analysis-bot commented Feb 6, 2023

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,474,365 -2,145
android hermes armeabi-v7a 7,796,003 -2,182
android hermes x86 8,950,314 -2,316
android hermes x86_64 8,807,897 -2,655
android jsc arm64-v8a 9,656,819 +542,843
android jsc armeabi-v7a 8,392,054 +81,207
android jsc x86 9,720,429 +554,777
android jsc x86_64 10,197,083 +772,424

Base commit: 7c82a3f
Branch: main

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2023
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

2 similar comments
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@dcangulo

dcangulo commented Feb 7, 2023

Copy link
Copy Markdown
Contributor

I think you should also bump the xcode_version like in this commit 2c87b74.

Supported Xcode versions: https://circleci.com/docs/using-macos/

Xcode 14.2.0 only support Ruby 3.1.3 though not 3.2.0. https://circle-macos-docs.s3.amazonaws.com/image-manifest/v10821/manifest.txt

Also not sure if Ruby 3 is good to go per #33485 discussion

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

2 similar comments
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@kelset kelset added the Platform: iOS iOS applications. label Feb 7, 2023
@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@spuyet

spuyet commented Feb 7, 2023

Copy link
Copy Markdown
Author

@dcangulo Thx for you help, I bumped the Xcode version to 14.2.0 and set ruby version to 3.1.3, let's see what is going to break 😄

@spuyet spuyet changed the title Bump ruby version to 3.2.0 Bump ruby version to 3.1.3 Feb 7, 2023
@spuyet

spuyet commented Feb 7, 2023

Copy link
Copy Markdown
Author

There is some breaking changes with the release of Xcode 14.2: https://discuss.circleci.com/t/xcode-14-2-released-breaking-changes/46303

chruby (ruby versions manager) has been replaced by rbenv which is way more popular. They have built a dedicated orb to manage ruby versions on macos.

Comment thread .circleci/config.yml Outdated
Comment on lines +970 to +971
ls -l vendor/bundle/ruby
ls -l vendor/bundle/ruby/3.1.0/bin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these lines?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still debugging the build as it does not work, looks like bundle exec pod fails because the binstub is not found for ruby 3.1.3, it needs more investigation. This is not easy to debug as the whole build is extremely slow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know... We need to set aside some time to make it faster and more efficient... :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort you are putting into it!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like the test_ios_rntester job is missing the setup_ruby step. This is where gems are installed, so Cocoapods doesn't exist. (I'm guessing maybe it was previously working because it was pulling the gems from a cache?)

Can we add the setup_ruby step to test_ios_rntester, or will that break something?

@traviswimer

Copy link
Copy Markdown

@spuyet

There is some breaking changes with the release of Xcode 14.2: https://discuss.circleci.com/t/xcode-14-2-released-breaking-changes/46303

chruby (ruby versions manager) has been replaced by rbenv which is way more popular. They have built a dedicated orb to manage ruby versions on macos.

It looks like things aren't very consistent with Ruby on CircleCI. There is a fairly recent support article that says:

The only officially supported way to change the Ruby version on CircleCI macOS machines is to use chruby.

But, it looks like circleci/macos@2 uses both rbenv and chruby. It's also weird, because using macos/switch-ruby doesn't actually install that version. It worked for you because Ruby 3.1.3 happens to be one that is currently installed by default.

I was trying to get 2.7.6 to work in my own project, and I needed to do this:

steps:
      - run:
          name: Install Ruby
          command: rbenv install 2.7.6
      - macos/switch-ruby:
          version: 2.7.6

It may be necessary to consider this if RN intends to continue to pin each version to an exact version of Ruby.

I suppose the options are:

  • Add a check to ensure that the correct version is installed.
  • or accept that the tests will fail when new patch versions are released.

@traviswimer

Copy link
Copy Markdown

I managed to get all the tests passing with 3.1.3. I forked @spuyet 's fork and made a separate PR to run the tests: #36205

@cipolleschi

Copy link
Copy Markdown
Contributor

Hi @spuyet! Thank you so much for this PR: it was extremely helpful and instrumental to kickstart an internal discussion with the React org about the DevX we want to provide related to Ruby.

We decided to go into a different direction and to support a wider range of Ruby versions rather than fixing a single specific one. See this comment for further info.

Again, thank you so much for all the work you are putting in your contributions, please keep'em coming: we strongly believe that React Native and Meta could benefit from OSS contributions as much as the community can benefit from our work on the framework!

Thank you so much! 🙇

@kevinvangelder

Copy link
Copy Markdown
Contributor

@cipolleschi Could you post an update/conclusion to the Discussions and Proposals thread?

@cipolleschi

Copy link
Copy Markdown
Contributor

@kevinvangelder we removed all the ruby requirements (but not Ruby Bundler) from the codebase, so now React Native should work with all the Ruby versions from 2.6.8 up to 3.2.1. In CI, we are testing 2.6.8, 2.7.7 and 3.2.0.

@tibbe

tibbe commented Dec 18, 2023

Copy link
Copy Markdown

@kevinvangelder we removed all the ruby requirements (but not Ruby Bundler) from the codebase, so now React Native should work with all the Ruby versions from 2.6.8 up to 3.2.1. In CI, we are testing 2.6.8, 2.7.7 and 3.2.0.

Which React Native versions does this apply to?

@kelset

kelset commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

@tibbe I think this should apply to all the versions in the current support window, so 73-72-71. Probably also 70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants