@@ -26,6 +26,8 @@ references:
2626
2727 hermes_workspace_root : &hermes_workspace_root
2828 /tmp/hermes
29+ hermes_tarball_artifacts_dir : &hermes_tarball_artifacts_dir
30+ /tmp/hermes/hermes-runtime-darwin
2931 attach_hermes_workspace : &attach_hermes_workspace
3032 attach_workspace :
3133 at : *hermes_workspace_root
@@ -66,7 +68,7 @@ references:
6668 - ~/react-native/sdks/hermes/build_macosx
6769 - ~/react-native/sdks/hermes/destroot
6870 hermes_tarball_cache_paths : &hermes_tarball_cache_paths
69- - /tmp/hermes/hermes-runtime-darwin/
71+ - *hermes_tarball_artifacts_dir
7072
7173 # -------------------------
7274 # Filters
@@ -133,12 +135,12 @@ commands:
133135 steps :
134136 - restore_cache :
135137 keys :
136- - << parameters.checkout_base_cache_key >>-{{ .Branch }}-{{ .Revision }}
137- - << parameters.checkout_base_cache_key >>-{{ .Branch }}-
138- - << parameters.checkout_base_cache_key >>
138+ - << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
139+ - << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-
140+ - << parameters.checkout_base_cache_key >>-{{ arch }}-
139141 - checkout
140142 - save_cache :
141- key : << parameters.checkout_base_cache_key >>-{{ .Branch }}-{{ .Revision }}
143+ key : << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
142144 paths :
143145 - " .git"
144146
@@ -269,6 +271,9 @@ commands:
269271 flavor :
270272 type : string
271273 default : " Debug"
274+ hermes_tarball_artifacts_dir :
275+ type : string
276+ default : *hermes_tarball_artifacts_dir
272277 steps :
273278 - when :
274279 condition :
@@ -288,26 +293,27 @@ commands:
288293 condition : << parameters.set_tarball_path >>
289294 steps :
290295 - run :
291- name : Set HERMES_ENGINE_TARBALL_PATH if present
296+ name : Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
292297 command : |
293- BASE_PATH=/tmp/hermes/hermes-runtime-darwin/
294- if [ ! -d $BASE_PATH ]; then
295- echo "Hermes tarball base path not present ($BASE_PATH ). Build it from source."
298+ HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
299+ if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
300+ echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR ). Build Hermes from source."
296301 exit 0
297302 fi
298- if [[ << parameters.flavor >> == "Debug" ]]; then
299- TARBALL_FILENAME=hermes-runtime-darwin-debug-*.tar.gz
300- elif [[ << parameters.flavor >> == "Release" ]]; then
301- TARBALL_FILENAME=hermes-runtime-darwin-release-*.tar.gz
302- else
303- echo "Unsupported build type << parameters.flavor >>."
303+
304+ if [ ! -d ~/react-native ]; then
305+ echo "No React Native checkout found. Run `checkout` first."
304306 exit 0
305307 fi
306- # /tmp/hermes/hermes-runtime-darwin/hermes-runtime-darwin-release-v0.70.0.tar.gz
307- # /tmp/hermes/hermes-runtime-darwin/hermes-runtime-darwin-debug-v0.70.0.tar.gz
308- TARBALL_PATH=$(ls $BASE_PATH$TARBALL_FILENAME)
308+
309+ TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>" --releaseVersion "*")
310+ TARBALL_PATH=$(ls $HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME)
311+
312+ echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
313+ echo "$TARBALL_PATH"
314+
309315 if [ ! -f $TARBALL_PATH ]; then
310- echo "Hermes tarball not present ($TARBALL_PATH). Build it from source."
316+ echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
311317 exit 0
312318 fi
313319
@@ -617,7 +623,7 @@ jobs:
617623 if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
618624 echo "JavaScript bundle missing, cannot run instrumentation tests. Verify Build JavaScript Bundle step completed successfully."; exit 1;
619625 fi
620- source scripts/android-setup.sh && NO_BUCKD=1 retry3 timeout 300 buck build ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
626+ source scripts/android-setup.sh && NO_BUCKD=1 scripts/ retry3 timeout 300 buck build ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
621627
622628 - run :
623629 name : Collect Test Results
@@ -826,6 +832,10 @@ jobs:
826832 # -------------------------
827833 test_ios_rntester :
828834 executor : reactnativeios
835+ parameters :
836+ architecture :
837+ type : string
838+ default : " OldArch"
829839 steps :
830840 - checkout_code_with_cache
831841 - run_yarn
@@ -854,9 +864,14 @@ jobs:
854864 set_tarball_path : True
855865 steps :
856866 - run :
857- name : Install CocoaPods dependencies
867+ name : Install CocoaPods dependencies - Architecture << parameters.architecture >>
858868 command : |
859869 rm -rf packages/rn-tester/Pods
870+
871+ if [[ << parameters.architecture >> == "NewArch" ]]; then
872+ export RCT_NEW_ARCH_ENABLED=1
873+ fi
874+
860875 cd packages/rn-tester && bundle exec pod install
861876
862877 - run :
@@ -1084,8 +1099,10 @@ jobs:
10841099 executor : reactnativeios
10851100 environment :
10861101 - HERMES_WS_DIR : *hermes_workspace_root
1102+ - HERMES_TARBALL_ARTIFACTS_DIR : *hermes_tarball_artifacts_dir
10871103 steps :
10881104 - checkout_code_with_cache
1105+ - run_yarn
10891106 - *attach_hermes_workspace
10901107 - when :
10911108 condition :
@@ -1126,35 +1143,42 @@ jobs:
11261143 - run :
11271144 name : Package the Hermes Apple frameworks
11281145 command : |
1129- echo "Packaging Hermes Apple frameworks for << parameters.flavor >> build type"
1146+ BUILD_TYPE="<< parameters.flavor >>"
1147+ echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
1148+
1149+ TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
11301150
1151+ # get_release_version() is defined in build-apple-framework.sh
11311152 cd ~/react-native/sdks/hermes
1132- BUILD_TYPE="<< parameters.flavor >>" source ./utils/build-apple-framework.sh
1133-
1134- mkdir -p /tmp/cocoapods-package-root/destroot
1135- mkdir -p /tmp/hermes/output
1136- cp -R ./destroot /tmp/cocoapods-package-root
1137- cp LICENSE /tmp/cocoapods-package-root
1138-
1139- if [[ << parameters.flavor >> == "Debug" ]]; then
1140- TARBALL_FILENAME=hermes-runtime-darwin-debug-v$(get_release_version).tar.gz
1141- elif [[ << parameters.flavor >> == "Release" ]]; then
1142- TARBALL_FILENAME=hermes-runtime-darwin-release-v$(get_release_version).tar.gz
1143- else
1144- echo "Unsupported build type << parameters.flavor >>."
1145- exit 0
1146- fi
1153+ BUILD_TYPE=$BUILD_TYPE source ./utils/build-apple-framework.sh
1154+ RELEASE_VERSION=$(get_release_version)
1155+
1156+ cd ~/react-native
1157+
1158+ TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE" --releaseVersion "$RELEASE_VERSION")
11471159
1148- tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/$TARBALL_FILENAME .
1160+ echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
11491161
1150- mkdir -p /tmp/hermes/hermes-runtime-darwin
1151- cp /tmp/hermes/output/$TARBALL_FILENAME /tmp/hermes/hermes-runtime-darwin/.
1162+ TARBALL_OUTPUT_PATH=$(node ./scripts/hermes/create-tarball.js \
1163+ --inputDir ~/react-native/sdks/hermes \
1164+ --buildType "$BUILD_TYPE" \
1165+ --releaseVersion "$RELEASE_VERSION" \
1166+ --outputDir "$TARBALL_OUTPUT_DIR")
11521167
1153- # TODO: Remove this once the client side is aware of -release and -debug tarballs
1154- if [[ << parameters.flavor >> == "Debug" ]]; then
1155- cp /tmp/hermes/hermes-runtime-darwin/hermes-runtime-darwin-debug-v$(get_release_version).tar.gz /tmp/hermes/hermes-runtime-darwin/hermes-runtime-darwin-v$(get_release_version).tar.gz
1168+ echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
1169+
1170+ mkdir -p "$HERMES_TARBALL_ARTIFACTS_DIR"
1171+ cp "$TARBALL_OUTPUT_PATH" "$HERMES_TARBALL_ARTIFACTS_DIR/."
1172+
1173+ # Make a copy of the debug tarball and use the old filename.
1174+ # This is necessary to support patch releases in versions of
1175+ # React Native that expect a single tarball.
1176+ # TODO: Remove once 0.70.x and 0.69.x are no longer being patched.
1177+ if [[ $BUILD_TYPE == "Debug" ]]; then
1178+ OLD_TARBALL_FILENAME="hermes-runtime-darwin-v$RELEASE_VERSION.tar.gz"
1179+ cp "$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME" "$HERMES_TARBALL_ARTIFACTS_DIR/$OLD_TARBALL_FILENAME"
1180+ echo "$OLD_TARBALL_FILENAME is a copy of $TARBALL_FILENAME, provided for backward compatibility." >> "$HERMES_TARBALL_ARTIFACTS_DIR/README.txt"
11561181 fi
1157- ls /tmp/hermes/hermes-runtime-darwin/
11581182 - when :
11591183 condition :
11601184 equal : [ << parameters.flavor >>, "Debug"]
@@ -1170,7 +1194,7 @@ jobs:
11701194 key : *hermes_workspace_release_cache_key
11711195 paths : *hermes_workspace_macos_cache_paths
11721196 - store_artifacts :
1173- path : /tmp/hermes/hermes-runtime-darwin/
1197+ path : *hermes_tarball_artifacts_dir
11741198 - store_artifacts :
11751199 path : /tmp/hermes/osx-bin/
11761200 - persist_to_workspace :
@@ -1466,6 +1490,9 @@ workflows:
14661490 - test_ios_rntester :
14671491 requires :
14681492 - build_hermes_macos
1493+ matrix :
1494+ parameters :
1495+ architecture : ["NewArch", "OldArch"]
14691496 - test_ios :
14701497 run_unit_tests : true
14711498 requires :
0 commit comments