Skip to content

Commit

Permalink
[iOS][macOS] Eliminate use of bitcode_strip
Browse files Browse the repository at this point in the history
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 flutter#54240
which was reverted in flutter#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
  • Loading branch information
cbracken committed Jul 31, 2024
1 parent 795c0d8 commit 6355470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sky/tools/create_full_ios_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _generate_gen_snapshot(gen_snapshot_path, destination):
print('Cannot find gen_snapshot at %s' % gen_snapshot_path)
sys.exit(1)

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


if __name__ == '__main__':
Expand Down
3 changes: 2 additions & 1 deletion sky/tools/create_macos_gen_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# found in the LICENSE file.

import argparse
import shutil
import subprocess
import sys
import os
Expand Down Expand Up @@ -69,7 +70,7 @@ def generate_gen_snapshot(gen_snapshot_path, destination):
print('Cannot find gen_snapshot at %s' % gen_snapshot_path)
sys.exit(1)

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


if __name__ == '__main__':
Expand Down

0 comments on commit 6355470

Please sign in to comment.