Conversation
The platformios subspec inherits header_dir "react/utils" from the parent
spec, and maps its headers relative to "platform/ios" — a directory whose
own layout already starts with react/utils. In a non-frameworks build both
layers are applied in sequence, so the platform headers land at
Pods/Headers/{Public,Private}/React-utils/react/utils/react/utils/*.h.
Because of that, #include <react/utils/LowPriorityExecutor.h> — reached from
the React/Utils.h umbrella, which several modules now include — cannot be
resolved and RNTester fails to build in the default static configuration:
Pods/Headers/Public/React-utils/React/Utils.h:36:10: fatal error:
'react/utils/LowPriorityExecutor.h' file not found
Clear the inherited header_dir on the subspec instead of moving the mapping
directory: the mapping already contributes the react/utils prefix, and
header_dir does not take part in the framework header copy path, so the
USE_FRAMEWORKS layout (React_utils.framework/Headers/react/utils/*.h) is
unchanged.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused change follows established podspec conventions and correctly resolves the duplicated header prefix.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes duplicated react/utils header paths in static CocoaPods builds without affecting framework layouts.
Changes:
- Clears the inherited
header_dirfor theplatformiossubspec. - Lets
header_mappings_dirdetermine the correct public header path.
| File | Description |
|---|---|
packages/react-native/ReactCommon/react/utils/React-utils.podspec |
Corrects iOS utility header mapping. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D122536016. |
|
@cipolleschi merged this pull request in 024d5da. |
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-utils'splatformiossubspec inheritsheader_dir = "react/utils"from the parent spec, and maps its headers relative toplatform/ios— a directory whose own layout already begins withreact/utils. Outsideuse_frameworks!both layers are applied in sequence (PodTarget#header_mappings), soFollyConvert.h/LowPriorityExecutor.hend up one level too deep:and the documented include path can no longer be resolved. Since #58619 the
react/utilsumbrella is reached throughreact/renderer/debug/flags.handdebugStringConvertibleUtils.h, so the failure is not limited to direct consumers ofreact/utils: in the default static configuration any pod that transitively includes those headers stops compiling, e.g. in targetReact-ImageManager:Inside
use_frameworks!the framework header copy path only takes the mapping directory into account (pod_target_installer#add_header;link_headersskips framework targets, which is whyPods/Headersis empty there), soplatform/iosis correct for that configuration and only the static layout is broken.The fix clears the inherited
header_diron that subspec instead of moving the mapping directory: the mapping already contributes thereact/utilsprefix, so the static layout becomesPods/Headers/Public/React-utils/react/utils/*.h— the same place the module's other headers land — while the frameworks layout (React_utils.framework/Headers/react/utils/*.h) is unchanged, becauseheader_dirdoes not participate in that path.header_dir = ""together withheader_mappings_dir = …is also the convention the*Umbrellasubspecs of this repo already use (React-utils,React-Mapbuffer,React-FabricImage,ReactCommon).Changelog:
[iOS] [FIXED] - React-utils: link
platform/iosheaders atreact/utils/…in non-frameworks builds instead of a duplicatedreact/utils/react/utils/…, restoring#include <react/utils/…>and<React/Utils.h>Test Plan:
RNTester using
pod installorUSE_FRAMEWORKS=dynamic pod installto build and can build successfully.