From f88d54582142c147733519c6fc995835f173bb15 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" Date: Tue, 22 Oct 2024 19:43:53 +0000 Subject: [PATCH] Revert "Copy gen_snapshots using python's shutil.copy, avoid links (#55830)" This reverts commit 6c4f05c42aad0ea109df7bcdf4e175caaafc8bd7. --- ci/licenses_golden/excluded_files | 1 - lib/snapshot/BUILD.gn | 10 ++-------- sky/tools/cp.py | 25 ------------------------- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100755 sky/tools/cp.py diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index 676ac3f62bb28..1009dc88cc425 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -436,7 +436,6 @@ ../../../flutter/sky/packages/sky_engine/README.md ../../../flutter/sky/packages/sky_engine/lib/_embedder.yaml ../../../flutter/sky/packages/sky_engine/pubspec.yaml -../../../flutter/sky/tools/cp.py ../../../flutter/sky/tools/create_embedder_framework.py ../../../flutter/sky/tools/create_ios_framework.py ../../../flutter/sky/tools/create_macos_binary.py diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 47646c7888ff0..6c6ce7fce573c 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -201,18 +201,12 @@ if (host_os == "mac" && (target_os == "mac" || target_os == "ios")) { gen_snapshot_target = "$dart_src/runtime/bin:$gen_snapshot_target_name($build_toolchain)" - action(target_name) { - script = "//flutter/sky/tools/cp.py" - + copy(target_name) { # The toolchain-specific output directory. For cross-compiles, this is a # clang-x64 or clang-arm64 subdirectory of the top-level build directory. output_dir = get_label_info(gen_snapshot_target, "root_out_dir") - args = [ - rebase_path("${output_dir}/${gen_snapshot_target_name}"), - rebase_path( - "${root_out_dir}/artifacts_$host_cpu/gen_snapshot_${target_cpu}"), - ] + sources = [ "${output_dir}/${gen_snapshot_target_name}" ] outputs = [ "${root_out_dir}/artifacts_$host_cpu/gen_snapshot_${target_cpu}" ] deps = [ gen_snapshot_target ] diff --git a/sky/tools/cp.py b/sky/tools/cp.py deleted file mode 100755 index f7c7854bb6224..0000000000000 --- a/sky/tools/cp.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Copy a file. - -This module works much like the cp posix command - it takes 2 arguments: -(src, dst) and copies the file with path |src| to |dst|. -""" - -import os -import shutil -import sys - - -def main(src, dst): - # Use copy instead of copyfile to ensure the executable bit is copied. - shutil.copy(src, os.path.normpath(dst)) - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1], sys.argv[2]))