Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Mac Catalyst #460

Closed
robertying opened this issue Feb 25, 2021 · 3 comments
Closed

Support for Mac Catalyst #460

robertying opened this issue Feb 25, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@robertying
Copy link

Bug Description

React Native 0.64-rc has introduced Hermes for iOS. I'm trying to build for Mac Catalyst and there seems to be some problem with prebuilt binary shipped with Hermes for iOS.

ld: building for Mac Catalyst, but linking in dylib built for iOS Simulator, file '/Users/rying/myapp/ios/Pods/hermes-engine/destroot/Library/Frameworks/iphoneos/hermes.framework/hermes' for architecture x86_64

- [ ] I have run gradle clean and confirmed this bug does not occur with JSC

Hermes version: 0.7.2
React Native version (if any): 0.64.0-rc.3
OS version (if any): macOS 11.2.1
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64 (Catalyst)

Steps To Reproduce

  1. Init RN with 0.64.0-rc.3
  2. Build for Mac Catalyst target

The Expected Behavior

I see Hermes already supports x86-64 so it should play nice with Catalyst too.

Thanks for the great work and I really hope it gets fixed soon!

@Huxpro Huxpro added the enhancement New feature or request label Feb 25, 2021
@Huxpro
Copy link
Contributor

Huxpro commented Feb 25, 2021

@robertying Hey thanks for reporting this interesting use case!

Just let you know that the community is currently prioritizing shipping the stable 0.64 first. Once the release is out there will be more community resources to investigate additional features/bugs. cc @grabbou

@Arkkeeper
Copy link

Arkkeeper commented Mar 17, 2021

This issue seems to be related with mine #468

Hermes as a framework is compiled for certain architectures and platforms (iOS, iOS Simulator or macOS), and then they are merged into a fat framework with lipo.

For a proper compatibility with Mac Catalyst (and arm64 iOS Simulators on M1 Macs) Hermes should be compiled as .xcframework containing slices for all necessary archs and platforms. For example, OpenSSL.xcframework shipped along with Flipper, has 4 slices:

openssl

I've forked Hermes and managed to add arm64 iOS Simulator support. Unfortunately, I haven't figured yet how we should pass necessary cmake flags for building Catalyst version.

Our team has been using React Native app with Catalyst in production for more than a year, and Hermes support would be great.

Huxpro pushed a commit to Huxpro/hermes that referenced this issue Jun 30, 2021
Summary:
Edits build scripts to allow merging architectures into .xcframework instead of using lipo for building fat framework.
Adds compatibility with arm64 iOS Simulators on Apple M1 Macs and allows using Hermes with RN apps built for Mac Catalyst.

Fixes facebook#460 and facebook#468

Pull Request resolved: facebook#475

Differential Revision: D29465045

Pulled By: Huxpro

fbshipit-source-id: 6291aac9ee47db83d6f78822767019ec0277a899
@Huxpro
Copy link
Contributor

Huxpro commented Jul 12, 2021

This is fixed by #546 (was #543 and #475) and would be available when Hermes 0.8.1 is out (together with RN 0.65 stable).

Thanks everyone involving!

@Huxpro Huxpro closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants