From d568f4ce31296f03c5428d57c5a3571c621de9a6 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 20 Aug 2024 23:13:51 -0700 Subject: [PATCH] iOS,macOS: Don't archive extra framework metadata 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. --- sky/tools/sky_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sky/tools/sky_utils.py b/sky/tools/sky_utils.py index e30fd034f3b49..1a19885911b2f 100644 --- a/sky/tools/sky_utils.py +++ b/sky/tools/sky_utils.py @@ -186,9 +186,10 @@ def create_zip(cwd, zip_filename, paths): """Creates a zip archive in cwd, containing a set of cwd-relative files. In order to preserve the correct internal structure of macOS frameworks, - symlinks are preserved. + symlinks are preserved (-y). In order to generate reproducible builds, + owner/group and unix file timestamps are not included in the archive (-X). """ - subprocess.check_call(['zip', '-r', '-y', zip_filename] + paths, cwd=cwd) + subprocess.check_call(['zip', '-r', '-X', '-y', zip_filename] + paths, cwd=cwd) def _dsymutil_path():