From 54bc92e051b2842945afdf0c4aefa86c897e40a2 Mon Sep 17 00:00:00 2001 From: Hunter Freyer Date: Fri, 7 May 2021 15:51:02 -0400 Subject: [PATCH] [build_fuchsia_artifacts] Move license copying into BuildBucket(). (flutter/engine#25815) Currently, the licenses are copied into the bucket just before uploading it. Copying the licenses is definitely more about "building" the bucket than it is about "processing the CIPD package", but concretely, some tools complain if the license files arent there, and I'd like to be able to use the cipd tool to upload the bucket directly. Co-authored-by: Hunter Freyer --- .../tools/fuchsia/build_fuchsia_artifacts.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py index 8be1fbf3db..42bbe26397 100755 --- a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py +++ b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py @@ -176,6 +176,27 @@ def BuildBucket(runtime_mode, arch, optimized, product): CopyVulkanDepsToBucket(out_dir, deps_dir, arch) CopyIcuDepsToBucket(out_dir, deps_dir) + # Copy the CIPD YAML template from the source directory to be next to the bucket + # we are about to package. + cipd_yaml = os.path.join(_script_dir, 'fuchsia.cipd.yaml') + CopyFiles(cipd_yaml, os.path.join(_bucket_directory, 'fuchsia.cipd.yaml')) + + # Copy the license files from the source directory to be next to the bucket we + # are about to package. + bucket_root = os.path.join(_bucket_directory, 'flutter') + licenses_root = os.path.join(_src_root_dir, 'flutter/ci/licenses_golden') + license_files = [ + 'licenses_flutter', + 'licenses_fuchsia', + 'licenses_gpu', + 'licenses_skia', + 'licenses_third_party' + ] + for license in license_files: + src_path = os.path.join(licenses_root, license) + dst_path = os.path.join(bucket_root, license) + CopyPath(src_path, dst_path) + def CheckCIPDPackageExists(package_name, tag): '''Check to see if the current package/tag combo has been published''' command = [ @@ -207,27 +228,6 @@ def RunCIPDCommandWithRetries(command): raise def ProcessCIPDPackage(upload, engine_version): - # Copy the CIPD YAML template from the source directory to be next to the bucket - # we are about to package. - cipd_yaml = os.path.join(_script_dir, 'fuchsia.cipd.yaml') - CopyFiles(cipd_yaml, os.path.join(_bucket_directory, 'fuchsia.cipd.yaml')) - - # Copy the license files from the source directory to be next to the bucket we - # are about to package. - bucket_root = os.path.join(_bucket_directory, 'flutter') - licenses_root = os.path.join(_src_root_dir, 'flutter/ci/licenses_golden') - license_files = [ - 'licenses_flutter', - 'licenses_fuchsia', - 'licenses_gpu', - 'licenses_skia', - 'licenses_third_party' - ] - for license in license_files: - src_path = os.path.join(licenses_root, license) - dst_path = os.path.join(bucket_root, license) - CopyPath(src_path, dst_path) - if not upload or not IsLinux(): RunCIPDCommandWithRetries([ 'cipd', 'pkg-build', '-pkg-def', 'fuchsia.cipd.yaml', '-out',