react-native-community / upgrade-helper

⚛️ A web tool to support React Native developers in upgrading their apps.
https://react-native-community.github.io/upgrade-helper
MIT License
3.67k stars 112 forks source link

[iOS] Missing `ios/RnDiffApp.xcworkspace/contents.xcworkspacedata` file #328

Closed cipolleschi closed 2 years ago

cipolleschi commented 2 years ago

Bug

Some versions of the upgrade helper are missing the contents.xcworkspacedata.

This is happening because the Ruby environment is not set properly and the script fails to:

  1. install the dependencies.
  2. create the expected files.

Example failure

The script ignore the failure and proceeds with the job, publishing the diff anyway.

React Native versions

Steps to reproduce

Run the script and see the Cocoapods failure.

Suggested fix

The suggested fix would be to update the new-release.sh script so that:

  1. It installs rbenv (or a similar Ruby Management system
  2. curl the right [Ruby version]() for ReactNative when releasing a new version. It should use the version tags to learn where to look. Example for v0.70.X
  3. Install the right ruby version
  4. Set the ruby version as global version
  5. Proceed with the standard execution.

As an additional safety net, the script should fail if the dependencies are not installed correctly, with a proper error message.

kelset commented 2 years ago

cc @pvinis @lucasbento - can you help us here in understanding how to approach this?

Aside from fixing it, we also need to understand what to do with the affected versions, is there a way to revert a version and regenerate it correctly?


cc @Aleksefo who noticed first, and reported here

pvinis commented 2 years ago

I'll be back to a laptop tomorrow, and I'll check

uzegonemad commented 2 years ago

On a probably related note, going from 0.67.4 to 0.67.5 currently includes about 800 vendor/bundle/ruby/* files, which inevitably crashes the browser tab.

Screen Shot 2022-11-07 at 11 47 09
fabOnReact commented 2 years ago

https://github.com/facebook/react-native/blob/35fa47b3828a5dbaceeca02f333cf3c4a147e3b7/template/Gemfile#L4

error Your Ruby version is 3.0.4, but your Gemfile specified 2.7.5 https://github.com/react-native-community/rn-diff-purge/actions/runs/3406030709/jobs/5672164639#step:7:683

https://stackoverflow.com/a/37915028/7295772

https://circle-macos-docs.s3.amazonaws.com/image-manifest/v8824/index.html

System Version | macOS 12.5.1 (21G83) Installed Rubies | 2.7.6, 3.0.4, 3.1.2 (available to chruby)

I would try to change in ci environment the currently ruby version to 2.7.6 see https://github.com/postmodern/chruby

but I'm not sure it will work

but I noticed that we still use 2.7.6 in our circleci env in main branch https://github.com/facebook/react-native/commit/21c8837c1264cd96f5899e33132fa764bb9c2293

for debugging purposes, I think this ruby scripts are included in https://github.com/facebook/react-native/tree/main/scripts

pvinis commented 2 years ago

Alright. I just read the whole thing here.

pvinis commented 2 years ago

Vendor stuff gone. I manually removed some. Seems like it was only on that specific upgrade to 0.67.5. Fixed and pushed. https://react-native-community.github.io/upgrade-helper/?from=0.67.4&to=0.67.5 and others work as expected again.

fun 😅

Screenshot 2022-11-12 at 00 59 12

I think I will also rebase so we can work with the diffs easier.

pvinis commented 2 years ago

I regenerated the problematic 0.67.5 too, so now the new diffs will not have any vendor stuff in the diffs.

pvinis commented 2 years ago

Ruby issue fixed too. I used asdf in the github-action here https://github.com/react-native-community/rn-diff-purge/blob/master/.github/workflows/new_release.yml, should be fine on the next diff generation. lets keep an eye!

pvinis commented 2 years ago

I think I will close this issue, and lets open it up again if any of the above is not clear or not working. I feel confident for everything, though.