Skip to content

Commit

Permalink
[Setup] Enable Hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo Cipolleschi committed Mar 10, 2022
1 parent 559ddff commit 75f14ba
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 7 deletions.
2 changes: 1 addition & 1 deletion AwesomeApp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const App: () => Node = () => {
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Section title="Step One">
<Section title="Step OneThousand">
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Section>
Expand Down
4 changes: 2 additions & 2 deletions AwesomeApp/ios/AwesomeApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -626,7 +626,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion AwesomeApp/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target 'AwesomeApp' do
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
:hermes_enabled => true
)

target 'AwesomeAppTests' do
Expand Down
38 changes: 35 additions & 3 deletions AwesomeApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ PODS:
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- hermes-engine (0.11.0)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.06.28.00-v2):
Expand All @@ -86,6 +87,12 @@ PODS:
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Futures (2021.06.28.00-v2):
- boost
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- libevent
- RCTRequired (0.0.0-20220309-2009-538636440)
- RCTTypeSafety (0.0.0-20220309-2009-538636440):
- FBLazyVector (= 0.0.0-20220309-2009-538636440)
Expand Down Expand Up @@ -261,6 +268,17 @@ PODS:
- React-logger (= 0.0.0-20220309-2009-538636440)
- React-perflogger (= 0.0.0-20220309-2009-538636440)
- React-runtimeexecutor (= 0.0.0-20220309-2009-538636440)
- React-hermes (0.0.0-20220309-2009-538636440):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.06.28.00-v2)
- RCT-Folly/Futures (= 2021.06.28.00-v2)
- React-cxxreact (= 0.0.0-20220309-2009-538636440)
- React-jsi (= 0.0.0-20220309-2009-538636440)
- React-jsiexecutor (= 0.0.0-20220309-2009-538636440)
- React-jsinspector (= 0.0.0-20220309-2009-538636440)
- React-perflogger (= 0.0.0-20220309-2009-538636440)
- React-jsi (0.0.0-20220309-2009-538636440):
- boost (= 1.76.0)
- DoubleConversion
Expand Down Expand Up @@ -379,6 +397,8 @@ DEPENDENCIES:
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- hermes-engine (from `https://github.com/facebook/hermes.git`)
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.1100)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
Expand All @@ -391,6 +411,7 @@ DEPENDENCIES:
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
Expand Down Expand Up @@ -438,6 +459,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
hermes-engine:
:git: https://github.com/facebook/hermes.git
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand All @@ -456,6 +479,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/React/CoreModules"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-hermes:
:path: "../node_modules/react-native/ReactCommon/hermes"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
Expand Down Expand Up @@ -491,6 +516,11 @@ EXTERNAL SOURCES:
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

CHECKOUT OPTIONS:
hermes-engine:
:commit: 90c856ca1356dd897d8dd8f7cd9cfa21263bcec8
:git: https://github.com/facebook/hermes.git

SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
Expand All @@ -507,10 +537,11 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
glog: 476ee3e89abb49e07f822b48323c51c57124b572
hermes-engine: 066962f6c4e78776bd757f3b4a3903c38ac0484a
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
RCTRequired: 1c6e97970292b8612be893e3c711d14831441e9c
RCTTypeSafety: 70fa8dcd9e8ac67c6909e70eaeb01ca8a3fc79ff
React: efa2191b49c3636d548e2bb9a8ee3f4d10471488
Expand All @@ -519,6 +550,7 @@ SPEC CHECKSUMS:
React-Core: 9f1b9a4b968e31af8603e85dbdddcf0084677d4b
React-CoreModules: 982779e959de4944ef2e713e8da5765fa2e3bb0a
React-cxxreact: fd4acd8e9fbd4addeb7ce9c0bff453adb4835f2c
React-hermes: f312fc043dfab81cbd204f6dba78281b5929e8aa
React-jsi: aa95b21da850f10a489720cc7980c159c414c0ec
React-jsiexecutor: 202b245636b076c037d3c2e262e0b5f918b792f2
React-jsinspector: 6ec25cf31faee0fe4cab413ddfe11ed730d462f9
Expand All @@ -539,6 +571,6 @@ SPEC CHECKSUMS:
Yoga: 78facf0b95b37d31fc73de5d2fcc2550938a9159
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 8aff5c07d21437c042834337dc058473571adc87
PODFILE CHECKSUM: 7161705298e4db554f79933d367a3f92f6d36ea6

COCOAPODS: 1.11.2
22 changes: 22 additions & 0 deletions RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,25 @@ Steps:
* `cd ios && pod install`
* `npx react-native start`
* `npx react-native run-ios`

### [[Setup] Enable Hermes]()
Steps:
* Open the `Podfile`
* Change `:hermes_enabled` to `true`
* `cd ios && pod install`
* open `AwesomeApp.xcworkspace`
* `cmd+r` -> the app builds but when it runs, it crashes.

#### ISSUES
The issue is due to a temporary incompatibility between Hermes and ReactNative. The team is working on that.
For the moment, follow these steps to work around it:
1. Open the `AwesomeApp/node_modules/react-native/scripts/react_native_pods.rb`
2. Go to line 116 and add the following two lines
```ruby
elsif ENV['BUILD_FROM_GIT'] == '1'
pod 'hermes-engine', :git => "https://github.com/facebook/hermes.git"
```
3. `brew install cmake ninja` -> these are tools used to build hermes
4. `BUILD_FROM_GIT=1 pod install`
5. Open `AwesomeApp.xcworkspace`
6. `cmd+r`

0 comments on commit 75f14ba

Please sign in to comment.