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

Fix Hermes not being downloaded on RC5 #33945

Merged
merged 1 commit into from
Jun 1, 2022
Merged

Conversation

cortinico
Copy link
Contributor

@cortinico cortinico commented Jun 1, 2022

Summary

With RC5, we're not effectively downloading the Hermes tarball from the Github releases. Here the fix.

Changelog

[Internal] - Fix Hermes not being downloaded on RC5 on iOS

Test Plan

This PR should be merged on the release branch alongside this cherry-pick:
f1775ba

How I tested this.

  1. npx react-native init RN069 --version next --skip-install
  2. Replicate the aformentioned cherry-pick with: echo "hermes-2022-05-20-RNv0.69.0-ee8941b8874132b8f83e4486b63ed5c19fc3f111" > node_modules/react-native/sdks/.hermesversion
  3. Apply this PR to the react_native_pods.rb file.
  4. Enable Hermes inside the Podfile
  5. Edit the following file to point to a tarball on my fork (which doesn't contain the extra .podspec inside it): node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec
if version == '1000.0.0'
  Pod::UI.puts '[Hermes] Hermes needs to be compiled, installing hermes-engine may take a while...'.yellow if Object.const_defined?("Pod::UI")
  source[:git] = git
  source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip
elsif currentremote.strip.end_with?("facebook/react-native.git") and currentbranch.strip.end_with?("-stable")
  Pod::UI.puts '[Hermes] Detected that you are on a React Native release branch, building Hermes from source...'.yellow if Object.const_defined?("Pod::UI")
  source[:git] = git
  source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip
else
+ source[:http] = "https://github.com/cortinico/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz"
- source[:http] = "https://github.com/facebook/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz"
end
  1. Run pod install
  2. Run the app with npx react-native run-ios

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jun 1, 2022
@cortinico cortinico marked this pull request as ready for review June 1, 2022 14:13
@cortinico cortinico requested a review from hramos as a code owner June 1, 2022 14:13
@cortinico cortinico merged commit 7262acc into 0.69-stable Jun 1, 2022
facebook-github-bot pushed a commit that referenced this pull request Jun 2, 2022
…tarball.

Summary:
I'm backporting PR #33945 to main
as it was merged on the release branch to unblock 0.69.

Those changes are necessary as Hermes was not being donwloaded at all during `pod install`
on .69 and the app was failing to build with a missing `hermes/hermes.h` import.

Changelog:
[iOS] [Fixed] - Fix Hermes not being properly downloaded during pod install

Reviewed By: hramos

Differential Revision: D36810787

fbshipit-source-id: f898e61b6536dfcfc81feeff740703fbd697b000
@cortinico cortinico deleted the nc/fix-hermes-rc5 branch June 27, 2022 14:38
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. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants