From 90dba530e9ff890cc27c048f5393274e88b438e3 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 15:46:21 +0000 Subject: [PATCH 1/8] [LOCAL] fix: use META_CI instead of CI envvar --- .circleci/config.yml | 4 +++- scripts/hermes/prepare-hermes-for-build.js | 2 +- sdks/hermes-engine/hermes-engine.podspec | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8e309891ce12f..1ed306807d11b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -119,6 +119,8 @@ executors: macos: xcode: *xcode_version resource_class: macos.x86.medium.gen2 + environment: + - META_CI: true # ------------------------- # COMMANDS @@ -266,7 +268,7 @@ commands: echo "$VERSION" > /tmp/react-native-version echo "React Native Version is $(cat /tmp/react-native-version)" echo "Hermes commit is $(cat /tmp/hermes/hermesversion)" - + with_hermes_tarball_cache_span: parameters: steps: diff --git a/scripts/hermes/prepare-hermes-for-build.js b/scripts/hermes/prepare-hermes-for-build.js index 87792738e7c00a..8b98ba7da79b86 100644 --- a/scripts/hermes/prepare-hermes-for-build.js +++ b/scripts/hermes/prepare-hermes-for-build.js @@ -39,7 +39,7 @@ async function main(isInCI) { } } -const isInCI = process.env.CI === 'true'; +const isInCI = process.env.META_CI === 'true'; main(isInCI).then(() => { process.exit(0); diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index 9f3b90bf77e8b3..aa3939e3a496ab 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -17,7 +17,7 @@ version = package['version'] # sdks/.hermesversion hermestag_file = File.join(react_native_path, "sdks", ".hermesversion") -isInCI = ENV['CI'] === 'true' +isInCI = ENV['META_CI'] === 'true' source = {} git = "https://github.com/facebook/hermes.git" From f8d3b5e9f871432ecb1fa35ba0b4ed75db2e9810 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 16:18:44 +0000 Subject: [PATCH 2/8] META_CI -> REACT_NATIVE_CI --- .circleci/config.yml | 2 +- scripts/hermes/prepare-hermes-for-build.js | 2 +- sdks/hermes-engine/hermes-engine.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ed306807d11b4..a14c39406f4418 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,7 @@ executors: xcode: *xcode_version resource_class: macos.x86.medium.gen2 environment: - - META_CI: true + - REACT_NATIVE_CI: true # ------------------------- # COMMANDS diff --git a/scripts/hermes/prepare-hermes-for-build.js b/scripts/hermes/prepare-hermes-for-build.js index 8b98ba7da79b86..711de87d90b5d7 100644 --- a/scripts/hermes/prepare-hermes-for-build.js +++ b/scripts/hermes/prepare-hermes-for-build.js @@ -39,7 +39,7 @@ async function main(isInCI) { } } -const isInCI = process.env.META_CI === 'true'; +const isInCI = process.env.REACT_NATIVE_CI === 'true'; main(isInCI).then(() => { process.exit(0); diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index aa3939e3a496ab..247bc111f385f1 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -17,7 +17,7 @@ version = package['version'] # sdks/.hermesversion hermestag_file = File.join(react_native_path, "sdks", ".hermesversion") -isInCI = ENV['META_CI'] === 'true' +isInCI = ENV['REACT_NATIVE_CI'] === 'true' source = {} git = "https://github.com/facebook/hermes.git" From 11d17ea7eae24194965aec5e7fab0da7fda0624e Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 16:23:42 +0000 Subject: [PATCH 3/8] Rename more occurences of CI to REACT_NATIVE_CI --- scripts/cocoapods/__tests__/jsengine-test.rb | 4 ++-- scripts/cocoapods/jsengine.rb | 2 +- scripts/test-e2e-local.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cocoapods/__tests__/jsengine-test.rb b/scripts/cocoapods/__tests__/jsengine-test.rb index ef18a72c6be0fb..0092bc8ac28008 100644 --- a/scripts/cocoapods/__tests__/jsengine-test.rb +++ b/scripts/cocoapods/__tests__/jsengine-test.rb @@ -27,7 +27,7 @@ def teardown Pod::UI.reset() podSpy_cleanUp() ENV['USE_HERMES'] = '1' - ENV['CI'] = nil + ENV['REACT_NATIVE_CI'] = nil File.reset() end @@ -133,7 +133,7 @@ def test_isBuildingHermesFromSource_whenTarballIsNilAndVersionIsNotNightly_retur end def test_isBuildingHermesFromSource_whenTarballIsNilAndInReleaseBranch_returnTrue - ENV['CI'] = 'true' + ENV['REACT_NATIVE_CI'] = 'true' File.mocked_existing_files(['../../sdks/.hermesversion']) assert_true(is_building_hermes_from_source("0.999.0", '../..')) end diff --git a/scripts/cocoapods/jsengine.rb b/scripts/cocoapods/jsengine.rb index 7f941c127ccbfa..15890c605cc0a9 100644 --- a/scripts/cocoapods/jsengine.rb +++ b/scripts/cocoapods/jsengine.rb @@ -72,7 +72,7 @@ def is_building_hermes_from_source(react_native_version, react_native_path) isInMain = react_native_version.include?('1000.0.0') hermestag_file = File.join(react_native_path, "sdks", ".hermesversion") - isInCI = ENV['CI'] === 'true' + isInCI = ENV['REACT_NATIVE_CI'] === 'true' isReleaseBranch = File.exist?(hermestag_file) && isInCI diff --git a/scripts/test-e2e-local.js b/scripts/test-e2e-local.js index 03605481c676a0..39ce8ca26f75ef 100644 --- a/scripts/test-e2e-local.js +++ b/scripts/test-e2e-local.js @@ -97,7 +97,7 @@ if (argv.target === 'RNTester') { exec( `cd packages/rn-tester && USE_HERMES=${ argv.hermes ? 1 : 0 - } CI=${onReleaseBranch} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, + } REACT_NATIVE_CI=${onReleaseBranch} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`, ); // if everything succeeded so far, we can launch Metro and the app From 89ae6e7638d2cefa0e5fe269ca0e62933d6240e3 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 16:31:22 +0000 Subject: [PATCH 4/8] Use REACT_NATIVE_CI in rn-tester/Podfile --- packages/rn-tester/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 3e6f2c798d1cab..f938426b8027be 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -6,7 +6,7 @@ platform :ios, min_ios_version_supported prepare_react_native_project! USE_FRAMEWORKS = ENV['USE_FRAMEWORKS'] == '1' -IN_CI = ENV['CI'] == 'true' +IN_CI = ENV['REACT_NATIVE_CI'] == 'true' @prefix_path = "../.." From ddf065bc12ecea4c60c22a150ba2f79d6f55cab4 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 16:44:06 +0000 Subject: [PATCH 5/8] Add REACT_NATIVE_CI to prepare_hermes_workspace --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index a14c39406f4418..8464e162fb2fa7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1129,6 +1129,7 @@ jobs: environment: - HERMES_WS_DIR: *hermes_workspace_root - HERMES_VERSION_FILE: "sdks/.hermesversion" + - REACT_NATIVE_CI: true steps: - run: name: Install dependencies From 777ee7c9342491448fd5ae620a2736f259f8476a Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 17:28:30 +0000 Subject: [PATCH 6/8] revert: Use REACT_NATIVE_CI in rn-tester/Podfile --- packages/rn-tester/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index f938426b8027be..3e6f2c798d1cab 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -6,7 +6,7 @@ platform :ios, min_ios_version_supported prepare_react_native_project! USE_FRAMEWORKS = ENV['USE_FRAMEWORKS'] == '1' -IN_CI = ENV['REACT_NATIVE_CI'] == 'true' +IN_CI = ENV['CI'] == 'true' @prefix_path = "../.." From a9b4f0bb3f7e0125306387e85145c5580267277b Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Fri, 9 Dec 2022 17:43:02 +0000 Subject: [PATCH 7/8] Consume hermes-engine.podspec from sdks/hermes-engine --- scripts/cocoapods/jsengine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cocoapods/jsengine.rb b/scripts/cocoapods/jsengine.rb index 15890c605cc0a9..6551ef3e50fddb 100644 --- a/scripts/cocoapods/jsengine.rb +++ b/scripts/cocoapods/jsengine.rb @@ -30,7 +30,7 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab abort unless prep_status == 0 pod 'React-jsi', :path => "#{react_native_path}/ReactCommon/jsi" - pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes/hermes-engine.podspec" + pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes-engine/hermes-engine.podspec" pod 'React-hermes', :path => "#{react_native_path}/ReactCommon/hermes" pod 'libevent', '~> 2.1.12' end From 834fad3f884522ed1c6fda6a73fbe047a832d806 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Mon, 12 Dec 2022 12:33:42 +0000 Subject: [PATCH 8/8] Consume hermes-engine.podspec from sdks/hermes-engine. Update tests --- scripts/cocoapods/__tests__/jsengine-test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cocoapods/__tests__/jsengine-test.rb b/scripts/cocoapods/__tests__/jsengine-test.rb index 0092bc8ac28008..8ea0b4cfd816b8 100644 --- a/scripts/cocoapods/__tests__/jsengine-test.rb +++ b/scripts/cocoapods/__tests__/jsengine-test.rb @@ -107,7 +107,7 @@ def test_setupHermes_whenHermesScriptSucceeds_installsPods assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi") assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes") assert_equal($podInvocation["libevent"][:version], "~> 2.1.12") - assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes/hermes-engine.podspec") + assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes-engine/hermes-engine.podspec") end def test_setupHermes_installsPods_installsFabricSubspecWhenFabricEnabled @@ -120,7 +120,7 @@ def test_setupHermes_installsPods_installsFabricSubspecWhenFabricEnabled # Assert assert_equal($podInvocationCount, 4) assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi") - assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes/hermes-engine.podspec") + assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes-engine/hermes-engine.podspec") assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes") assert_equal($podInvocation["libevent"][:version], "~> 2.1.12") end