Skip to content

Commit 19d87c8

Browse files
gabrieldonadelmeta-codesync[bot]
authored andcommitted
fix: iOS nightly prebuilds in release mode (facebook#54369)
Summary: While integrating nightlies in the main Expo repo, I noticed an issue where iOS builds would fail in release mode when setting `RCT_USE_RN_DEP=1`. The error was thrown by a failure in the `replace_dependencies_version` script given that during the pod install phase, we were not downloading the release artifacts for nightlies, only the debug ones. ## Changelog: [IOS] [FIXED] - Fix using iOS nightly prebuilds in release mode Pull Request resolved: facebook#54369 Test Plan: 1. run `RCT_DEPS_VERSION=nightly pod install` 2. Build the app in release mode Reviewed By: javache Differential Revision: D86089167 Pulled By: cipolleschi fbshipit-source-id: ea9a608926ed0a9145e3e305e8a3210364e1d36c
1 parent 7908607 commit 19d87c8

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

packages/react-native/scripts/cocoapods/rndependencies.rb

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def self.release_tarball_url(version, build_type)
177177
return "#{maven_repo_url}/#{group}/react-native-artifacts/#{version}/react-native-artifacts-#{version}-reactnative-dependencies-#{build_type.to_s}.tar.gz"
178178
end
179179

180-
def self.nightly_tarball_url(version)
180+
def self.nightly_tarball_url(version, build_type)
181181
artifact_coordinate = "react-native-artifacts"
182-
artifact_name = "reactnative-dependencies-debug.tar.gz"
182+
artifact_name = "reactnative-dependencies-#{build_type.to_s}.tar.gz"
183183
xml_url = "https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/#{artifact_coordinate}/#{version}-SNAPSHOT/maven-metadata.xml"
184184

185185
response = Net::HTTP.get_response(URI(xml_url))
@@ -196,13 +196,39 @@ def self.nightly_tarball_url(version)
196196
end
197197
end
198198

199+
def self.download_nightly_rndeps(react_native_path, version, configuration)
200+
tarball_url = nightly_tarball_url(version, configuration)
201+
download_rndeps_tarball(react_native_path, tarball_url, version, configuration)
202+
end
203+
199204
def self.download_stable_rndeps(react_native_path, version, configuration)
200205
tarball_url = release_tarball_url(version, configuration)
201206
download_rndeps_tarball(react_native_path, tarball_url, version, configuration)
202207
end
203208

204209
def self.podspec_source_download_prebuilt_nightly_tarball(version)
205-
url = nightly_tarball_url(version)
210+
# Warn if @@react_native_path is not set
211+
if @@react_native_path == ""
212+
rndeps_log("react_native_path is not set", :error)
213+
return
214+
end
215+
216+
# Warn if @@react_native_version is not set
217+
if @@react_native_version == ""
218+
rndeps_log("react_native_version is not set", :error)
219+
return
220+
end
221+
222+
if @@build_from_source
223+
return
224+
end
225+
226+
url = nightly_tarball_url(version, :debug)
227+
rndeps_log("Using tarball from URL: #{url}")
228+
destinationDebug = download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug)
229+
download_nightly_rndeps(@@react_native_path, @@react_native_version, :release)
230+
231+
return {:http => URI::File.build(path: destinationDebug).to_s }
206232
return {:http => url}
207233
end
208234

@@ -225,7 +251,7 @@ def self.release_artifact_exists(version)
225251
end
226252

227253
def self.nightly_artifact_exists(version)
228-
return artifact_exists(nightly_tarball_url(version).gsub("\\", ""))
254+
return artifact_exists(nightly_tarball_url(version, :debug).gsub("\\", ""))
229255
end
230256

231257
def self.artifacts_dir()

0 commit comments

Comments
 (0)