diff --git a/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index dc21ad653fc..92e4c9c0d3e 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/shell/platform/fuchsia/flutter/BUILD.gn @@ -197,6 +197,7 @@ template("jit_runner") { fuchsia_sdk_base = "//fuchsia/sdk/$host_os/arch/$host_cpu" fuchsia_sdk_lib = "$fuchsia_sdk_base/lib" sysroot_lib = "$fuchsia_sdk_base/sysroot/lib" + sysroot_dist_lib = "$fuchsia_sdk_base/sysroot/dist/lib" libraries = [ { @@ -231,6 +232,10 @@ template("jit_runner") { name = "libc.so" path = rebase_path("$sysroot_lib") }, + { + name = "ld.so.1" + path = rebase_path("$sysroot_dist_lib") + }, # Note, we use the md5 hashes here because of gn limitations of json parsing. # This is a hack, and we can migrate to a better way soon. @@ -244,6 +249,11 @@ template("jit_runner") { path = rebase_path( "$clang_base/${clang_manifest_json.md5_916c01a85e3353f124776599819ecb1c}") }, + { + name = "libunwind.so.1" + path = rebase_path( + "$clang_base/${clang_manifest_json.md5_beb70f40d525448b39ea87d9f5811e56}") + }, ] meta = [ diff --git a/tools/fuchsia/gen_package.py b/tools/fuchsia/gen_package.py index 0ec0f5617ef..00331857e7b 100755 --- a/tools/fuchsia/gen_package.py +++ b/tools/fuchsia/gen_package.py @@ -14,9 +14,29 @@ import subprocess import sys +# Generates the manifest and returns the file. +def GenerateManifest(package_dir): + full_paths = [] + for root, dirs, files in os.walk(package_dir): + for f in files: + common_prefix = os.path.commonprefix([root, package_dir]) + rel_path = os.path.relpath(os.path.join(root, f), common_prefix) + from_package = os.path.abspath(os.path.join(package_dir, rel_path)) + full_paths.append('%s=%s' % (rel_path, from_package)) + parent_dir = os.path.abspath(os.path.join(package_dir, os.pardir)) + manifest_file_name = os.path.basename(package_dir) + '.manifest' + manifest_path = os.path.join(parent_dir, manifest_file_name) + with open(manifest_path, 'w') as f: + for item in full_paths: + f.write("%s\n" % item) + return manifest_path + + def CreateFarPackage(pm_bin, package_dir, signing_key, dst_dir): + manifest_path = GenerateManifest(package_dir) + pm_command_base = [ - pm_bin, '-m', package_dir, '-k', signing_key, '-o', dst_dir + pm_bin, '-m', manifest_path, '-k', signing_key, '-o', dst_dir ] # Build the package diff --git a/tools/fuchsia/package_dir.gni b/tools/fuchsia/package_dir.gni index 8a86117578f..fd846f76865 100644 --- a/tools/fuchsia/package_dir.gni +++ b/tools/fuchsia/package_dir.gni @@ -39,7 +39,7 @@ template("package_dir") { far_base_dir = "$root_out_dir/${pkg_target_name}_far" copy_sources = [ "$root_out_dir/${invoker.binary}" ] - copy_outputs = [ "$far_base_dir/app/bin" ] + copy_outputs = [ "$far_base_dir/bin/app" ] foreach(res, pkg.resources) { copy_sources += [ res.path ] diff --git a/tools/fuchsia/parse_manifest.py b/tools/fuchsia/parse_manifest.py index d5ec555b6fe..af45d5005ae 100755 --- a/tools/fuchsia/parse_manifest.py +++ b/tools/fuchsia/parse_manifest.py @@ -30,6 +30,8 @@ def main(): key, val = line.strip().split('=') md5 = hashlib.md5(key.encode()).hexdigest() hash_key = 'md5_%s' % md5 + # Uncomment this line to get the hash keys + # print val, hash_key output[hash_key] = os.path.dirname(val) print(json.dumps(output))