Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 34ece7a

Browse files
authored
Double zip FlutterMacOS.dSYM.zip. (#41425)
The flutter tool is expecting FlutterMacOS.dSYM.zip to be double zipped. Bug: flutter/flutter#124911 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 6d79839 commit 34ece7a

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

sky/tools/create_macos_framework.py

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,22 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
137137
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM'
138138
subprocess.check_call([DSYMUTIL, '-o', dsym_out, fat_framework_binary])
139139
if args.zip:
140+
dsym_dst = os.path.join(dst, 'FlutterMacOS.dSYM')
141+
subprocess.check_call(['zip', '-r', '-y', 'FlutterMacOS.dSYM.zip', '.'],
142+
cwd=dsym_dst)
143+
# Double zip to make it consistent with legacy artifacts.
144+
# TODO(fujino): remove this once https://github.com/flutter/flutter/issues/125067 is resolved
140145
subprocess.check_call([
141-
'zip', '-r', '-y', 'FlutterMacOS.dSYM.zip', 'FlutterMacOS.dSYM'
146+
'zip',
147+
'-y',
148+
'FlutterMacOS.dSYM_.zip',
149+
'FlutterMacOS.dSYM.zip',
142150
],
143-
cwd=dst)
151+
cwd=dsym_dst)
152+
# Use doubled zipped file.
153+
dsym_final_src_path = os.path.join(dsym_dst, 'FlutterMacOS.dSYM_.zip')
154+
dsym_final_dst_path = os.path.join(dst, 'FlutterMacOS.dSYM.zip')
155+
shutil.move(dsym_final_src_path, dsym_final_dst_path)
144156

145157
if args.strip:
146158
# copy unstripped
@@ -152,37 +164,44 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
152164
# Zip FlutterMacOS.framework.
153165
if args.zip:
154166
filepath_with_entitlements = ''
155-
filepath_without_entitlements = 'FlutterMacOS.framework/Versions/A/FlutterMacOS'
167+
168+
framework_dst = os.path.join(dst, 'FlutterMacOS.framework')
169+
# TODO(xilaizhang): Remove the zip file from the path when outer zip is removed.
170+
filepath_without_entitlements = 'FlutterMacOS.framework.zip/Versions/A/FlutterMacOS'
156171

157172
embed_codesign_configuration(
158-
os.path.join(dst, 'entitlements.txt'), filepath_with_entitlements
173+
os.path.join(framework_dst, 'entitlements.txt'),
174+
filepath_with_entitlements
159175
)
160176

161177
embed_codesign_configuration(
162-
os.path.join(dst, 'without_entitlements.txt'),
178+
os.path.join(framework_dst, 'without_entitlements.txt'),
163179
filepath_without_entitlements
164180
)
165181
subprocess.check_call([
166182
'zip',
167183
'-r',
168184
'-y',
169185
'FlutterMacOS.framework.zip',
170-
'FlutterMacOS.framework',
171-
'entitlements.txt',
172-
'without_entitlements.txt',
186+
'.',
173187
],
174-
cwd=dst)
188+
cwd=framework_dst)
175189
# Double zip to make it consistent with legacy artifacts.
176190
# TODO(fujino): remove this once https://github.com/flutter/flutter/issues/125067 is resolved
177-
subprocess.check_call([
178-
'zip',
179-
'-y',
180-
'FlutterMacOS.framework_.zip',
181-
'FlutterMacOS.framework.zip',
182-
],
183-
cwd=dst)
191+
subprocess.check_call(
192+
[
193+
'zip',
194+
'-y',
195+
'FlutterMacOS.framework_.zip',
196+
'FlutterMacOS.framework.zip',
197+
# TODO(xilaizhang): Move these files to inner zip before removing the outer zip.
198+
'entitlements.txt',
199+
'without_entitlements.txt',
200+
],
201+
cwd=framework_dst
202+
)
184203
# Use doubled zipped file.
185-
final_src_path = os.path.join(dst, 'FlutterMacOS.framework_.zip')
204+
final_src_path = os.path.join(framework_dst, 'FlutterMacOS.framework_.zip')
186205
final_dst_path = os.path.join(dst, 'FlutterMacOS.framework.zip')
187206
shutil.move(final_src_path, final_dst_path)
188207

0 commit comments

Comments
 (0)