From 12cd42d2fa98e983132e8edfdbcf09ce9090fc83 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Mon, 13 Feb 2023 05:51:02 -0800 Subject: [PATCH] Stabilize Hermes build in CI (#36137) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36137 This change stabilize the build for Hermes in CI, making it more robust in case the rename step fails or the wrong params are passed to hermes. ## Changelog: [internal] - Update Hermes build logic Reviewed By: cortinico Differential Revision: D43232941 fbshipit-source-id: 1121716c69dd3ca247ffeaed57e0d4dfd5daca84 --- sdks/hermes-engine/utils/build-apple-framework.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdks/hermes-engine/utils/build-apple-framework.sh b/sdks/hermes-engine/utils/build-apple-framework.sh index 9886732a2ac..70e627f8eb4 100755 --- a/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/sdks/hermes-engine/utils/build-apple-framework.sh @@ -131,17 +131,19 @@ function create_universal_framework { for i in "${!platforms[@]}"; do local platform="${platforms[$i]}" local hermes_framework_path="${platform}/hermes.framework" - local dSYM_path="${platform}/hermes.framework" + local dSYM_path="$hermes_framework_path" + local dSYM_base_path="$HERMES_PATH/destroot/Library/Frameworks" - # TODO: remove this when the hermes team fixes the dSYM issue - if [[ "$platform" == "catalyst" ]]; then + # If the dSYM rename has failed, the dSYM are generated as 0.dSYM + # (Apple default name) rather then hermes.framework.dSYM. + if [[ -e "$dSYM_base_path/${platform}/0.dSYM" ]]; then dSYM_path="${platform}/0" fi args+="-framework $hermes_framework_path " # Path to dSYM must be absolute - args+="-debug-symbols $HERMES_PATH/destroot/Library/Frameworks/$dSYM_path.dSYM " + args+="-debug-symbols $dSYM_base_path/$dSYM_path.dSYM " done mkdir -p universal