From 340612a200505ca829bae1f9bce800d3673dac04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Thu, 9 Jun 2022 13:11:46 -0700 Subject: [PATCH] Hermes: Use shared JSI from React Native on iOS (#33885) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33885 When building Hermes for React Native, point to the React Native JSI location to ensure both React Native and Hermes use the exact same version of JSI. Changelog: [iOS] [Changed] - When Hermes is enabled, it will use the same copy of JSI as React Native Reviewed By: cortinico, cipolleschi Differential Revision: D36567471 fbshipit-source-id: 97d954ef34007bd31f008fab451512194060d670 --- .circleci/config.yml | 3 --- sdks/hermes-engine/utils/build-apple-framework.sh | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed5f88794b2182..0e9b4b38187380 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -692,9 +692,6 @@ jobs: name: Set HERMES_ENGINE_TARBALL_PATH command: | echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV - - run: - name: Set RCT_VERBOSE_POD_INSTALL=1 - command: echo "export RCT_VERBOSE_POD_INSTALL=1" >> $BASH_ENV - run: name: Create iOS template project command: | diff --git a/sdks/hermes-engine/utils/build-apple-framework.sh b/sdks/hermes-engine/utils/build-apple-framework.sh index 364b067653b312..bd9365fdafd659 100755 --- a/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/sdks/hermes-engine/utils/build-apple-framework.sh @@ -12,6 +12,8 @@ fi NUM_CORES=$(sysctl -n hw.ncpu) IMPORT_HERMESC_PATH=${HERMES_OVERRIDE_HERMESC_PATH:-$PWD/build_host_hermesc/ImportHermesc.cmake} +REACT_NATIVE_PATH=${REACT_NATIVE_PATH:-$PWD/../..} +JSI_PATH="$REACT_NATIVE_PATH/ReactCommon/jsi" function get_release_version { ruby -rcocoapods-core -rjson -e "puts Pod::Specification.from_file('hermes-engine.podspec').version" @@ -59,6 +61,8 @@ function configure_apple_framework { -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ -DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \ -DIMPORT_HERMESC:PATH="$IMPORT_HERMESC_PATH" \ + -DJSI_DIR="$JSI_PATH" \ + -DHERMES_RELEASE_VERSION="for RN $(get_release_version)" \ -DCMAKE_INSTALL_PREFIX:PATH=../destroot \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" }