diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 22930d5c8bcdf..d8176bdf5151d 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -6,7 +6,6 @@ import("//build/compiled_action.gni") import("//build/fuchsia/sdk.gni") import("//flutter/common/config.gni") import("//flutter/lib/ui/dart_ui.gni") -import("//flutter/sky/tools/macos.gni") import("//third_party/dart/utils/compile_platform.gni") # Generates the Dart/Flutter core platform files and tools. @@ -252,7 +251,7 @@ bin_to_linkable("platform_strong_dill_linkable") { # This target is used for builds targeting iOS/Android OS. if (host_os == "mac" && target_os != "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { - strip_bitcode("create_arm_gen_snapshot") { + copy("create_arm_gen_snapshot") { # The toolchain-specific output directory. For cross-compiles, this is a # clang-x64 or clang-arm64 subdirectory of the top-level build directory. host_output_dir = get_label_info( @@ -265,8 +264,8 @@ if (host_os == "mac" && target_os != "mac" && target_cpu_suffix = "armv7" } - input = "${host_output_dir}/gen_snapshot" - output = "${host_output_dir}/gen_snapshot_${target_cpu_suffix}" + sources = [ "${host_output_dir}/gen_snapshot" ] + outputs = [ "${host_output_dir}/gen_snapshot_${target_cpu_suffix}" ] deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ] visibility = [ ":*" ] } @@ -280,15 +279,15 @@ if (host_os == "mac" && target_os != "mac" && # # This target is used for builds targeting macOS. if (host_os == "mac" && target_os == "mac") { - strip_bitcode("create_macos_gen_snapshots") { + copy("create_macos_gen_snapshots") { # The toolchain-specific output directory. For cross-compiles, this is a # clang-x64 or clang-arm64 subdirectory of the top-level build directory. host_output_dir = get_label_info( "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", "root_out_dir") - input = "${host_output_dir}/gen_snapshot" - output = "${root_out_dir}/gen_snapshot_${target_cpu}" + sources = [ "${host_output_dir}/gen_snapshot" ] + outputs = [ "${root_out_dir}/gen_snapshot_${target_cpu}" ] deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ] metadata = { snapshot_entitlement_file_path = [ "gen_snapshot_{$target_cpu}" ] diff --git a/sky/tools/macos.gni b/sky/tools/macos.gni deleted file mode 100644 index f321dda68aba2..0000000000000 --- a/sky/tools/macos.gni +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//flutter/common/config.gni") - -# Copies an input macOS binary to the specified output path. Bitcode segments, -# if any, are stripped. -# -# Example: -# -# strip_bitcode( -# input = "$root_build_dir/gen_snapshot" -# output = "$root_build_dir/gen_snapshot_arm64" -# deps = [ ":gen_snapshot" ] -# ) -# -# TODO(cbracken): https://github.com/flutter/flutter/issues/107884 -# When we stop building with bitcode enabled, this template and the -# strip_bitcode.py script can be deleted and users can call copy() instead. -template("strip_bitcode") { - assert(defined(invoker.input), "The input to strip_bitcode must be defined") - assert(defined(invoker.output), "The output to strip_bitcode most be defined") - action(target_name) { - forward_variables_from(invoker, - [ - "deps", - "metadata", - "visibility", - ]) - script = "//flutter/sky/tools/strip_bitcode.py" - args = [ - "--input", - rebase_path(invoker.input), - "--output", - rebase_path(invoker.output), - ] - inputs = [ invoker.input ] - outputs = [ invoker.output ] - } -} diff --git a/sky/tools/strip_bitcode.py b/sky/tools/strip_bitcode.py deleted file mode 100755 index c5786ad5610fe..0000000000000 --- a/sky/tools/strip_bitcode.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import argparse -import os -import subprocess -import sys - - -def main(): - parser = argparse.ArgumentParser( - description='Copies an input macOS binary to the specified output path. ' - 'Bitcode segments, if any, are stripped.' - ) - parser.add_argument( - '--input', - type=str, - required=True, - help='path of input binary to be read' - ) - parser.add_argument( - '--output', - type=str, - required=True, - help='path of output binary to be written' - ) - args = parser.parse_args() - - # Verify input binary exists. - if not os.path.isfile(args.input): - print('Cannot find input binary at %s' % args.input) - sys.exit(1) - - # Copy input path to output path. Strip bitcode segments, if any. - subprocess.check_call([ - 'xcrun', 'bitcode_strip', '-r', args.input, '-o', args.output - ]) - - -if __name__ == '__main__': - sys.exit(main())