From 2eaf7debd24185e31934f8c7cdd7c2da4b86effb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Fri, 13 May 2022 00:08:04 -0700 Subject: [PATCH] Hermes: Use prepare-hermes-for-build in Circle CI (#33811) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33811 Use `scripts/hermes/prepare-hermes-for-build.js` in Circle CI, eliminating redundant steps in the `prepare_hermes_workspace` Circle CI job. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D36335122 fbshipit-source-id: b7e8c7aeb2aac5afaf37677cd3ac949ac3f96de1 --- .circleci/config.yml | 27 ++++++------------- .../utils/build-apple-framework.sh | 3 ++- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71a65f51c50..5991c0e7681 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -886,8 +886,12 @@ jobs: name: Install dependencies command: | apt update - apt install -y wget git + apt install -y wget git curl + curl -sL https://deb.nodesource.com/setup_16.x | bash - + apt install -y nodejs + npm install --global yarn - checkout + - run_yarn - run: name: Set up Hermes workspace and caching command: | @@ -904,24 +908,9 @@ jobs: - run: name: Download Hermes tarball command: | - HERMES_TARBALL_URL="https://github.com/facebook/hermes/archive/refs/heads/main.tar.gz" - HERMES_TARBALL_PATH="$HERMES_WS_DIR/download/hermes.tar.gz" - - if [ -f "$HERMES_VERSION_FILE" ]; then - HERMES_TAG=$(cat $HERMES_VERSION_FILE | tr -d '[:space:]') - HERMES_TARBALL_URL="https://github.com/facebook/hermes/archive/refs/tags/$HERMES_TAG.tar.gz" - echo "Using Hermes version tagged $HERMES_TAG" - else - echo "Using Hermes latest version from trunk" - fi - - if [ -f "$HERMES_TARBALL_PATH" ]; then - echo "Skipping download; $HERMES_TARBALL_PATH already present." - else - echo "Downloading Hermes tarball from $HERMES_TARBALL_URL" - wget -O "$HERMES_TARBALL_PATH" "$HERMES_TARBALL_URL" - fi - tar -xzf "$HERMES_WS_DIR/download/hermes.tar.gz" --strip-components=1 -C "$HERMES_WS_DIR/hermes" + node scripts/hermes/prepare-hermes-for-build + cp sdks/download/* $HERMES_WS_DIR/download/. + cp -r sdks/hermes/* $HERMES_WS_DIR/hermes/. - save_cache: key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }} paths: diff --git a/sdks/hermes-engine/utils/build-apple-framework.sh b/sdks/hermes-engine/utils/build-apple-framework.sh index df1fe0c299c..bd506600442 100755 --- a/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/sdks/hermes-engine/utils/build-apple-framework.sh @@ -90,7 +90,8 @@ function create_universal_framework { done mkdir universal - xcodebuild -create-xcframework "$args" -output "universal/hermes.xcframework" + # shellcheck disable=SC2086 + xcodebuild -create-xcframework $args -output "universal/hermes.xcframework" for platform in "$@"; do rm -r "$platform"