From 003da38791d95a03452b9511ec3ac17d43f4553a Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 29 Feb 2024 10:26:12 +0000 Subject: [PATCH] [RN][iOS]Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE --- .circleci/configurations/executors.yml | 4 ++-- .circleci/configurations/jobs.yml | 2 +- packages/react-native/sdks/hermes-engine/hermes-utils.rb | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/configurations/executors.yml b/.circleci/configurations/executors.yml index 1c4c6a9bfb806c..1e20c133e36590 100644 --- a/.circleci/configurations/executors.yml +++ b/.circleci/configurations/executors.yml @@ -35,11 +35,11 @@ executors: xcode: *xcode_version resource_class: macos.x86.medium.gen2 environment: - - BUILD_FROM_SOURCE: true + - RCT_BUILD_HERMES_FROM_SOURCE: true reactnativeios-lts: <<: *defaults macos: xcode: '14.3.1' resource_class: macos.x86.medium.gen2 environment: - - BUILD_FROM_SOURCE: true + - RCT_BUILD_HERMES_FROM_SOURCE: true diff --git a/.circleci/configurations/jobs.yml b/.circleci/configurations/jobs.yml index 39eb852857d3dd..d40dbc45e4a2c9 100644 --- a/.circleci/configurations/jobs.yml +++ b/.circleci/configurations/jobs.yml @@ -599,7 +599,7 @@ jobs: environment: - HERMES_WS_DIR: *hermes_workspace_root - HERMES_VERSION_FILE: "packages/react-native/sdks/.hermesversion" - - BUILD_FROM_SOURCE: true + - RCT_BUILD_HERMES_FROM_SOURCE: true steps: - run: name: Install dependencies diff --git a/packages/react-native/sdks/hermes-engine/hermes-utils.rb b/packages/react-native/sdks/hermes-engine/hermes-utils.rb index 8c2f4f6c665a83..c0c7613192ebd8 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-utils.rb +++ b/packages/react-native/sdks/hermes-engine/hermes-utils.rb @@ -7,6 +7,7 @@ require 'rexml/document' HERMES_GITHUB_URL = "https://github.com/facebook/hermes.git" +ENV_BUILD_FROM_SOURCE = "RCT_BUILD_HERMES_FROM_SOURCE" module HermesEngineSourceType LOCAL_PREBUILT_TARBALL = :local_prebuilt_tarball @@ -30,7 +31,7 @@ def HermesEngineSourceType.isFromSource(source_type) # - To use a specific tarball, install the dependencies with: # `HERMES_ENGINE_TARBALL_PATH= bundle exec pod install` # - To force a build from source, install the dependencies with: -# `BUILD_FROM_SOURCE=true bundle exec pod install` +# `RCT_BUILD_HERMES_FROM_SOURCE=true bundle exec pod install` # If none of the two are provided, Cocoapods will check whether there is a tarball for the current version # (either release or nightly). If not, it will fall back to building from source (the latest commit on main). # @@ -85,11 +86,11 @@ def hermes_commit_envvar_defined() end def force_build_from_tag(react_native_path) - return ENV['BUILD_FROM_SOURCE'] === 'true' && File.exist?(hermestag_file(react_native_path)) + return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && File.exist?(hermestag_file(react_native_path)) end def force_build_from_main(react_native_path) - return ENV['BUILD_FROM_SOURCE'] === 'true' && !File.exist?(hermestag_file(react_native_path)) + return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && !File.exist?(hermestag_file(react_native_path)) end def release_artifact_exists(version)