Commit fb0d28c
Fix React-CoreModules missing React-featureflags header path under use_frameworks! (#56591)
Summary:
`React/CoreModules/RCTRedBox.mm` imports `<react/featureflags/ReactNativeFeatureFlags.h>` (added in #56574). Under `use_frameworks!` this fails to build:
RCTRedBox.mm:19:9: 'react/featureflags/ReactNativeFeatureFlags.h' file not found
Did not find header 'featureflags/ReactNativeFeatureFlags.h' in framework 'react'
`React-CoreModules.podspec` uses plain `s.dependency "React-featureflags"`, which does not add the framework's Headers dir to `HEADER_SEARCH_PATHS`. Switching to `add_dependency(s, "React-featureflags")` preserves the same pod dependency and also adds the dependency header path, matching every neighboring dep (`React-debug`, `React-runtimeexecutor`, `React-jsinspector*`, etc.) in the same file.
On `main`, this missing podspec-level header path is currently likely masked by the global `update_search_paths` entry added in #55679, which injects `React_featureflags.framework/Headers` into inherited header search paths for `use_frameworks!` builds. `0.83-stable` does not have that global entry, so the same podspec issue surfaces as a build regression in 0.83.7.
This change fixes the dependency at the target that directly imports the header, so `React-CoreModules` no longer relies on a broad inherited header path. A cherry-pick to `0.83-stable` would fix the regression in 0.83.7.
## Changelog:
[IOS] [FIXED] - Fix React-CoreModules failing to compile with `use_frameworks!` due to missing React-featureflags header path
Pull Request resolved: #56591
Test Plan:
RN 0.83.7 consumer app with `use_frameworks! :linkage => :static`, `RCT_USE_RN_DEP=1`: fails before this change. After the fix, `pod install` regenerates `React-CoreModules.debug.xcconfig` so `HEADER_SEARCH_PATHS` includes:
${PODS_CONFIGURATION_BUILD_DIR}/React-featureflags/React_featureflags.framework/Headers
Verified locally that the `React-CoreModules` pod target builds after the fix:
xcodebuild -project ios/Pods/Pods.xcodeproj \
-scheme React-CoreModules \
-configuration Debug \
-sdk iphonesimulator \
-derivedDataPath /tmp/rncoremodules-test \
CODE_SIGNING_ALLOWED=NO build
Reviewed By: javache
Differential Revision: D102328650
Pulled By: cipolleschi
fbshipit-source-id: c25a7f5f733637e1d1604929665881b659fd3af31 parent f4f4b95 commit fb0d28c
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments