From fdb2631b5ea27765663046b94f84956d30ebaaeb Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 13 Sep 2024 08:16:19 -0700 Subject: [PATCH] Exclude dSYM from the archive (#46472) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46472 Currently, we are building the Debug symbols (dSYM) for hermes dSYM but we are not shipping them with the xcframework. This is correct, because Debug symbols can increase the size of Hermes thus enalrging the iOS IPA and increasing the download time when installing pods. We distribute the dSYM separatedly, in case users needs to symbolicate Hermes stack traces. However the path to the dSYM still appears in the Info.plist of the universal XCFramework and this can cause issues when submitting an app to apple. This change should remove those lines from the universal framework. It fixes https://github.com/facebook/react-native/issues/35863 [Internal] - Remove dSYM path from Info.plist Reviewed By: cortinico Differential Revision: D62603425 fbshipit-source-id: 038ec3d6b056a3d6f5585c8125d0430f56f11bb9 --- .github/workflows/publish-release.yml | 4 ++-- .github/workflows/test-all.yml | 4 ++-- .../hermes-engine/utils/build-apple-framework.sh | 12 ------------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index a4dfa14ef53..38267c39004 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -199,7 +199,7 @@ jobs: - name: Restore Cached Artifacts uses: actions/cache/restore@v4.0.0 with: - key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }} path: | /tmp/hermes/osx-bin/${{ matrix.flavor }} /tmp/hermes/dSYM/${{ matrix.flavor }} @@ -370,7 +370,7 @@ jobs: uses: actions/cache/save@v4.0.0 if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode. with: - key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }} path: | /tmp/hermes/osx-bin/${{ matrix.flavor }} /tmp/hermes/dSYM/${{ matrix.flavor }} diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 24720665aad..c21da9de7a2 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -210,7 +210,7 @@ jobs: - name: Restore Cached Artifacts uses: actions/cache/restore@v4.0.0 with: - key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }} path: | /tmp/hermes/osx-bin/${{ matrix.flavor }} /tmp/hermes/dSYM/${{ matrix.flavor }} @@ -382,7 +382,7 @@ jobs: uses: actions/cache/save@v4.0.0 if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode. with: - key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }} + key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes/utils/build-apple-frameworks.sh') }} path: | /tmp/hermes/osx-bin/${{ matrix.flavor }} /tmp/hermes/dSYM/${{ matrix.flavor }} diff --git a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh index e8cbb496453..5ff30800a38 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh @@ -198,19 +198,7 @@ function create_universal_framework { for i in "${!platforms[@]}"; do local platform="${platforms[$i]}" local hermes_framework_path="${platform}/hermes.framework" - local dSYM_path="$hermes_framework_path" - local dSYM_base_path="$HERMES_PATH/destroot/Library/Frameworks" - - # 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 $dSYM_base_path/$dSYM_path.dSYM " done mkdir -p universal