feat(iOS): serve third-party deps from the prebuilt ReactNativeDependencies pod via dependency-only facades (#57440)

Summary:
Step 1 of making the prebuilt `ReactNativeDependencies` pod the **single header authority** for the third-party C/C++ deps (RCT-Folly, glog, boost, DoubleConversion, fmt, fast_float, SocketRocket) in prebuilt-deps mode.

Today the deps **binary** replaces the source pods' code, but the pod still `s.dependency`'s the real source pods and borrows their headers via `$(PODS_ROOT)/<pod>` search paths. That split header authority is the dual-copy bug class behind the 2026-07-03 SocketRocket regression (`duplicate interface` under `use_frameworks!` — SocketRocket's ObjC headers have no include guards).

Three commits:

1. **fix(cocoapods): harden prebuilt-deps header search paths and artifact handling** — `rndependencies.rb`'s `||= [] << path` only added the deps header search path when `HEADER_SEARCH_PATHS` was unset (silently dropped otherwise); normalize and always append, and point at the pod-local flattened `Headers/`. `ReactNativeDependencies.podspec` `prepare_command` now fails closed (`exit 1`) instead of silently producing a no-link pod. `reactNativeDependencies.js` no longer deletes + re-downloads a locally staged artifact that lacks a version marker.

2. **feat(cocoapods): dependency-only facades for third-party pods in prebuilt-deps mode** — in prebuilt-deps mode the real source pods are not declared, so a community podspec's hardcoded `s.dependency "RCT-Folly"` would resolve from trunk and compile from source next to the prebuilt binary. `RNDepsFacades` generates dependency-only local facade podspecs (no sources, no headers, a single dependency on `ReactNativeDependencies`); versions/subspecs are derived from the real podspecs in `third-party-podspecs/` (SocketRocket synthesized fail-closed from `socket_rocket_config`). Full contract documented in `scripts/cocoapods/__docs__/prebuilt-deps.md`.

3. **feat(ios-prebuild): SocketRocket privacy manifest + Xcode 26 header layout** — embed an RN-authored, accurate-empty `PrivacyInfo.xcprivacy` for SocketRocket (upstream ships none), and stage flat public headers into `include/` so Xcode 26's SwiftPM accepts the header layout.

Stacked on https://github.com/react/react-native/issues/57305 (base: `chrfalch/prebuilt-resources`); the SwiftPM preview (https://github.com/react/react-native/issues/57332) rebases on top of this. Follow-up (separate PR): headers-only `ReactNativeDependenciesHeaders.xcframework` sidecar so SPM auto-serves the deps namespaces and `ReactNativeHeaders` goes pure-RN.

## Changelog:

[IOS][CHANGED] - Prebuilt-deps mode: serve third-party headers from the ReactNativeDependencies pod itself and resolve community `s.dependency` on RCT-Folly/glog/boost/etc. via dependency-only facade pods

Pull Request resolved: https://github.com/react/react-native/pull/57440

Test Plan:
E2E matrix (2026-07-06, locally built deps artifact via `prepare-ios-prebuilds.js`):

- rn-tester, prebuilt core + prebuilt deps, static linkage — builds
- rn-tester, prebuilt core + prebuilt deps, `USE_FRAMEWORKS=dynamic` — builds (the SocketRocket-regression config)
- helloworld (private), prebuilt core + prebuilt deps, static — builds
- source-mode control: no facades generated, `Podfile.lock` identical to baseline

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed By: fabriziocucci

Differential Revision: D111449257

Pulled By: cipolleschi

fbshipit-source-id: ace5716868d126a08721200efd640e903b191658
This commit is contained in:
Christian Falch authored and meta-codesync[bot] committed 2026-07-15 05:08:52 -07:00
1 parent 77b75122ef
commit a8156acf8b
8 files changed
+332 -9

No files matched your search

+14 -4
View File
@@ -136,17 +136,27 @@ const dependencies /*: ReadonlyArray<Dependency> */ = [
},
},
{
name: 'socket-rocket',
name: 'SocketRocket',
version: '0.7.1',
// Xcode 26's SwiftPM rejects a public-headers dir where the umbrella
// header (SocketRocket.h) has sibling directories (SocketRocket/Internal):
// "target 'SocketRocket' has invalid header layout". Stage the flat public
// headers into include/ and point publicHeaderFiles there. The artifact's
// Headers/SocketRocket namespace (files.headers) is unaffected, and
// Xcode 16 accepts both layouts.
prepareScript: 'mkdir -p include && cp SocketRocket/*.h include/',
url: new URL(
'https://github.com/facebookincubator/SocketRocket/archive/refs/tags/0.7.1.tar.gz',
),
files: {
sources: ['SocketRocket/**/*.{h,m}'],
sources: ['SocketRocket/**/*.{h,m}', 'include/*.h'],
headers: ['SocketRocket/*.h'],
resources: [
'../../../scripts/releases/ios-prebuild/resources/SocketRocket/PrivacyInfo.xcprivacy',
],
},
settings: {
publicHeaderFiles: './SocketRocket',
publicHeaderFiles: './include',
headerSearchPaths: [
'./',
'SocketRocket',
@@ -254,7 +264,7 @@ const dependencies /*: ReadonlyArray<Dependency> */ = [
'fmt',
'boost',
'fast_float',
'socket-rocket',
'SocketRocket',
],
settings: {
publicHeaderFiles: './',
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>