Skip to content

Commit 024d5da

Browse files
zhongwuzwmeta-codesync[bot]
authored andcommitted
Fix duplicated react/utils prefix in React-utils static header layout (#58759)
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>` Pull Request resolved: #58759 Test Plan: RNTester using `pod install` or `USE_FRAMEWORKS=dynamic pod install` to build and can build successfully. Reviewed By: javache Differential Revision: D122536016 Pulled By: cipolleschi fbshipit-source-id: e0bf2a0ecef6e8db713a276eb9a2f07b5f2daad0
1 parent 3bc61ec commit 024d5da

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/react-native/ReactCommon/react/utils/React-utils.podspec‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Pod::Spec.new do |s|
5858

5959
s.subspec "platformios" do |ss|
6060
ss.source_files = podspec_sources("platform/ios/**/*.{m,mm,cpp,h}", "platform/ios/**/*.h")
61+
ss.header_dir = ""
6162
ss.header_mappings_dir = "platform/ios"
6263
end
6364

0 commit comments

Comments
 (0)