未验证 提交 7a06baad 编写于 作者: K Kaushik Iska 提交者: GitHub

[dart_aot_runner] Complete the port of dart_aot_runner (#13103)

* [dart_aot_runner] Complete the port of dart_aot_runner

- also adds the previously missing profiler symbols for dart_jit_runner
- CIPD package will contain both the JIT and AOT dart runners

* specify the inputs
上级 9acec410
......@@ -36,7 +36,10 @@ group("flutter") {
}
if (is_fuchsia && using_fuchsia_sdk) {
public_deps += [ "$flutter_root/shell/platform/fuchsia" ]
public_deps += [
"$flutter_root/shell/platform/fuchsia",
"$flutter_root/shell/testing($host_toolchain)",
]
}
if (!is_fuchsia && !is_fuchsia_host) {
......
......@@ -14,14 +14,11 @@ if (using_fuchsia_sdk) {
product_suffix = "product_"
}
dart_runner_target = "dart_jit_${product_suffix}runner"
group("fuchsia") {
deps = [
"dart:kernel_compiler",
"dart_runner:$dart_runner_target",
"dart_runner/embedder:dart_aot_product_snapshot_cc",
"dart_runner/vmservice:vmservice",
"dart_runner:dart_aot_${product_suffix}runner",
"dart_runner:dart_jit_${product_suffix}runner",
"flutter:flutter_aot_${product_suffix}runner",
"flutter:flutter_jit_${product_suffix}runner",
"flutter:flutter_runner_tests",
......
......@@ -121,6 +121,80 @@ runner("dart_aot_product_runner_bin") {
]
}
template("aot_runner_package") {
assert(defined(invoker.product), "The parameter 'product' must be defined")
product_suffix = ""
if (invoker.product) {
product_suffix = "_product"
}
fuchsia_archive(target_name) {
deps = [
":dart_aot${product_suffix}_runner_bin",
]
if (!invoker.product) {
deps += [
"$flutter_root/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
"vmservice:vmservice_snapshot",
# TODO(kaushikiska): Figure out how to get the profiler symbols for `libdart_precompiled_runtime`
# "//topaz/runtime/dart/profiler_symbols:libdart_precompiled_runtime",
observatory_target,
]
}
binary = "dart_aot${product_suffix}_runner"
meta_dir = "$flutter_root/shell/platform/fuchsia/dart_runner/meta"
meta = [
{
path = rebase_path("meta/dart_aot${product_suffix}_runner.cmx")
dest = "dart_aot${product_suffix}_runner.cmx"
},
]
resources = []
if (!invoker.product) {
vmservice_data = rebase_path(
get_label_info("vmservice:vmservice_snapshot", "target_gen_dir") +
"/vmservice_data.aotsnapshot")
vmservice_instr = rebase_path(
get_label_info("vmservice:vmservice_snapshot", "target_gen_dir") +
"/vmservice_instructions.aotsnapshot")
dart_profiler_symbols = rebase_path(
get_label_info(
"$flutter_root/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
"target_gen_dir") + "/dart_aot_runner.dartprofilersymbols")
inputs = [
vmservice_data,
vmservice_instr,
observatory_archive_file,
dart_profiler_symbols,
]
resources += [
{
path = vmservice_data
dest = "vmservice_isolate_snapshot_data.bin"
},
{
path = vmservice_instr
dest = "vmservice_isolate_snapshot_instructions.bin"
},
{
path = rebase_path(observatory_archive_file)
dest = "observatory.tar"
},
{
path = dart_profiler_symbols
dest = "dart_aot_runner.dartprofilersymbols"
},
]
}
}
}
template("jit_runner_package") {
assert(defined(invoker.product), "The parameter 'product' must be defined")
product_suffix = ""
......@@ -135,7 +209,10 @@ template("jit_runner_package") {
]
if (!invoker.product) {
deps += [ observatory_target ]
deps += [
"$flutter_root/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner",
observatory_target,
]
}
binary = "dart_jit${product_suffix}_runner"
......@@ -173,6 +250,13 @@ template("jit_runner_package") {
path = rebase_path(observatory_archive_file)
dest = "observatory.tar"
},
{
path = rebase_path(
get_label_info(
"$flutter_root/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner",
"target_gen_dir") + "/dart_jit_runner.dartprofilersymbols")
dest = "dart_jit_runner.dartprofilersymbols"
},
]
}
......@@ -185,6 +269,14 @@ template("jit_runner_package") {
}
}
aot_runner_package("dart_aot_runner") {
product = false
}
aot_runner_package("dart_aot_product_runner") {
product = true
}
jit_runner_package("dart_jit_runner") {
product = false
}
......
......@@ -27,6 +27,10 @@ template("aot_snapshot") {
compiled_action(target_name) {
kernel_name = target_name
if (defined(invoker.kernel_name)) {
kernel_name = invoker.kernel_name
}
product = defined(invoker.product) && invoker.product
product_suffix = ""
......@@ -89,6 +93,7 @@ template("aot_snapshot") {
}
}
aot_snapshot("vmservice") {
aot_snapshot("vmservice_snapshot") {
kernel_name = "vmservice"
product = false
}
......@@ -43,6 +43,13 @@ generate_dart_profiler_symbols("dart_jit_runner") {
output = "${target_gen_dir}/dart_jit_runner.dartprofilersymbols"
}
generate_dart_profiler_symbols("dart_aot_runner") {
library_label =
"$flutter_root/shell/platform/fuchsia/dart_runner:dart_aot_runner_bin"
library_path = "${root_out_dir}/exe.unstripped/dart_aot_runner"
output = "${target_gen_dir}/dart_aot_runner.dartprofilersymbols"
}
generate_dart_profiler_symbols("flutter_jit_runner") {
library_label = "$flutter_root/shell/platform/fuchsia/flutter:jit"
library_path = "${root_out_dir}/exe.unstripped/flutter_jit_runner"
......
......@@ -52,8 +52,8 @@ def RunExecutable(command):
def RunGN(variant_dir, flags):
print('Running gn for variant "%s" with flags: %s' % (variant_dir,
','.join(flags)))
print('Running gn for variant "%s" with flags: %s' %
(variant_dir, ','.join(flags)))
RunExecutable([
os.path.join('flutter', 'tools', 'gn'),
] + flags)
......@@ -137,6 +137,7 @@ 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')
def BuildBucket(runtime_mode, arch, product):
......@@ -189,6 +190,7 @@ def GetTargetsToBuild(product=False):
GetRunnerTarget('flutter', product, True),
# The Dart Runner.
GetRunnerTarget('dart_runner', product, False),
GetRunnerTarget('dart_runner', product, True),
'%s/dart:kernel_compiler' % _fuchsia_base,
]
return targets_to_build
......@@ -234,10 +236,7 @@ def main():
default='all')
parser.add_argument(
'--archs',
type=str,
choices=['x64', 'arm64', 'all'],
default='all')
'--archs', type=str, choices=['x64', 'arm64', 'all'], default='all')
parser.add_argument(
'--no-lto',
......@@ -246,10 +245,10 @@ def main():
help='If set, disables LTO for the build.')
parser.add_argument(
'--skip-build',
action='store_true',
default=False,
help='If set, skips building and just creates packages.')
'--skip-build',
action='store_true',
default=False,
help='If set, skips building and just creates packages.')
args = parser.parse_args()
RemoveDirectoryIfExists(_bucket_directory)
......
......@@ -87,6 +87,10 @@ template("fuchsia_archive") {
script = "$flutter_root/tools/fuchsia/gen_package.py"
deps = pkg_dir_deps + [ ":${target_name}_dir" ]
sources = copy_outputs
inputs = []
if (defined(invoker.inputs)) {
inputs = invoker.inputs
}
args = [
"--pm-bin",
rebase_path("//fuchsia/sdk/$host_os/tools/pm"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册