Skip to content

Commit 88b7b64

Browse files
Kudofacebook-github-bot
authored andcommitted
Fix hermes executor not available when use_frameworks is enabled (#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: #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
1 parent 14c207d commit 88b7b64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

React-Core.podspec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ Pod::Spec.new do |s|
4747
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
4848
s.header_dir = "React"
4949
s.framework = "JavaScriptCore"
50-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\" \"${PODS_ROOT}/Headers/Public/FlipperKit\" \"$(PODS_ROOT)/Headers/Public/ReactCommon\" \"$(PODS_ROOT)/Headers/Public/React-RCTFabric\"", "DEFINES_MODULE" => "YES", "GCC_PREPROCESSOR_DEFINITIONS" => "RCT_METRO_PORT=${RCT_METRO_PORT}", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }
50+
s.pod_target_xcconfig = {
51+
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\" \"${PODS_ROOT}/Headers/Public/FlipperKit\" \"$(PODS_ROOT)/Headers/Public/ReactCommon\" \"$(PODS_ROOT)/Headers/Public/React-RCTFabric\"",
52+
"FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
53+
"DEFINES_MODULE" => "YES",
54+
"GCC_PREPROCESSOR_DEFINITIONS" => "RCT_METRO_PORT=${RCT_METRO_PORT}",
55+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
56+
}
5157
s.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\""}
5258
s.default_subspec = "Default"
5359

0 commit comments

Comments
 (0)