Double zip FlutterMacOS.dSYM.zip. (flutter/engine#41425)

The flutter tool is expecting FlutterMacOS.dSYM.zip to be double zipped.

Bug: https://github.com/flutter/flutter/issues/124911

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
godofredoc 2023-04-25 14:02:06 -07:00 committed by GitHub
parent d05d99805f
commit fbb3fc3af8

View File

@ -137,10 +137,22 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM'
subprocess.check_call([DSYMUTIL, '-o', dsym_out, fat_framework_binary])
if args.zip:
dsym_dst = os.path.join(dst, 'FlutterMacOS.dSYM')
subprocess.check_call(['zip', '-r', '-y', 'FlutterMacOS.dSYM.zip', '.'],
cwd=dsym_dst)
# Double zip to make it consistent with legacy artifacts.
# TODO(fujino): remove this once https://github.com/flutter/flutter/issues/125067 is resolved
subprocess.check_call([
'zip', '-r', '-y', 'FlutterMacOS.dSYM.zip', 'FlutterMacOS.dSYM'
'zip',
'-y',
'FlutterMacOS.dSYM_.zip',
'FlutterMacOS.dSYM.zip',
],
cwd=dst)
cwd=dsym_dst)
# Use doubled zipped file.
dsym_final_src_path = os.path.join(dsym_dst, 'FlutterMacOS.dSYM_.zip')
dsym_final_dst_path = os.path.join(dst, 'FlutterMacOS.dSYM.zip')
shutil.move(dsym_final_src_path, dsym_final_dst_path)
if args.strip:
# copy unstripped
@ -152,14 +164,18 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
# Zip FlutterMacOS.framework.
if args.zip:
filepath_with_entitlements = ''
filepath_without_entitlements = 'FlutterMacOS.framework/Versions/A/FlutterMacOS'
framework_dst = os.path.join(dst, 'FlutterMacOS.framework')
# TODO(xilaizhang): Remove the zip file from the path when outer zip is removed.
filepath_without_entitlements = 'FlutterMacOS.framework.zip/Versions/A/FlutterMacOS'
embed_codesign_configuration(
os.path.join(dst, 'entitlements.txt'), filepath_with_entitlements
os.path.join(framework_dst, 'entitlements.txt'),
filepath_with_entitlements
)
embed_codesign_configuration(
os.path.join(dst, 'without_entitlements.txt'),
os.path.join(framework_dst, 'without_entitlements.txt'),
filepath_without_entitlements
)
subprocess.check_call([
@ -167,22 +183,25 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
'-r',
'-y',
'FlutterMacOS.framework.zip',
'FlutterMacOS.framework',
'entitlements.txt',
'without_entitlements.txt',
'.',
],
cwd=dst)
cwd=framework_dst)
# Double zip to make it consistent with legacy artifacts.
# TODO(fujino): remove this once https://github.com/flutter/flutter/issues/125067 is resolved
subprocess.check_call([
'zip',
'-y',
'FlutterMacOS.framework_.zip',
'FlutterMacOS.framework.zip',
],
cwd=dst)
subprocess.check_call(
[
'zip',
'-y',
'FlutterMacOS.framework_.zip',
'FlutterMacOS.framework.zip',
# TODO(xilaizhang): Move these files to inner zip before removing the outer zip.
'entitlements.txt',
'without_entitlements.txt',
],
cwd=framework_dst
)
# Use doubled zipped file.
final_src_path = os.path.join(dst, 'FlutterMacOS.framework_.zip')
final_src_path = os.path.join(framework_dst, 'FlutterMacOS.framework_.zip')
final_dst_path = os.path.join(dst, 'FlutterMacOS.framework.zip')
shutil.move(final_src_path, final_dst_path)