react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[ios][precompile] add support for clang virtual file system

Open chrfalch opened this issue 1 month ago • 3 comments

Summary:

To solve our problem with header files from the React.XCFramework not being consumable due to the legacy Cocoapods headers, we used to point all header search / resolving into the Pods/Headers folder when building even with the framework installed.

This is a problem since an xcframework expects a modular header structure that can be consumed from within the headers folder of the framework.

The headers are used for both Objective-c compiling and for creating clang modules that can be consumed by Swift in our setup.

This commit fixes the above issues and makes a modular clang virtual file system from the header files we distribute. This vfs-overlay file will then be used by the rncore.rb script when installing the 'React-Core-prebuilt' pod and map the header files requested in the source code to the actual location on disk where the React.xcframework headers are installed.

Here are the changes:

  • Added vfs.js with types for creating clang virtual file system overlays
  • Added resolving the paths in the vfs file to the actual install path
  • Added installing the vfs overlay with the switch -ivfsoverlay <path> to compiler settings for both obj-c and swift on pod installation
  • Add vfs targets to the app target on post install

Prev PR: https://github.com/facebook/react-native/pull/54841

Changelog:

[IOS] [FIXED] - added support for clang virtual file system in React.XCFramework

Test Plan:

Run RNTester with prebuilt

chrfalch avatar Dec 10 '25 14:12 chrfalch

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 9.0.0 :x: Build Scan not published

github-actions[bot] avatar Dec 10 '25 14:12 github-actions[bot]

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 9.0.0 :x: Build Scan not published

github-actions[bot] avatar Dec 10 '25 16:12 github-actions[bot]

Job Summary for Gradle

Test All :: run_fantom_tests
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
react-native-github :private:react-native-fantom:buildFantomTester 9.0.0 :x: Build Scan not published

github-actions[bot] avatar Dec 11 '25 09:12 github-actions[bot]