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

Commit cd58455

Browse files
committed
[iOS][macOS] Eliminate use of bitcode_strip
Our executables are no longer built with bitcode enabled and thus `bitcode_strip -r SOURCE -o DEST` is just copying the file in question to the output location. Use of Bitcode was eliminated in Flutter in 2022. See linked issue for details. This is a reland of #54240 which was reverted in #54250 The the previous version was reverted because Python's `shutil.copyfile` doesn't set the unix permissions of the source file on the destination file. However, when overwriting an existing destination file, it preserves any permissions on that file. One can imagine how this might be problematic if you test the script by running before and after the change with the same output directory. `shutil.copy2` attempts to preserve source file metadata when writing the copy. Issue: flutter/flutter#107884
1 parent 1fdf371 commit cd58455

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sky/tools/create_full_ios_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def _generate_gen_snapshot(gen_snapshot_path, destination):
243243
print('Cannot find gen_snapshot at %s' % gen_snapshot_path)
244244
sys.exit(1)
245245

246-
subprocess.check_call(['xcrun', 'bitcode_strip', '-r', gen_snapshot_path, '-o', destination])
246+
shutil.copy2(gen_snapshot_path, destination)
247247

248248

249249
if __name__ == '__main__':

sky/tools/create_macos_gen_snapshots.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# found in the LICENSE file.
66

77
import argparse
8+
import shutil
89
import subprocess
910
import sys
1011
import os
@@ -69,7 +70,7 @@ def generate_gen_snapshot(gen_snapshot_path, destination):
6970
print('Cannot find gen_snapshot at %s' % gen_snapshot_path)
7071
sys.exit(1)
7172

72-
subprocess.check_call(['xcrun', 'bitcode_strip', '-r', gen_snapshot_path, '-o', destination])
73+
shutil.copy2(gen_snapshot_path, destination)
7374

7475

7576
if __name__ == '__main__':

0 commit comments

Comments
 (0)