Skip to content

Fix case-colliding React/ and react/ folders in the prebuilt iOS headers - #60148

Open
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:jpiasecki/prebuilt-umbrella-headers-case
Open

j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:jpiasecki/prebuilt-umbrella-headers-case

Conversation

@j-piasecki

Copy link
Copy Markdown
Contributor

Summary:

#58635 moved the C++ module umbrella headers (React/Debug.h, React/View.h and 15 others) into ReactNativeHeaders.xcframework. There they sit next to the react/ folder. On macOS the disk ignores letter case, so the two folders become one folder. In the 0.89.0-rc.1 and rc.2 artifacts, Headers/ has one React/ folder that also holds all react/... headers. Because of this, clang warns with -Wnonportable-include-path on each #include <react/...>. Reanimated reported that this breaks their clang-tidy run. On a disk that does not ignore case, these includes are not found at all.

This change puts the umbrella headers back in React.framework/Headers and marks them as exclude header in the React module map. Some react/ headers include them, for example react/timing/primitives.h includes <React/Debug.h>. Clang reads an excluded header as plain text, not as part of module React, so this include does not cause the React -> ReactNativeHeaders_react -> React module cycle that #58635 fixed. The build script stops with an error if one of these headers is ever added to React-umbrella.h, because that would cause the cycle again.

The Swift C++ check in headers-verify.js now also finds React.framework, the same as every real app does.

Changelog:

[IOS] [FIXED] - Fix -Wnonportable-include-path warnings for <react/...> includes with the prebuilt React Native core

Test Plan:

  • yarn test packages/react-native/scripts/ios-prebuild packages/react-native/scripts/spm: all tests pass.
  • Built the Debug artifacts (node scripts/ios-prebuild -s/-b/-c -f Debug) and ran node scripts/ios-prebuild/headers-verify.js --flavor Debug: all checks pass. ReactNativeHeaders has no React/ folder now.
  • Compiled a file with only #include <react/renderer/mounting/ShadowTree.h> against the artifact headers: 522 non-portable path warnings before this change, 0 after.
  • Built RNTester (Debug) with the local artifacts through CocoaPods (no frameworks, static frameworks, dynamic frameworks) and through SwiftPM: all 4 builds pass with 0 non-portable path warnings. In each build, a test file compiled with -Werror=nonportable-include-path includes the <react/...> headers from the report and all 17 <React/X.h> umbrella headers. An Objective-C++ test file with modules on imports module React and includes <React/Debug.h>.

The C++ module umbrellas (React/Debug.h, React/View.h and 15 others) shipped in ReactNativeHeaders next to the react/ folder. On a case-insensitive filesystem the two folders merge, so every #include <react/...> warns with -Wnonportable-include-path. On a case-sensitive filesystem these includes do not resolve.

Ship the umbrellas in React.framework again and list them as `exclude header` in its module map. Including them from a react/ header then stays textual and does not close the React -> ReactNativeHeaders_react -> React module cycle.

The Swift C++ interop gate in headers-verify now also searches React.framework, as every real consumer does.
@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 Nov 19, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Nov 19, 2026
@j-piasecki
j-piasecki marked this pull request as ready for review November 19, 2026 15:05

This branch has not been deployed

No deployments
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. p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant