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
This commit is contained in:
Tomasz Sapeta
2023-09-01 06:38:45 -07:00
committed by Facebook GitHub Bot
parent 5c513cb2f8
commit a2dc4d70fa
@@ -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}