Skip to content

fix: include macOS slice in universal hermes xcframework#56235

Closed
Saadnajmi wants to merge 1 commit intofacebook:mainfrom
Saadnajmi:facebook/hermes-macos
Closed

fix: include macOS slice in universal hermes xcframework#56235
Saadnajmi wants to merge 1 commit intofacebook:mainfrom
Saadnajmi:facebook/hermes-macos

Conversation

@Saadnajmi
Copy link
Copy Markdown
Contributor

@Saadnajmi Saadnajmi commented Mar 26, 2026

Summary:

The context of this change is microsoft#2815 , where I am trying to add SPM / prebuild support to React Native macOS.

Currently, Hermes is compiled into 2 xcframeworks, a "maces" one with just the macosx slice, and a "universal" one for the rest of the iOS derived platforms (ios, xros, mac catalyst, etc). This means that React Native macOS would need some extra diffs and patches to "remember" to use the right hermes framework. However... xcframeworks are multiplatform and there's no reason we can't just add the macOS slice to the "universal" one.. making it more universal!

  • Consolidates the three separate Hermes Apple build scripts (build-apple-framework.sh, build-ios-framework.sh, build-mac-framework.sh) into a single build-apple-framework.sh that builds all platforms — including macOS — into one universal hermesvm.xcframework
  • Updates the hermes-engine podspec so the Pre-built subspec uses the universal xcframework for macOS (matching iOS, tvOS, and visionOS)

Changelog:

[IOS] [FIXED] - include macOS slice in universal hermes xcframework

Test Plan:

Running a variant of this change in React Native macOS. CI wil be the ultimate answer for whether the changes are correct, so I'll be watching the PR jobs.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: BREAKING

@facebook-github-tools facebook-github-tools bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 26, 2026
Consolidates the three separate Hermes Apple build scripts into a single
`build-apple-framework.sh` that builds all platforms — including macOS —
into one universal `hermesvm.xcframework`.

Previously macOS was built as a standalone `.framework` by a separate script
and excluded from the universal xcframework. This blocked SPM-based macOS
builds since `Package.swift` references the universal xcframework.

- Merge `build-ios-framework.sh` and `build-mac-framework.sh` into
  `build-apple-framework.sh` using the `PLATFORMS` array as single source
  of truth
- Update podspec Pre-built subspec to point macOS at the universal
  xcframework (matching iOS, tvOS, and visionOS)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cipolleschi
Copy link
Copy Markdown
Contributor

Hey @Saadnajmi! As mentioned on discord, we don't build Hermes from React Native anymore. All the Hermes builds are happening in the hermes repo.
The code is more or less the same, but you'll have to apply it to that repo.
Remember to modify three branches:

I'll close this PR.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants