Skip to content

Fix React-CoreModules missing React-featureflags header path under use_frameworks!#56591

Closed
radko93 wants to merge 1 commit intofacebook:mainfrom
radko93:fix-react-coremodules-featureflags-header-search-path
Closed

Fix React-CoreModules missing React-featureflags header path under use_frameworks!#56591
radko93 wants to merge 1 commit intofacebook:mainfrom
radko93:fix-react-coremodules-featureflags-header-search-path

Conversation

@radko93
Copy link
Copy Markdown
Contributor

@radko93 radko93 commented Apr 24, 2026

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

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

…dules

RCTRedBox.mm in React-CoreModules imports <react/featureflags/ReactNativeFeatureFlags.h>
(added in facebook#56574, RedBox 2.0 iOS backport). With use_frameworks!, this file fails
to build with:

  'react/featureflags/ReactNativeFeatureFlags.h' file not found
  (Did not find header 'featureflags/ReactNativeFeatureFlags.h' in framework 'react')

React-CoreModules.podspec declared the React-featureflags dependency using plain
s.dependency, which only registers the pod. The React-Native-specific
add_dependency helper additionally appends the framework's Headers directory
(React_featureflags.framework/Headers) to HEADER_SEARCH_PATHS, which is required
for Clang to resolve <react/featureflags/...> under use_frameworks!.

This aligns React-featureflags with how React-debug, React-runtimeexecutor,
React-jsinspector*, React-utils, React-NativeModulesApple, ReactCommon and
React-RCTFBReactNativeSpec are already declared in the same podspec.

Verified: regenerated React-CoreModules.debug.xcconfig now contains
${PODS_CONFIGURATION_BUILD_DIR}/React-featureflags/React_featureflags.framework/Headers
and the build succeeds.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 24, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 24, 2026

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D102328650.

@meta-codesync meta-codesync Bot closed this in fb0d28c Apr 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 24, 2026

@cipolleschi merged this pull request in fb0d28c.

@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 24, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @radko93 in fb0d28c

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants