Skip to content

Commit 665f06a

Browse files
chrfalchclaude
andcommitted
fix(cocoapods): dedup prebuilt HEADER_SEARCH_PATHS; keep the FACADE_PODS hint distinct
Two review follow-ups on the deps facades: - The prebuilt branch of add_rn_third_party_dependencies appended the deps Headers search path unconditionally; a second call on the same spec would duplicate the entry. Now .uniq, mirroring the from-source branch. - load_real_spec's method-level rescue also caught the tailored not-found raise and re-wrapped it generically, burying the "Update FACADE_PODS" hint. The rescue is now scoped to Pod::Specification.from_file only, so the two failure messages stay distinct. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5b90f71 commit 665f06a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

packages/react-native/scripts/cocoapods/rndependencies.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def add_rn_third_party_dependencies(s)
6262
# Artifact headers are flattened into the pod-local Headers/ by the podspec
6363
# prepare_command (see __docs__/prebuilt-deps.md).
6464
header_search_paths << "$(PODS_ROOT)/ReactNativeDependencies/Headers"
65-
current_pod_target_xcconfig["HEADER_SEARCH_PATHS"] = header_search_paths
65+
66+
# uniq so a second call on the same spec can't duplicate entries.
67+
current_pod_target_xcconfig["HEADER_SEARCH_PATHS"] = header_search_paths.uniq
6668
end
6769

6870
s.pod_target_xcconfig = current_pod_target_xcconfig

packages/react-native/scripts/cocoapods/rndeps_facades.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,11 @@ def self.load_real_spec(path, name)
176176
raise "[RNDepsFacades] Real podspec for facaded pod '#{name}' not found at #{path}. " \
177177
"Update FACADE_PODS in rndeps_facades.rb if the podspec moved."
178178
end
179-
Pod::Specification.from_file(path)
180-
rescue => e
181-
raise "[RNDepsFacades] Failed to read real podspec for facaded pod '#{name}' at #{path}: #{e.message}"
179+
begin
180+
Pod::Specification.from_file(path)
181+
rescue => e
182+
raise "[RNDepsFacades] Failed to read real podspec for facaded pod '#{name}' at #{path}: #{e.message}"
183+
end
182184
end
183185
private_class_method :load_real_spec
184186

0 commit comments

Comments
 (0)