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
20 changes: 15 additions & 5 deletions sky/tools/create_macos_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def main():
parser.add_argument('--x64-out-dir', type=str, required=True)
parser.add_argument('--strip', action="store_true", default=False)
parser.add_argument('--dsym', action="store_true", default=False)
# TODO(godofredoc): Remove after recipes v2 have landed.
parser.add_argument('--zip', action="store_true", default=False)
Copy link
Member

Choose a reason for hiding this comment

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

flutter/flutter#110374 (comment)

I'll send a PR protecting the creation of the zip file with a flag that will be used only on the recipes v2 builds.

Is that what this is? Maybe a comment and todo to remove once it's adoped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO added.


args = parser.parse_args()

Expand Down Expand Up @@ -101,11 +103,11 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
if args.dsym:
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM'
subprocess.check_call([DSYMUTIL, '-o', dsym_out, fat_framework_binary])
subprocess.check_call([
'zip', '-r',
'%s/FlutterMacOS.dSYM.zip' % dst,
'%s/FlutterMacOS.dSYM/Contents' % dst
])
if args.zip:
subprocess.check_call([
'zip', '-r', '-y', 'FlutterMacOS.dSYM.zip', 'FlutterMacOS.dSYM'
],
cwd=dst)

if args.strip:
# copy unstripped
Expand All @@ -114,6 +116,14 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):

subprocess.check_call(["strip", "-x", "-S", fat_framework_binary])

# Zip FlutterMacOS.framework.
if args.zip:
subprocess.check_call([
'zip', '-r', '-y', 'FlutterMacOS.framework.zip',
Copy link
Member

Choose a reason for hiding this comment

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

So -y worked and the symlinks are maintained?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For recipes v2 we'll need a follow up or a work around. The Zip command is correct the problem is in the CAS service that follows symlinks by default. I'm taking a look at the service to see if I can implement some logic to preserve symlinks and if it is too complicated I'll send a follow up to regenerate the symlinks in this script.

'FlutterMacOS.framework'
],
cwd=dst)


if __name__ == '__main__':
sys.exit(main())