-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix hermes executor not available when use_frameworks is enabled #34222
Conversation
Base commit: ccdf9ac |
Base commit: ccdf9ac |
Hi @Kudo, thanks for the PR. However, I don't understand why, with From this file we should install I would rather try to understand why with |
@cipolleschi in use_frameworks mode, each podspec would has a dedicated xcode target. the header search is mostly based on the Framework Search Paths settings. CocoaPods generates the values based on podspec dependencies.
the reason hermes works in non_use_frameworks mode is that the React-Core adds an header search entry to hermes. also in non_use_frameworks mode, the compiler don't have to generate *.a or *.so files. if headers are reachable, the compile can link *.o all together for final executable. however for use_frameworks mode, we should add correct framework search paths for xcode to link correct React-hermes libs. that's my understands. hopefully that would help you to have some insight for further investigation. |
Thanks for the clarification. I just have another question, following this:
I don't see any check that says to skip that line when |
because the path in use_frameworks mode is different. it's sorry the following description was wrong. i just tested that. once i reached the header in ``${PODS_CONFIGURATION_BUILD_DIR}/React-hermes/reacthermes.framework/Headers`, xcode can build it successfully.
|
I understand. Sorry if I'm throwing all these questions to you but:
I would rather try to reduce as much as we can the changes to the code to avoid the introduction of potential bugs. |
React-Core.podspec doesn't have dependencies to React-hermes.
brilliant idea. that's work and it's an easy fix. i'll update the pr tomorrow based on this solution.
i didn't test this. i like approach 2.
np! i like these discussion and brainstorming for better solution. and there we are 👍 |
78ab43b
to
6b6f78a
Compare
Hi Kudo, thanks for updating this. Could you rebase on main? 🙏 |
6b6f78a
to
5ad512f
Compare
thanks for the update. let's see how it going for ci jobs |
remaining a test js error , other ci jobs are passed 🤔 |
JS Error seems unrelated... |
@cipolleschi 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 88b7b64. When will my fix make it into a release? | Upcoming Releases |
) Summary: When in `use_frameworks!` + `hermes_enabled` mode, the React podspecs have not dependency to the `React-hermes` podspec. the `HermesExecutorFactory.h` is not available [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/AppSetup/RCTAppSetupUtils.h#L15) and [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/CxxBridge/RCTCxxBridge.mm#L44). The app will fallback to JSCRuntime and crash in release build because the JSCRuntime cannot evaluate Hermes bundles. The pr tries to add `React-hermes` to Framework Search Paths and make the `HermesExecutorFactory.h` reachable when in use_frameworks mode. This pr should fix the problem mentioned in [0.70 release discussion](reactwg/react-native-releases#26 (reply in thread)). ## Changelog [iOS] [Fixed] - Fix Hermes executor not available when `use_frameworks` is enabled Pull Request resolved: #34222 Test Plan: use patch-package to apply the change to a RN 0.69.1 project with the following test cases: - old architecture + jsc - new architecture + hermes - old architecture + `use_frameworks! :linkage => :static` + hermes - old architecture +`use_frameworks! :linkage => :static` + hermes + release build Reviewed By: sammy-SC Differential Revision: D38112717 Pulled By: cipolleschi fbshipit-source-id: ee78527f4686400856ab9a055cf30b20900afc17
…ebook#34222) Summary: When in `use_frameworks!` + `hermes_enabled` mode, the React podspecs have not dependency to the `React-hermes` podspec. the `HermesExecutorFactory.h` is not available [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/AppSetup/RCTAppSetupUtils.h#L15) and [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/CxxBridge/RCTCxxBridge.mm#L44). The app will fallback to JSCRuntime and crash in release build because the JSCRuntime cannot evaluate Hermes bundles. The pr tries to add `React-hermes` to Framework Search Paths and make the `HermesExecutorFactory.h` reachable when in use_frameworks mode. This pr should fix the problem mentioned in [0.70 release discussion](reactwg/react-native-releases#26 (reply in thread)). ## Changelog [iOS] [Fixed] - Fix Hermes executor not available when `use_frameworks` is enabled Pull Request resolved: facebook#34222 Test Plan: use patch-package to apply the change to a RN 0.69.1 project with the following test cases: - old architecture + jsc - new architecture + hermes - old architecture + `use_frameworks! :linkage => :static` + hermes - old architecture +`use_frameworks! :linkage => :static` + hermes + release build Reviewed By: sammy-SC Differential Revision: D38112717 Pulled By: cipolleschi fbshipit-source-id: ee78527f4686400856ab9a055cf30b20900afc17
…ebook#34222) Summary: When in `use_frameworks!` + `hermes_enabled` mode, the React podspecs have not dependency to the `React-hermes` podspec. the `HermesExecutorFactory.h` is not available [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/AppSetup/RCTAppSetupUtils.h#L15) and [here](https://github.com/facebook/react-native/blob/1d997ce6d67242b9f667b01365c5e719c3d3f8d7/React/CxxBridge/RCTCxxBridge.mm#L44). The app will fallback to JSCRuntime and crash in release build because the JSCRuntime cannot evaluate Hermes bundles. The pr tries to add `React-hermes` to Framework Search Paths and make the `HermesExecutorFactory.h` reachable when in use_frameworks mode. This pr should fix the problem mentioned in [0.70 release discussion](reactwg/react-native-releases#26 (reply in thread)). ## Changelog [iOS] [Fixed] - Fix Hermes executor not available when `use_frameworks` is enabled Pull Request resolved: facebook#34222 Test Plan: use patch-package to apply the change to a RN 0.69.1 project with the following test cases: - old architecture + jsc - new architecture + hermes - old architecture + `use_frameworks! :linkage => :static` + hermes - old architecture +`use_frameworks! :linkage => :static` + hermes + release build Reviewed By: sammy-SC Differential Revision: D38112717 Pulled By: cipolleschi fbshipit-source-id: ee78527f4686400856ab9a055cf30b20900afc17
## Description When there are frameworks used and Hermes enabled in the Podfile of your project, RN falls back to JSC in debug mode and crashes in production mode. This PR makes it possible to use Hermes when there is `use_frameworks!` enabled in the Podfile. Thanks @Kudo who originally fixed this issue in ReactNative repository: facebook/react-native#34222 ## Changes Added path to `Framework Search Paths` in Podspec of react-native-reanimated. ## Test code and steps to reproduce 1. Create empty ReactNative project 2. Add react-native-reanimated dependency. 3. For ReactNative 0.69.3 apply patch from: https://github.com/facebook/react-native/pull/34222/files 4. Enable frameworks in Podfile: `use_frameworks! :linkage => :static` 5. Build project in debug mode -> you will not see `engine: hermes` in top right corner. 6. Build project in release mode -> app will crash at startup ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
When there are frameworks used and Hermes enabled in the Podfile of your project, RN falls back to JSC in debug mode and crashes in production mode. This PR makes it possible to use Hermes when there is `use_frameworks!` enabled in the Podfile. Thanks @Kudo who originally fixed this issue in ReactNative repository: facebook/react-native#34222 Added path to `Framework Search Paths` in Podspec of react-native-reanimated. 1. Create empty ReactNative project 2. Add react-native-reanimated dependency. 3. For ReactNative 0.69.3 apply patch from: https://github.com/facebook/react-native/pull/34222/files 4. Enable frameworks in Podfile: `use_frameworks! :linkage => :static` 5. Build project in debug mode -> you will not see `engine: hermes` in top right corner. 6. Build project in release mode -> app will crash at startup - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
…-mansion#3491) ## Description When there are frameworks used and Hermes enabled in the Podfile of your project, RN falls back to JSC in debug mode and crashes in production mode. This PR makes it possible to use Hermes when there is `use_frameworks!` enabled in the Podfile. Thanks @Kudo who originally fixed this issue in ReactNative repository: facebook/react-native#34222 ## Changes Added path to `Framework Search Paths` in Podspec of react-native-reanimated. ## Test code and steps to reproduce 1. Create empty ReactNative project 2. Add react-native-reanimated dependency. 3. For ReactNative 0.69.3 apply patch from: https://github.com/facebook/react-native/pull/34222/files 4. Enable frameworks in Podfile: `use_frameworks! :linkage => :static` 5. Build project in debug mode -> you will not see `engine: hermes` in top right corner. 6. Build project in release mode -> app will crash at startup ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
Summary
When in
use_frameworks!
+hermes_enabled
mode, the React podspecs have not dependency to theReact-hermes
podspec. theHermesExecutorFactory.h
is not available here and here. The app will fallback to JSCRuntime and crash in release build because the JSCRuntime cannot evaluate Hermes bundles.The pr tries to add
React-hermes
to Framework Search Paths and make theHermesExecutorFactory.h
reachable when in use_frameworks mode.This pr should fix the problem mentioned in 0.70 release discussion.
Changelog
[iOS] [Fixed] - Fix Hermes executor not available when
use_frameworks
is enabledTest Plan
use patch-package to apply the change to a RN 0.69.1 project with the following test cases:
use_frameworks! :linkage => :static
+ hermesuse_frameworks! :linkage => :static
+ hermes + release build