Skip to content

Commit

Permalink
Build Hermes from source by default on iOS
Browse files Browse the repository at this point in the history
Summary:
Remove BUILD_HERMES_SOURCE gate and default to building Hermes from source on iOS when Hermes is enabled.

Changelog:
[iOS][Changed] - When Hermes is enabled, the Hermes Engine will be built from source instead of using the pre-built `hermes-engine` CocoaPod.

Reviewed By: cortinico

Differential Revision: D34911987

fbshipit-source-id: 9d6d49498a23f6dae0b97c9f80c689b654db11bd
  • Loading branch information
hramos authored and facebook-github-bot committed Mar 23, 2022
1 parent 3c2ce29 commit 12ad1ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
3 changes: 1 addition & 2 deletions packages/rn-tester/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ PODS:
- RCTRequired (1000.0.0)
- RCTTypeSafety (1000.0.0):
- FBLazyVector (= 1000.0.0)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 1000.0.0)
- React-Core (= 1000.0.0)
- React (1000.0.0):
Expand Down Expand Up @@ -908,7 +907,7 @@ SPEC CHECKSUMS:
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
RCTRequired: 1c8808cf84569265784a6c33984bbb506ada8c6e
RCTTypeSafety: b9e639380265155a5bbdac4a72be1307f9360fc6
RCTTypeSafety: b6dcb5036a808864ee8cad66ca15f263c24661cc
React: 8d809d414723bb5763093ddec7658066a21ccabc
React-bridging: 1329cdc45834252447f5f4cb8bd19ec78ef0f06e
React-callinvoker: 5f16202ad4e45f0607b1fae0f6955a8f7c87eef1
Expand Down
23 changes: 2 additions & 21 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,8 @@ def use_react_native! (options={})

if hermes_enabled
pod 'React-hermes', :path => "#{prefix}/ReactCommon/hermes"

if ENV['BUILD_HERMES_SOURCE'] == '1'
hermes_source_path = downloadAndConfigureHermesSource(prefix)
pod 'hermes-engine', :path => "#{hermes_source_path}/hermes-engine.podspec"
else
pod 'hermes-engine', '~> 0.11.0'
end
hermes_source_path = downloadAndConfigureHermesSource(prefix)
pod 'hermes-engine', :path => "#{hermes_source_path}/hermes-engine.podspec"
pod 'libevent', '~> 2.1.12'
end

Expand Down Expand Up @@ -677,20 +672,6 @@ def downloadAndConfigureHermesSource(react_native_path)
hermes_dir
end

def locatePathToHermesSource!(react_native_path)
return if ENV['BUILD_HERMES_SOURCE'] != '1'

hermes_source_path = "#{react_native_path}/sdks/hermes"

if !File.exist?(hermes_source_path)
Pod::UI.warn "[Hermes] Error: Hermes source code must be present at #{hermes_source_path} when BUILD_HERMES_SOURCE is enabled."
Pod::UI.warn '[Hermes] Verify that the release of React Native that you are using has the Hermes source code included.'
exit 1
end

hermes_source_path
end

# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
# Call this in the app's main Podfile's post_install hook.
# See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context.
Expand Down

0 comments on commit 12ad1ff

Please sign in to comment.