Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iOS: don't override EXCLUDED_ARCHS when installing Hermes (#39060)
Summary: - if an existing iOS project specifies `EXCLUDED_ARCHS`, these settings are overwritten by the `react_native_post_install` step as part of the Cocoapods install - this can break the build of existing iOS apps that want to include React Native - a previous PR (#38132) updated the Cocoapods utils to that we only update `EXCLUDED_ARCHS` when using Hermes - this worked around the issue for apps that opted to use JSC - however if you _do_ want to use Hermes (the default) this problem persists ### Existing Behaviour - one of the functions called as part of the `react_native_post_install` step is `exclude_i386_architecture_while_using_hermes` - see [/packages/react-native/scripts/cocoapods/utils.rb](https://github.com/facebook/react-native/blob/v0.72.1/packages/react-native/scripts/cocoapods/utils.rb#L56-L69) ``` def self.exclude_i386_architecture_while_using_hermes(installer) projects = self.extract_projects(installer) # Hermes does not support `i386` architecture excluded_archs_default = self.has_pod(installer, 'hermes-engine') ? "i386" : "" projects.each do |project| project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = excluded_archs_default end project.save() end end ``` 🐛 **However** 🐛 - this means existing projects that have `EXCLUDED_ARCHS` set, the existing value will be overwritten either to `"i386"` or a blank string ### Changed Behaviour - appends `"i386"` to existing string if set, or just sets the value to `"i386"` if there is no existing value ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] don't override `EXCLUDED_ARCHS` when installing Hermes Pull Request resolved: #39060 Reviewed By: dmytrorykun Differential Revision: D48515441 Pulled By: cipolleschi fbshipit-source-id: 8cb3c8b680d92272da0b106553179af051d0f84e
- Loading branch information