Skip to content

Commit

Permalink
[macOS] Clean up gen_snapshot copy invocation (flutter#36461)
Browse files Browse the repository at this point in the history
create_macos_gen_snapshots.py uses `xcrun bitcode_strip` to copy
gen_snapshot from its build directory to a suffixed gen_snapshot_arm64
or gen_snapshot_armv7, while stripping the bitcode segment, if any.

This simplifies the python invocation to use subprocess.check_call, and
also guarantees the process exits with failure in such a situation --
we weren't checking the return value of generate_gen_snapshot.

This is cleanup for issues encountered while working on merging
macOS/iOS gen_snapshot tooling.

Issue: flutter/flutter#103386
Issue: flutter/flutter#101138
  • Loading branch information
cbracken authored Sep 28, 2022
1 parent d2dfe76 commit 03330f5
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions sky/tools/create_macos_gen_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,9 @@ def generate_gen_snapshot(directory, destination):
print('Cannot find gen_snapshot at %s' % gen_snapshot_dir)
sys.exit(1)

command = [
subprocess.check_call([
'xcrun', 'bitcode_strip', '-r', gen_snapshot_dir, '-o', destination
]
process = subprocess.Popen(
command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE
)
stdout, stderr = process.communicate()
exit_status = process.wait()

if exit_status != 0:
print(
'Error processing command with stdout[%s] and stderr[%s]' %
(stdout, stderr)
)
return 1
])


if __name__ == '__main__':
Expand Down

0 comments on commit 03330f5

Please sign in to comment.