Skip to content

Fix duplicated react/utils prefix in React-utils static header layout - #58759

Closed
zhongwuzw wants to merge 1 commit into
react:mainfrom
zhongwuzw:bugfix/react-utils-platformios-header-dir
Closed

zhongwuzw wants to merge 1 commit into
react:mainfrom
zhongwuzw:bugfix/react-utils-platformios-header-dir

Conversation

@zhongwuzw

@zhongwuzw zhongwuzw commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

React-utils's 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 begins with react/utils. Outside use_frameworks! both layers are applied in sequence (PodTarget#header_mappings), so FollyConvert.h / LowPriorityExecutor.h end up one level too deep:

Pods/Headers/{Public,Private}/React-utils/react/utils/react/utils/*.h

and the documented include path can no longer be resolved. Since #58619 the react/utils umbrella is reached through react/renderer/debug/flags.h and debugStringConvertibleUtils.h, so the failure is not limited to direct consumers of react/utils: in the default static configuration any pod that transitively includes those headers stops compiling, e.g. in target React-ImageManager:

Pods/Headers/Public/React-utils/React/Utils.h:36:10: fatal error:
'react/utils/LowPriorityExecutor.h' file not found

Inside use_frameworks! the framework header copy path only takes the mapping directory into account (pod_target_installer#add_header; link_headers skips framework targets, which is why Pods/Headers is empty there), so platform/ios is correct for that configuration and only the static layout is broken.

The fix clears the inherited header_dir on that subspec instead of moving the mapping directory: the mapping already contributes the react/utils prefix, so the static layout becomes Pods/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, because header_dir does not participate in that path. header_dir = "" together with header_mappings_dir = … is also the convention the *Umbrella subspecs of this repo already use (React-utils, React-Mapbuffer, React-FabricImage, ReactCommon).

Changelog:

[iOS] [FIXED] - React-utils: link platform/ios headers at react/utils/… in non-frameworks builds instead of a duplicated react/utils/react/utils/…, restoring #include <react/utils/…> and <React/Utils.h>

Test Plan:

RNTester using pod install or USE_FRAMEWORKS=dynamic pod install to build and can build successfully.

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.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 09:27
@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 Sep 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dir for the platformios subspec.
  • Lets header_mappings_dir determine 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.

@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 Sep 30, 2026

@cipolleschi cipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@meta-codesync

meta-codesync Bot commented Sep 30, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot closed this in 024d5da Sep 30, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 30, 2026
@meta-codesync

meta-codesync Bot commented Sep 30, 2026

Copy link
Copy Markdown

@cipolleschi merged this pull request in 024d5da.

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.

3 participants