-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Move hermes to a separate podspec #30478
Conversation
1e77bbb
to
3f641a6
Compare
Looks like the frameworks build is failing because it cannot find the hermes executor headers, I'm not familiar with using frameworks, is there an additional config needed to expose the headers? |
The change seems fine to me, I just have a few questions first:
For completeness sake, could you include some details on what these issues are?
That shouldn't happen when the subspec isn't enabled or is an issue when you include RN in 2 different targets, as mentioned above? |
Those CI tasks are expected to fail at the moment, afaik /cc @grabbou |
@alloy Thanks for having a look!
I don't have the exact error handy but it was a
The issue happens only if one subspec includes hermes and the other doesn't. Kind of seems like a bug in cocoapods or xcode, but I think this is a proper fix anyway. |
Looks like the error is actually relevant. Not sure why it works without frameworks, but doesn't with.
From what I understand this https://github.com/facebook/react-native/pull/30478/files#diff-b34b33f2ba6fa8d5c29a589f91e5b8101289f634bb7bb0a54cdde77eb82fdecaR41 should allow headers to be imported using <React/X> but it doesn't seem to work for frameworks. |
Thanks for the elaboration 🙏 As for the build issue, it makes sense that you can no longer refer to the header in the |
Ok I managed to get everything working, the use_frameworks build is currently crashing at runtime because of duplicate Folly singleton. This is caused by Flipper, from what I understand it is not compatible with use_frameworks so I will open a separate PR to fix the use_frameworks build. This moves the hermes executor to a new module reacthermes and use public_headers which seemed the less hacky solution to expose the module headers. |
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.
Nice 👌
CI is failing for an unreleated reason now so it seems to work! |
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.
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Thanks for the changes! I think we can merge them. As for the name of the pod, it could be named plainly |
@hramos I called it reacthermes to avoid conflicting with hermes, but I can try see if causes any issues. Actually the hermes podspec is called hermes-engine so that part should be fine. Just wondering about headers which are namespaced under <hermes/*> for hermes-engine already. |
It would probably be good to namespace it with React to avoid any hassle, but also these are the RN and Hermès integration bits, so it makes sense to me to call it like that. |
Headers were initially namespaced under React since it was in ReactCore, I tried keeping that by using header_dir = 'React' but noticed it would generate 2 frameworks named React when using use_frameworks, which might work, but looked wrong. There's probably a way to configure the framework name, but I was thinking it would be better to use its own namespec a bit like we do for jsi (https://github.com/facebook/react-native/blob/master/ReactCommon/jsiexecutor/React-jsiexecutor.podspec#L35). It does mean I needed to update the header path in RNTester and one other RCTBridge file. Not sure if that could cause issues internally. |
Let's leave it at |
This pull request was successfully merged by @janicduplessis in 0959ff3. When will my fix make it into a release? | Upcoming Releases |
@janicduplessis Do you think this should make its way into v0.64.0? |
Probably not critical, but it would be nice to |
In that case let’s defer it till v0.64.1 |
I’m going to wait with creating a v0.64.1 issue for now to not derail ongoing work, but please remember to bring this up for cherry-picking if I don't immediately remember. |
Summary: Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon. [iOS] [Fixed] - Move hermes to a separate podspec Pull Request resolved: #30478 Test Plan: Test that it builds and run properly in an app Reviewed By: fkgozali Differential Revision: D25308237 Pulled By: hramos fbshipit-source-id: b4cc44ea2b1b854831e881dbbf9a2f30f6704001
Summary
Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon.
Changelog
[iOS] [Fixed] - Move hermes to a separate podspec
Test Plan
Test that it builds and run properly in an app