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

Commit 8a1693b

Browse files
authored
iOS,macOS: Don't archive extra framework metadata (#54674)
By default, zip archives don't just archive the files themselves, but also bundle extra metadata such as unix owner/group and unix timestamps. None of these is particularly important in the case of Flutter: owner/group information is likely to differ across machines and thus be overridden on the unarchiver's end. The tool checks for file presence and occasionally content hashes. This change results in more reproducible zip archives across runs/machines. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 71665e3 commit 8a1693b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sky/tools/sky_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ def create_zip(cwd, zip_filename, paths):
186186
"""Creates a zip archive in cwd, containing a set of cwd-relative files.
187187
188188
In order to preserve the correct internal structure of macOS frameworks,
189-
symlinks are preserved.
189+
symlinks are preserved (-y). In order to generate reproducible builds,
190+
owner/group and unix file timestamps are not included in the archive (-X).
190191
"""
191-
subprocess.check_call(['zip', '-r', '-y', zip_filename] + paths, cwd=cwd)
192+
subprocess.check_call(['zip', '-r', '-X', '-y', zip_filename] + paths, cwd=cwd)
192193

193194

194195
def _dsymutil_path():

0 commit comments

Comments
 (0)