From a2dc4d70face3927da6be62028d00923503c17e7 Mon Sep 17 00:00:00 2001 From: Tomasz Sapeta Date: Fri, 1 Sep 2023 06:38:45 -0700 Subject: [PATCH] Fix downloading hermes for nightlies (#39243) Summary: https://github.com/facebook/react-native/pull/38963 introduced a regression that breaks downloading hermes tarball for nightlies. It fails with the following error when running `pod install`: ``` Fetching podspec for `hermes-engine` from `../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec` [!] Failed to load 'hermes-engine' podspec: [!] Invalid `hermes-engine.podspec` file: undefined local variable or method `react_native_path' for Pod:Module Did you mean? react_native_post_install. ``` The root cause is that the `download_nightly_hermes` method was just not implemented. ## Changelog: [IOS] [FIXED] - Fixed downloading hermes tarball for nightlies Pull Request resolved: https://github.com/facebook/react-native/pull/39243 Test Plan: After applying these changes, `pod install` in my project no longer fails and downloads the tarball correctly. Reviewed By: dmytrorykun Differential Revision: D48897925 Pulled By: cipolleschi fbshipit-source-id: a504f01b739862bd092f22bca1f240f6df3a6df8 --- packages/react-native/sdks/hermes-engine/hermes-utils.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-utils.rb b/packages/react-native/sdks/hermes-engine/hermes-utils.rb index 4d2b628a53f..b3a28250b07 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-utils.rb +++ b/packages/react-native/sdks/hermes-engine/hermes-utils.rb @@ -115,7 +115,7 @@ def podspec_source(source_type, version, react_native_path) when HermesEngineSourceType::DOWNLOAD_PREBUILD_RELEASE_TARBALL return podspec_source_download_prebuild_release_tarball(react_native_path, version) when HermesEngineSourceType::DOWNLOAD_PREBUILT_NIGHTLY_TARBALL - return podspec_source_download_prebuilt_nightly_tarball() + return podspec_source_download_prebuilt_nightly_tarball(version) else abort "[Hermes] Unsupported or invalid source type provided: #{source_type}" end @@ -184,8 +184,7 @@ def podspec_source_download_prebuild_release_tarball(react_native_path, version) return {:http => url} end -def podspec_source_download_prebuilt_nightly_tarball() - destination_path = download_nightly_hermes(react_native_path, version) +def podspec_source_download_prebuilt_nightly_tarball(version) url = nightly_tarball_url(version) hermes_log("Using nightly tarball from URL: #{url}") return {:http => url}