Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sky/tools/create_macos_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
'without_entitlements.txt',
],
cwd=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)
# Use doubled zipped file.
final_src_path = os.path.join(dst, 'FlutterMacOS.framework_.zip')
final_dst_path = os.path.join(dst, 'FlutterMacOS.framework.zip')
shutil.move(final_src_path, final_dst_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we delete FlutterMacOS.framework.zip first? Per https://docs.python.org/3/library/shutil.html#shutil.move,

If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics.

I'm not sure what this means.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following that link (https://docs.python.org/3/library/os.html#os.rename): on Unix (which I'm assuming macOS is):

If both are files, dst will be replaced silently if the user has permission. The operation may fail on some Unix flavors if src and dst are on different filesystems.

So looks like this should work.



if __name__ == '__main__':
Expand Down