From a19578de88df86dd7cc36f5edda77a4736934fc1 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Tue, 19 Jul 2022 07:34:18 -0700 Subject: [PATCH] Hermes pod: change logic to use the hermes tag to set the pod source correctly (#34221) Summary: This fix is necessarly to ensure that when working on the codebase in the `0.XX-stable` branches (ex. when you are working on a release) the Hermes podfile is correctly set against the right commit for that branch, and not latest commit from main branch of Hermes repo. I didn't add a check to verify that the file `.hermesversion` exists because I think it's safe to assume that the file and the tag correctly exists when this step (doing a pod install on the `0.XX-stable` branch). Once this is merged, we need to cherry pick it on both the 0.69 and 0.70 branches ## Changelog [iOS] [Fixed] - Hermes pod: change logic to use the hermes tag to set the pod source correctly Pull Request resolved: https://github.com/facebook/react-native/pull/34221 Test Plan: * git clone the repo * checkout 0.69-stable branch * follow https://reactnative.dev/contributing/release-testing * without this commit, when testing RNTester + iOS + Hermes the app will insta-crash on opening * with it, the app gets build successfully Reviewed By: cortinico Differential Revision: D37957660 Pulled By: cipolleschi fbshipit-source-id: 4e50099ed712b1ad8e6439822e3f530142982c1b --- sdks/hermes-engine/hermes-engine.podspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index 4951fda8d2d20f..f21488bfa72ad1 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -28,8 +28,10 @@ if version == '1000.0.0' 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") + hermestag_file = File.join(__dir__, "..", ".hermesversion") + hermestag = File.read(hermestag_file).strip source[:git] = git - source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip + source[:tag] = hermestag else source[:http] = "https://github.com/facebook/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz" end