-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gn + codesign] mac code sign configuration for FlutterMacOS.framework.zip #35707
Changes from 10 commits
864119c
d65a90f
2198a07
78895ec
a8deeed
0c14ba7
d42b961
c705283
e459033
330d147
a565154
f55c612
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,11 @@ def regenerate_symlinks(fat_framework): | |
) | ||
|
||
|
||
def embed_codesign_configuration(config_path, content): | ||
with open(config_path, 'w') as f: | ||
f.write(content) | ||
|
||
|
||
def process_framework(dst, args, fat_framework, fat_framework_binary): | ||
if args.dsym: | ||
dsym_out = os.path.splitext(fat_framework)[0] + '.dSYM' | ||
|
@@ -152,6 +157,30 @@ def process_framework(dst, args, fat_framework, fat_framework_binary): | |
], | ||
cwd=dst) | ||
|
||
macos_filepath_with_entitlements = '' | ||
macos_filepath_without_entitlements = 'FlutterMacOS.framework/Versions/A/FlutterMacOS' | ||
|
||
embed_codesign_configuration( | ||
os.path.join(dst, 'entitlements.txt'), macos_filepath_with_entitlements | ||
) | ||
|
||
embed_codesign_configuration( | ||
os.path.join(dst, 'without_entitlements.txt'), | ||
macos_filepath_without_entitlements | ||
) | ||
|
||
# Zip FlutterMacOS.framework. | ||
subprocess.check_call([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry didn't realize there is an engine PR review on Thursday. These There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inspecting locally, looks like the symlinks are dropped in the build process. Current assumption is based on #35673. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this ready for review? |
||
'zip', | ||
'-r', | ||
godofredoc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'-y', | ||
'FlutterMacOS.framework.zip', | ||
'FlutterMacOS.framework', | ||
'entitlements.txt', | ||
'without_entitlements.txt', | ||
], | ||
cwd=dst) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should lines 160 to 170 be moved to line 151 and remove the zipping subprocess? as it is we are zipping twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, updated to zip only once. Yeah I remember this artifact was historically unzipped twice (https://github.com/christopherfujino/codesign.py/blob/master/codesign.py#L151) for some reasons, but verified just now and it looks there we can do a single zip/unzip.
Also it's interesting that if i double click to extract the artifact, the symlinks are not preserved. But if i use the subprocess command "unzip.. -d .." then the symlinks are preserved in the extracted file.