From 43388263f2b1dd0393d7d179f2d206833a7cf4f3 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 19 Jul 2022 16:48:02 +0100 Subject: [PATCH] fix: make sure we can build hermes when working against stable --- .circleci/config.yml | 13 +++++++++++-- scripts/hermes/hermes-utils.js | 15 ++++++++++++--- scripts/hermes/prepare-hermes-for-build.js | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e4998f3e1fae46..9d3710bc9cd891 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -937,8 +937,17 @@ jobs: name: Download Hermes tarball command: | node scripts/hermes/prepare-hermes-for-build - cp sdks/download/* $HERMES_WS_DIR/download/. - cp -r sdks/hermes/* $HERMES_WS_DIR/hermes/. + + # If Hermes is not built from source, we don't have these folders. + DOWNLOAD_FOLDER=sdks/download/ + if [[ -d $DOWNLOAD_FOLDER ]]; then + cp $DOWNLOAD_FOLDER* $HERMES_WS_DIR/download/. + fi + + HERMES_FOLDER=sdks/hermes/ + if [[ -d $HERMES_FOLDER ]]; then + cp -r $HERMES_FOLDER* $HERMES_WS_DIR/hermes/. + fi - save_cache: key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }} paths: diff --git a/scripts/hermes/hermes-utils.js b/scripts/hermes/hermes-utils.js index 9f46547a3e475e..755f0b8d2db342 100644 --- a/scripts/hermes/hermes-utils.js +++ b/scripts/hermes/hermes-utils.js @@ -192,10 +192,19 @@ function isOnAReleaseTag() { function shouldBuildHermesFromSource() { const hermesTag = readHermesTag(); + + const onReleaseBranch = isOnAReleaseBranch(); + const onReleaseTag = isOnAReleaseTag(); + const hermesTagIsDefault = hermesTag === DEFAULT_HERMES_TAG; + + // Logging for CI Debugging + console.log(`[Hermes] On release branch? ${onReleaseBranch ? "Yes" : "No"}`) + console.log(`[Hermes] On release tag? ${onReleaseTag ? "Yes" : "No"}`) + console.log(`[Hermes] Hermes Tag is Default? ${hermesTagIsDefault ? "Yes" : "No"}`) return ( - isOnAReleaseBranch() || - isOnAReleaseTag() || - hermesTag === DEFAULT_HERMES_TAG + onReleaseBranch || + onReleaseTag || + hermesTagIsDefault ); } diff --git a/scripts/hermes/prepare-hermes-for-build.js b/scripts/hermes/prepare-hermes-for-build.js index 29a5d9ae27ad2b..d104b60ecd934d 100644 --- a/scripts/hermes/prepare-hermes-for-build.js +++ b/scripts/hermes/prepare-hermes-for-build.js @@ -25,6 +25,7 @@ const { async function main() { if (!shouldBuildHermesFromSource()) { + console.log('[Hermes] Not building from Source') copyPodSpec(); return; }