Fix React-CoreModules missing React-featureflags header path under use_frameworks!#56591
Closed
radko93 wants to merge 1 commit intofacebook:mainfrom
Closed
Conversation
…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.
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D102328650. |
|
@cipolleschi merged this pull request in fb0d28c. |
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
React/CoreModules/RCTRedBox.mmimports<react/featureflags/ReactNativeFeatureFlags.h>(added in #56574). Underuse_frameworks!this fails to build:React-CoreModules.podspecuses plains.dependency "React-featureflags", which does not add the framework's Headers dir toHEADER_SEARCH_PATHS. Switching toadd_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 globalupdate_search_pathsentry added in #55679, which injectsReact_featureflags.framework/Headersinto inherited header search paths foruse_frameworks!builds.0.83-stabledoes 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-CoreModulesno longer relies on a broad inherited header path. A cherry-pick to0.83-stablewould 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 pathTest 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 installregeneratesReact-CoreModules.debug.xcconfigsoHEADER_SEARCH_PATHSincludes:Verified locally that the
React-CoreModulespod target builds after the fix: