From 2670315ff3f76983a01564dfe0a0b2f748dfeb3b Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 8 Aug 2024 16:14:08 -0700 Subject: [PATCH] [iOS] Rename Flutter.dSYM to Flutter.framework.dSYM Renames our Flutter framework dSYM to `Flutter.framework.dSYM` for consistency with all other dSYM bundle names. In iOS release archives, all other dSYM files are: * `App.framework`: `App.framework.dSYM` * `Runner.app`: `Runner.app.dSYM` We continue to archive the dSYM to `Flutter.dSYM.zip` for backward compatibility with the existing instructions for manual symbolification in `docs/Crashes.md` and to remain compatible with dart-lang/dart-ci's symbolizer which expects `Flutter.dSYM` in [`Symbolizer._symbolizeIosFrames`][symbolizer]. Issue: https://github.com/flutter/flutter/issues/116493 symbolizer: https://github.com/dart-lang/dart_ci/blob/e9fd9884a2c76184f4d20eb8a1cb48f92ec63ab5/github-label-notifier/symbolizer/lib/symbolizer.dart#L530 --- sky/tools/create_full_ios_framework.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sky/tools/create_full_ios_framework.py b/sky/tools/create_full_ios_framework.py index d39c07920ee0b..edef7ee89d704 100644 --- a/sky/tools/create_full_ios_framework.py +++ b/sky/tools/create_full_ios_framework.py @@ -147,8 +147,8 @@ def create_framework( # pylint: disable=too-many-arguments framework_dsym = None simulator_dsym = None if args.dsym: - framework_dsym = os.path.splitext(framework)[0] + '.dSYM' - simulator_dsym = os.path.splitext(simulator_framework)[0] + '.dSYM' + framework_dsym = framework + '.dSYM' + simulator_dsym = simulator_framework + '.dSYM' # Emit the framework for physical devices. shutil.rmtree(framework, True) @@ -218,10 +218,25 @@ def zip_archive(dst): 'extension_safe/Flutter.xcframework', ], cwd=dst) - if os.path.exists(os.path.join(dst, 'Flutter.dSYM')): + + # Generate Flutter.dSYM.zip for manual symbolification. + # + # Historically, the framework dSYM was named Flutter.dSYM, so in order to + # remain backward-compatible with existing instructions in docs/Crashes.md + # and existing tooling such as dart-lang/dart_ci, we rename back to that name + # + # TODO(cbracken): remove these archives and the upload steps once we bundle + # dSYMs in app archives. https://github.com/flutter/flutter/issues/116493 + framework_dsym = os.path.join(dst, 'Flutter.framework.dSYM') + if os.path.exists(framework_dsym): + renamed_dsym = framework_dsym.replace('Flutter.framework.dSYM', 'Flutter.dSYM') + os.rename(framework_dsym, renamed_dsym) subprocess.check_call(['zip', '-r', 'Flutter.dSYM.zip', 'Flutter.dSYM'], cwd=dst) - if os.path.exists(os.path.join(dst, 'extension_safe', 'Flutter.dSYM')): + extension_safe_dsym = os.path.join(dst, 'extension_safe', 'Flutter.framework.dSYM') + if os.path.exists(extension_safe_dsym): + renamed_dsym = extension_safe_dsym.replace('Flutter.framework.dSYM', 'Flutter.dSYM') + os.rename(extension_safe_dsym, renamed_dsym) subprocess.check_call(['zip', '-r', 'extension_safe_Flutter.dSYM.zip', 'Flutter.dSYM'], cwd=dst)