Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions shell/platform/fuchsia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
83 changes: 82 additions & 1 deletion shell/platform/fuchsia/dart_runner/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,69 @@ 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) {
resources += [
{
path = rebase_path(get_label_info("vmservice:vmservice_snapshot",
"target_gen_dir") +
"/vmservice_data.aotsnapshot")
dest = "vmservice_isolate_snapshot_data.bin"
},
{
path = rebase_path(get_label_info("vmservice:vmservice_snapshot",
"target_gen_dir") +
"/vmservice_instructions.aotsnapshot")
dest = "vmservice_isolate_snapshot_instructions.bin"
},
{
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_aot_runner",
"target_gen_dir") + "/dart_aot_runner.dartprofilersymbols")
dest = "dart_aot_runner.dartprofilersymbols"
},
]
}
}
}

template("jit_runner_package") {
assert(defined(invoker.product), "The parameter 'product' must be defined")
product_suffix = ""
Expand All @@ -135,7 +198,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"
Expand Down Expand Up @@ -173,6 +239,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"
},
]
}

Expand All @@ -185,6 +258,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
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/fuchsia/dart_runner/vmservice/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ template("aot_snapshot") {
}
}

aot_snapshot("vmservice") {
aot_snapshot("vmservice_snapshot") {
product = false
}
7 changes: 7 additions & 0 deletions shell/platform/fuchsia/runtime/dart/profiler_symbols/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 9 additions & 10 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand All @@ -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)
Expand Down