From 724fbdd5b31575a69ddaeb470a75c86d0b67d27c Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 15 Jul 2026 07:24:50 -0700 Subject: [PATCH] fix(iOS): classify CFNetwork as a system framework in the header include-health ratchet (#57565) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: After the SwiftPM stack landed (https://github.com/react/react-native/issues/57332), the `prebuild_react_native_core / compose-xcframework` jobs (Debug and Release) went red on the **"Verify composed headers"** step (`headers-verify.js`), not on the XCFramework compile: ``` include-health ratchet: 2 NEW unresolvable include(s) in shipped headers (work in source builds via pod header maps, break the packaged layout): unresolved CoreModules/RCTInspectorWebSocketReporter.h -> CFNetwork/CFNetwork.h unresolved React/RCTInspectorWebSocketReporter.h -> CFNetwork/CFNetwork.h ``` `React/CoreModules/RCTInspectorWebSocketReporter.h` (added in https://github.com/react/react-native/issues/57543, "Add CDP support for WebSocket events (iOS)") does `#import ` because it uses `CFHTTPMessageRef`. The include-health ratchet classifies any include whose first path segment isn't in the `SDK_PREFIXES` allowlist in `headers-inventory.js` as `unresolved`. **`CFNetwork` was missing from that allowlist** — even though it's a genuine Apple system framework that's always available in the SDK, exactly like `CoreFoundation`, `Security`, and `Network`, which are already listed. (Two offenders because the same header ships under two natural paths, `CoreModules/` and `React/`.) ## Fix Add `CFNetwork` to `SDK_PREFIXES`. This is the accurate classification (it's a system framework), so **no baseline change is required**. ## Changelog: [INTERNAL] [FIXED] - Classify `CFNetwork` as a system framework in the prebuilt-header include-health ratchet Pull Request resolved: https://github.com/react/react-native/pull/57565 Test Plan: - Ran the include-health stage locally against the source tree + committed `headers-include-baseline.json`: `CFNetwork` is no longer flagged, **0 new offenders, 0 baseline entries to shrink**. - `ios-prebuild` unit suite: **56/56 pass**. Reviewed By: cortinico Differential Revision: D112115176 Pulled By: cipolleschi fbshipit-source-id: 1bf28d5dae361e88c85c4f4678aeb9b4b9c6c7ca --- packages/react-native/scripts/ios-prebuild/headers-inventory.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/scripts/ios-prebuild/headers-inventory.js b/packages/react-native/scripts/ios-prebuild/headers-inventory.js index 4b514c35286..b159fe06841 100644 --- a/packages/react-native/scripts/ios-prebuild/headers-inventory.js +++ b/packages/react-native/scripts/ios-prebuild/headers-inventory.js @@ -86,6 +86,7 @@ const SDK_PREFIXES = new Set([ 'Accessibility', 'AVFoundation', 'AVKit', + 'CFNetwork', 'CommonCrypto', 'CoreFoundation', 'CoreGraphics',