Skip to content

fix: include macOS slice in universal Hermes xcframework#1970

Open
Saadnajmi wants to merge 1 commit intofacebook:mainfrom
Saadnajmi:saad/add-macos-to-xcframework-main
Open

fix: include macOS slice in universal Hermes xcframework#1970
Saadnajmi wants to merge 1 commit intofacebook:mainfrom
Saadnajmi:saad/add-macos-to-xcframework-main

Conversation

@Saadnajmi
Copy link
Copy Markdown

Summary

Mirror of #1958 (targeting static_h), adapted for the legacy main branch.

Unlike the static_h PR which consolidates all Apple build scripts and removes build-mac-framework.sh, this PR takes a minimal approach: it adds macOS support to the existing build-ios-framework.sh functions (get_architecture, get_deployment_target, create_framework, build_universal_framework) so the macOS slice is included in the universal xcframework.

build-mac-framework.sh is left in place for backward compatibility on this legacy branch.

Motivation

The context of this change is microsoft/react-native-macos#2815, where we are adding SPM / prebuild support to React Native macOS.

Including the macOS slice in the universal xcframework allows react-native-macos to use the same prebuilt Hermes artifacts as react-native for iOS, visionOS, and tvOS — without platform-specific patching.

Test plan

CI should pass. The build_apple_framework "macosx" call is already exercised by build-mac-framework.sh — this PR just routes it through the same path as every other platform.

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great for unifying the build. However, I feel that we need to update the ci also, because, IIRC, github builds slices in isolation and it might not be calling build-ios-framework for mac os.

So basically we never hit these changes in CI in this way

Comment thread utils/build-ios-framework.sh Outdated
@Saadnajmi Saadnajmi force-pushed the saad/add-macos-to-xcframework-main branch from 74055e3 to b6db5d6 Compare April 15, 2026 20:26
…chitecture

- Add macosx to get_architecture, get_deployment_target, create_framework,
  and build_universal_framework so the unified script handles all platforms
- Simplify get_architecture from 5 branches to 2
- CI continues using build-mac-framework.sh for the standalone macOS
  framework (needed by the podspec), while the assembly step now includes
  macosx in the universal xcframework via build_universal_framework

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Saadnajmi Saadnajmi force-pushed the saad/add-macos-to-xcframework-main branch from b6db5d6 to 1f93e87 Compare April 15, 2026 20:51
@Saadnajmi
Copy link
Copy Markdown
Author

This is great for unifying the build. However, I feel that we need to update the ci also, because, IIRC, github builds slices in isolation and it might not be calling build-ios-framework for mac os.

So basically we never hit these changes in CI in this way

I think before my change we always had a macos slice and job in CI, and after this change we make sure that that slice is also in the universal xcframework by adding macos to build_universal_framework()

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

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants