Skip to content

Commit 2bc6b00

Browse files
chrfalchreact-native-bot
authored andcommitted
Fixed symbol mapping to slices (#54641)
Summary: Previously the symbolication support when using the precompiled React.XCFramework copied the symbol bundles to the wrong folder in the framework, causing Xcode to not find the symbols. This commit fixes this by copying symbols to the correct slice folders instead of in the root of the framework folder. Note: Running `pod cache clean --all` and `rm -rf Pods` in the iOS folder followed by a clean rebuild in Xcode might be a good thing to ensure you're using the correct binaries when compiling. ## Changelog: [IOS] [FIXED] - Fixed copying symbol bundles into correct slice folder Pull Request resolved: #54641 Test Plan: ``` npx react-native-community/cli init Next --version next --skip-install cd Next yarn cd ios bundle install RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 bundle exec pod install ``` Run Xcode and observe that you are not able to step into React Native source code. After this fix, you should be able to step into the source code of React Native. Reviewed By: cortinico Differential Revision: D87919202 Pulled By: cipolleschi fbshipit-source-id: 029bca3e182c170562e358beb50592d5b91d8e8b
1 parent 3341bb5 commit 2bc6b00

File tree

1 file changed

+14
-1
lines changed
  • packages/react-native/scripts/cocoapods

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,16 @@ def self.process_dsyms(frameworkTarball, dSymsTarball)
233233

234234
# Add the dSYMs folder to the framework folder
235235
rncore_log(" Adding dSYMs to framework tarball")
236-
`(cd "$(dirname "#{dsyms_tmp_dir}")" && mkdir -p React.xcframework && cp -r "$(basename "#{dsyms_tmp_dir}")" React.xcframework/dSYMs && tar -rf "#{frameworkTarPath}" React.xcframework/dSYMs && rm -rf React.xcframework)`
236+
237+
# Move symbol bundles into each of the slices in the xcframework
238+
# Example:
239+
# move dSYMs/ios-arm64/. into React.xcframework/ios-arm64/React.framework/dSYMs/.
240+
Dir.glob(File.join(dsyms_tmp_dir, "*")).each do |dsym_path|
241+
slice_name = File.basename(dsym_path)
242+
slice_dsym_dest = File.join("React.xcframework", slice_name, "React.framework", "dSYMs")
243+
rncore_log(" Adding dSYM slice #{slice_name} into tarball at #{slice_dsym_dest}")
244+
`(cd "#{File.dirname(frameworkTarPath)}" && mkdir -p "#{slice_dsym_dest}" && cp -R "#{dsym_path}/." "#{slice_dsym_dest}" && tar -rf "#{frameworkTarPath}" "#{slice_dsym_dest}")`
245+
end
237246

238247
# Now gzip the framework tarball again - remember to use the .tar file and not the .gz file
239248
rncore_log(" Packing #{Pathname.new(frameworkTarPath).relative_path_from(Pathname.pwd).to_s}")
@@ -246,6 +255,10 @@ def self.process_dsyms(frameworkTarball, dSymsTarball)
246255
# Remove backup of original tarballs
247256
FileUtils.rm_f("#{frameworkTarball}.orig")
248257

258+
# Remove temp dSYMs folder and the temp Framework folder
259+
FileUtils.rm_rf(dsyms_tmp_dir)
260+
FileUtils.rm_rf(File.join(artifacts_dir, "React.xcframework"))
261+
249262
rescue => e
250263
rncore_log("Failed to process dSYMs: #{e.message}", :error)
251264
# Restore the original tarballs

0 commit comments

Comments
 (0)