From 73a3404133b96aec49e2551f1fefa1fdbe9f2a5c Mon Sep 17 00:00:00 2001 From: Chase Latta Date: Thu, 13 Jan 2022 23:01:30 +0000 Subject: [PATCH] [fuchsia] stamp package with target api level Infrastructure runs the pm command on packages in a different path which we were not accounting for. This will make sure we stamp the packages when infra builds them. --- tools/fuchsia/build_fuchsia_artifacts.py | 19 +++++++++++++------ tools/fuchsia/gen_package.py | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/fuchsia/build_fuchsia_artifacts.py b/tools/fuchsia/build_fuchsia_artifacts.py index afac9dce45d46..a8aecb93fcc4a 100755 --- a/tools/fuchsia/build_fuchsia_artifacts.py +++ b/tools/fuchsia/build_fuchsia_artifacts.py @@ -130,7 +130,7 @@ def CopyZirconFFILibIfExists(source, destination): destination_base = os.path.join(destination, 'flutter_binaries') FindFileAndCopyTo('libzircon_ffi.so', source_root, destination_base) -def CopyToBucketWithMode(source, destination, aot, product, runner_type): +def CopyToBucketWithMode(source, destination, aot, product, runner_type, api_level): mode = 'aot' if aot else 'jit' product_suff = '_product' if product else '' runner_name = '%s_%s%s_runner' % (runner_type, mode, product_suff) @@ -142,7 +142,7 @@ def CopyToBucketWithMode(source, destination, aot, product, runner_type): key_path = os.path.join(_script_dir, 'development.key') destination = os.path.join(_bucket_directory, destination, mode) - CreateFarPackage(pm_bin, far_base, key_path, destination) + CreateFarPackage(pm_bin, far_base, key_path, destination, api_level) patched_sdk_dirname = '%s_runner_patched_sdk' % runner_type patched_sdk_dir = os.path.join(source_root, patched_sdk_dirname) dest_sdk_path = os.path.join(destination, patched_sdk_dirname) @@ -154,10 +154,17 @@ def CopyToBucketWithMode(source, destination, aot, product, runner_type): def CopyToBucket(src, dst, product=False): - CopyToBucketWithMode(src, dst, False, product, 'flutter') - CopyToBucketWithMode(src, dst, True, product, 'flutter') - CopyToBucketWithMode(src, dst, False, product, 'dart') - CopyToBucketWithMode(src, dst, True, product, 'dart') + api_level = ReadTargetAPILevel() + CopyToBucketWithMode(src, dst, False, product, 'flutter', api_level) + CopyToBucketWithMode(src, dst, True, product, 'flutter', api_level) + CopyToBucketWithMode(src, dst, False, product, 'dart', api_level) + CopyToBucketWithMode(src, dst, True, product, 'dart', api_level) + +def ReadTargetAPILevel(): + filename = os.path.join(os.path.dirname(__file__), 'target_api_level') + with open(filename) as f: + api_level = f.read().rstrip('\n') + return api_level def CopyVulkanDepsToBucket(src, dst, arch): diff --git a/tools/fuchsia/gen_package.py b/tools/fuchsia/gen_package.py index 22cce9744596a..69e7f8e290d55 100755 --- a/tools/fuchsia/gen_package.py +++ b/tools/fuchsia/gen_package.py @@ -35,11 +35,11 @@ def GenerateManifest(package_dir): return manifest_path -def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir): +def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir, api_level): manifest_path = GenerateManifest(package_dir) pm_command_base = [ - pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir + pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir, '--api-level', api_level ] # Build the package