Skip to content

fix(fabric): select view platform headers by build destination - #3175

Open
Jason Morse (JasonVMo) wants to merge 1 commit into
mainfrom
user/jasonvmo/cpp-view-platforms
Open

Jason Morse (JasonVMo) wants to merge 1 commit into
mainfrom
user/jasonvmo/cpp-view-platforms

Conversation

@JasonVMo

Copy link
Copy Markdown

Summary:

Current main can select different HostPlatformViewProps class layouts and view traits depending on header packaging: CocoaPods flattens competing cxx/macOS headers, framework paths prefer cxx, SwiftPM selects sources using the manifest host, and prebuild stages different families in its two include namespaces.

  • Add canonical destination-dispatch headers, retain their relative platform paths in CocoaPods, and compile macOS implementations only for macOS. iOS/visionOS/Mac Catalyst use the upstream cxx aliases; Android retains its platform implementation.
  • Keep both destination families available to SwiftPM instead of branching on the manifest host.
  • Stage dispatchers and both physical platform trees consistently in prebuild, replacing stale flattened view links.
  • Add a focused prebuild staging regression.

This adapts the focused repair in ff90a9b67703e689f8e7819aa6482f782bc1fc8f, already present in related #3058, #3104 and #3105. Those PRs target 0.85-merge, 0.87-merge and review/0.87-apple-foundation, respectively; this PR delivers the repair independently to current main, without their unrelated future-version integration. It also repairs main's prebuild staging rather than importing the future header-composition pipeline.

This is fork-specific packaging of the macOS platform extension, not an upstream runtime behavior change. No Changeset is needed for main.

Test Plan:

  • yarn jest packages/react-native/scripts/ios-prebuild/__tests__/setup-test.js --runInBand --watchman=false — passed, 1 test.
  • yarn eslint packages/react-native/scripts/ios-prebuild/setup.js packages/react-native/scripts/ios-prebuild/__tests__/setup-test.js — passed.
  • yarn exec prettier --check packages/react-native/scripts/ios-prebuild/setup.js packages/react-native/scripts/ios-prebuild/__tests__/setup-test.js — passed.
  • ruby -c packages/react-native/ReactCommon/React-Fabric.podspec — passed, Syntax OK.
  • git diff --check — passed.
  • python3 ../../../.copilot/session-state/33ea5c72-8bbd-448d-aa21-c9b99dd03c96/files/cpp-view-platforms-validate.py — passed using a local, uncommitted validation harness; exact subprocess arguments, results and output are retained in the session's cpp-view-platforms-validation.json artifact:
    • 18 installed-CocoaPods consumer/layout combinations: macOS/iOS/visionOS × static libraries/static frameworks/dynamic frameworks × source/prebuilt RNCore, without header collisions.
    • 72 Clang dependency probes through staged CocoaPods layouts; 32 source-header probes covering macOS, iOS device/simulator, visionOS device/simulator, Mac Catalyst, Android and generic Linux.
    • 14 successful syntax checks proving the two macOS translation units are empty on other destinations.
    • Baseline-versus-repair prebuild staging reproduction, new-header clang-format checks and actual SwiftPM dump-package parsing.
    • Initial SwiftPM parsing failed because the host selected the newer CLT SDK with the older Xcode compiler. Rerunning with Xcode 26.4's macOS SDK explicitly selected passed.

Not run here: Pods installation, Xcode/native application builds, Metro, full Jest/Flow/lint/format suites. No screenshot is applicable to this packaging change.

Adapt the focused platform-dispatch repair from ff90a9b for current main. Preserve platform-relative CocoaPods and prebuild headers, remove SwiftPM host-based selection, and guard macOS translation units on other destinations.

Related future-merge integration: #3058, #3104, #3105.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 33ea5c72-8bbd-448d-aa21-c9b99dd03c96
@JasonVMo
Jason Morse (JasonVMo) requested a review from a team as a code owner November 12, 2026 22:02
@JasonVMo

Copy link
Copy Markdown
Author

Additional parent integration validation: passed with all six independent
fixes combined only in an isolated validation worktree. No PR was merged.

Validated integration HEAD: e9667492e9, based on 0b569f1497, containing:
#3170 (7d47aea75d), #3171 (9f3147012b), #3172 (1a1dce6a01),
#3173 (1cdeacaf21), #3174 (3c67962512), and #3175 (1d4cd2e237).

Commands and results:

# PASSED: regenerate Pods and generated headers from the RNTester directory.
cd packages/rn-tester
PATH="/opt/homebrew/opt/ruby/bin:$PATH" SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
cd ../..

# PASSED: New Architecture RNTester-macOS, static Pods, Hermes.
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -sdk macosx -configuration Debug -scheme RNTester-macOS -derivedDataPath packages/rn-tester -jobs 4 CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build

# PASSED: RNTester iOS simulator destination, including arm64 and x86_64.
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -sdk iphonesimulator -configuration Debug -scheme RNTester -destination 'generic/platform=iOS Simulator' -derivedDataPath packages/rn-tester -jobs 4 CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build

The first combined build failed after Pods were invoked from the monorepo root
using bundle exec pod install --project-directory=packages/rn-tester.
This Podfile uses Dir.pwd for app_path, so that invocation analyzed the wrong
package and omitted AppSpecs headers. Running the documented command from
packages/rn-tester
regenerated AppSpecs and both builds passed. No source
change or retry masking a runtime failure was needed.

These are native application build checks, not UI interaction tests or
sanitizer evidence. Builds reused the isolated worktree's baseline DerivedData
and recompiled affected dependencies. No Metro/app UI, dynamic-framework build,
visionOS application build, or live window-drag/focus/keyboard qualification was
performed in this integration pass. Individual regression test commands and
results remain in each PR's Test Plan.

The separately requested nativeProps_DEPRECATED synchronization investigation
is not part of this combined patch set and has no sanitizer qualification yet.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant