[fuchsia] stamp package with target api level (flutter/engine#30857)

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.
This commit is contained in:
Chase Latta
2022-01-14 09:32:00 -08:00
committed by GitHub
parent 8f35930e5b
commit 3578ec3d99
2 changed files with 15 additions and 8 deletions

View File

@@ -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):

View File

@@ -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