-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
#34214 for main #34271
Conversation
Base commit: 8441c4a |
Base commit: 8441c4a |
cc @cipolleschi for review when you get a chance. |
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 | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this 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.
@cipolleschi good to know there're tests 🔥 i've added some tests, let me know whether it makes sense to you. |
@dmitryrykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @Kudo in c4b51e8. When will my fix make it into a release? | Upcoming Releases |
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
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
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
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.