Skip to content

Commit f5ee485

Browse files
committed
fix(podspec): comment out duplicate scrollview subspec in React-FabricComponents
# [macOS The `scrollview` subspec is declared in BOTH `React-Fabric.podspec` and `React-FabricComponents.podspec`, with overlapping `source_files`: React-Fabric.podspec: react/renderer/components/scrollview/**/*.{m,mm,cpp,h} (recursive) React-FabricComponents.podspec: react/renderer/components/scrollview/*.{m,mm,cpp,h} react/renderer/components/scrollview/platform/cxx/**/* Both globs include the same top-level files (ScrollViewShadowNode.cpp, BaseScrollViewProps.cpp, ScrollEvent.cpp, etc.). After `pod install`, those source files end up in both the React-Fabric and React-FabricComponents Pods targets. What breaks: - Consumers that link both libraries (e.g. via `-all_load`) hit duplicate symbol errors at link time. - Consumers that deduplicate by hand by dropping scrollview from one target break differently: React-Fabric's mounting/internal/CullingContext.cpp references ScrollViewShadowNode, so if the dedup drops it from React-Fabric, link fails with `Undefined symbols: ScrollViewShadowNode`. Comment out (rather than delete) the duplicate scrollview subspec in React-FabricComponents, using the macOS diff-tag convention. The recursive glob in React-Fabric.podspec's scrollview subspec already covers everything FabricComponents was listing (top-level files + scrollview/platform/cxx/**/*). # macOS]
1 parent eb3bccb commit f5ee485

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

packages/react-native/ReactCommon/React-FabricComponents.podspec

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,25 @@ Pod::Spec.new do |s|
101101
sss.header_dir = "react/renderer/components/safeareaview"
102102
end
103103

104-
ss.subspec "scrollview" do |sss|
105-
sss.source_files = podspec_sources(["react/renderer/components/scrollview/*.{m,mm,cpp,h}",
106-
"react/renderer/components/scrollview/platform/cxx/**/*.{m,mm,cpp,h}"],
107-
["react/renderer/components/scrollview/*.h",
108-
"react/renderer/components/scrollview/platform/cxx/**/*.h"])
109-
sss.exclude_files = "react/renderer/components/scrollview/tests"
110-
sss.header_dir = "react/renderer/components/scrollview"
111-
end
104+
# [macOS The "scrollview" subspec below duplicates source_files already declared in
105+
# React-Fabric.podspec's "scrollview" subspec (which uses a recursive
106+
# `react/renderer/components/scrollview/**/*` glob). The overlap causes
107+
# ScrollViewShadowNode.cpp and friends to be compiled into both the
108+
# React-Fabric and React-FabricComponents Pods targets, breaking consumers
109+
# that link both libraries via `-all_load` (duplicate symbols). Comment it
110+
# out here so scrollview is only built into React-Fabric -- where
111+
# React-Fabric's mounting/internal/CullingContext.cpp already needs
112+
# ScrollViewShadowNode anyway.
113+
#
114+
# ss.subspec "scrollview" do |sss|
115+
# sss.source_files = podspec_sources(["react/renderer/components/scrollview/*.{m,mm,cpp,h}",
116+
# "react/renderer/components/scrollview/platform/cxx/**/*.{m,mm,cpp,h}"],
117+
# ["react/renderer/components/scrollview/*.h",
118+
# "react/renderer/components/scrollview/platform/cxx/**/*.h"])
119+
# sss.exclude_files = "react/renderer/components/scrollview/tests"
120+
# sss.header_dir = "react/renderer/components/scrollview"
121+
# end
122+
# macOS]
112123

113124
ss.subspec "text" do |sss|
114125
sss.source_files = podspec_sources(["react/renderer/components/text/*.{m,mm,cpp,h}",

0 commit comments

Comments
 (0)