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

Bump ruby version to 3.1.3 #36074

Closed
wants to merge 6 commits into from
Closed

Bump ruby version to 3.1.3 #36074

wants to merge 6 commits into from

Conversation

spuyet
Copy link

@spuyet spuyet commented Feb 6, 2023

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
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 [email protected]. Thanks!

@analysis-bot
Copy link

analysis-bot commented Feb 6, 2023

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
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
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
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
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
Copy link
Contributor

dcangulo commented Feb 7, 2023

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
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
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
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
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
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
Copy link
Author

spuyet commented Feb 7, 2023

@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
Copy link
Author

spuyet commented Feb 7, 2023

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 on lines 970 to 971
ls -l vendor/bundle/ruby
ls -l vendor/bundle/ruby/3.1.0/bin
Copy link
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
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
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
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!

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

@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

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
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
Contributor

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

@cipolleschi
Copy link
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
Copy link

tibbe commented Dec 18, 2023

@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
Copy link
Contributor

kelset commented Dec 18, 2023

@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