Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#34214 for main #34271

Closed
wants to merge 3 commits into from
Closed

#34214 for main #34271

wants to merge 3 commits into from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Jul 25, 2022

Summary

cherry-pick changes from #34214 to main. because the react_native_pods.rb on main is quite different from 0.69, i have separated pr for the change.

Changelog

[iOS] [Fixed] - Fix React-bridging headers import not found

Test Plan

RNTester + pod install and verify pod targets to have React-bridging in header search paths.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Expo Partner: Expo Partner labels Jul 25, 2022
@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Jul 25, 2022
@analysis-bot
Copy link

analysis-bot commented Jul 25, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,825,767 -40
android hermes armeabi-v7a 7,216,758 -33
android hermes x86 8,137,911 +6
android hermes x86_64 8,116,253 +9
android jsc arm64-v8a 9,703,567 -56
android jsc armeabi-v7a 8,458,085 -53
android jsc x86 9,654,094 -5
android jsc x86_64 10,252,071 -8

Base commit: 8441c4a
Branch: main

@analysis-bot
Copy link

analysis-bot commented Jul 25, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 8441c4a
Branch: main

@Kudo Kudo marked this pull request as ready for review July 25, 2022 16:32
@Kudo
Copy link
Contributor Author

Kudo commented Jul 25, 2022

cc @cipolleschi for review when you get a chance.

Comment on lines +96 to +107
def self.fix_react_bridging_header_search_paths(installer)
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
# For third party modules who have React-bridging dependency to search correct headers
config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
end
end
end

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kudo, thanks for all your hard work with this. I'm curious why this is needed on main. Did we not fix the .podspec files? This looks wrong since it adds private headers to the search path among other paths that should've been added by CocoaPods if the .podspec was fixed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like React-bridging.podspec does not have public_header_files set. Would that have fixed the underlying issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tido64 this is for third party libraries integration, e.g. react-native-vision-camera. originally, my workaround was for React-bridging errors in use_frameworks mode and i added the header search paths to ReactCommon. it turns out some third party modules have dependencies to ReactCommon or React would also need the header search paths. that's why i am proposing to add them from CocoaPods post_install.

these are all workarounds 😔 in the future, we should remove the nested header imports, e.g. #include <react/bridging/Bridging.h> to support use_frameworks mode.

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 25, 2022
@facebook-github-bot
Copy link
Contributor

@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Kudo, thanks a lot for this fix.

Can I ask you to add some tests for this change? The cocoapods related scripts are now completely tested and you can find some examples here.

Ideally, you could copy the fix_library_search_paths tests' structure and update it with a call to fix_react_bridging_header_search_paths and the proper setup and assertions.

@Kudo
Copy link
Contributor Author

Kudo commented Jul 26, 2022

@cipolleschi good to know there're tests 🔥 i've added some tests, let me know whether it makes sense to you.

@Kudo Kudo requested a review from cipolleschi July 26, 2022 17:28
@facebook-github-bot
Copy link
Contributor

@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @Kudo in c4b51e8.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jul 27, 2022
kelset pushed a commit that referenced this pull request Jul 27, 2022
Summary:
cherry-pick changes from #34214 to main. because the `react_native_pods.rb` on main is quite different from 0.69, i have separated pr for the change.

## Changelog

[iOS] [Fixed] - Fix React-bridging headers import not found

Pull Request resolved: #34271

Test Plan: RNTester + pod install and verify pod targets to have `React-bridging` in header search paths.

Reviewed By: cipolleschi

Differential Revision: D38122074

Pulled By: dmitryrykun

fbshipit-source-id: 64569abbfa3a684f0d6b84c9e3222bfc9a171061
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
Summary:
cherry-pick changes from facebook#34214 to main. because the `react_native_pods.rb` on main is quite different from 0.69, i have separated pr for the change.

## Changelog

[iOS] [Fixed] - Fix React-bridging headers import not found

Pull Request resolved: facebook#34271

Test Plan: RNTester + pod install and verify pod targets to have `React-bridging` in header search paths.

Reviewed By: cipolleschi

Differential Revision: D38122074

Pulled By: dmitryrykun

fbshipit-source-id: 64569abbfa3a684f0d6b84c9e3222bfc9a171061
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
Summary:
cherry-pick changes from facebook#34214 to main. because the `react_native_pods.rb` on main is quite different from 0.69, i have separated pr for the change.

## Changelog

[iOS] [Fixed] - Fix React-bridging headers import not found

Pull Request resolved: facebook#34271

Test Plan: RNTester + pod install and verify pod targets to have `React-bridging` in header search paths.

Reviewed By: cipolleschi

Differential Revision: D38122074

Pulled By: dmitryrykun

fbshipit-source-id: 64569abbfa3a684f0d6b84c9e3222bfc9a171061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. p: Expo Partner: Expo Partner Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants