Reland fuchsia build improvements (flutter/engine#12795)

This commit is contained in:
Dan Field
2019-10-04 12:07:57 -07:00
committed by GitHub
parent 02a9d61d47
commit 4d0ea3a6f0
6 changed files with 46 additions and 33 deletions

View File

@@ -84,7 +84,6 @@ task:
cd $ENGINE_PATH/src cd $ENGINE_PATH/src
./flutter/tools/fuchsia/build_fuchsia_artifacts.py --engine-version HEAD --runtime-mode debug --no-lto --archs x64 ./flutter/tools/fuchsia/build_fuchsia_artifacts.py --engine-version HEAD --runtime-mode debug --no-lto --archs x64
cd $ENGINE_PATH/src/flutter cd $ENGINE_PATH/src/flutter
./ci/build_flutter_runner_tests.sh
# WINDOWS # WINDOWS
task: task:

View File

@@ -1,17 +0,0 @@
#!/bin/bash
set -ex
PATH="$HOME/depot_tools:$PATH"
cd ..
# Build the flutter runner tests far directory
flutter/tools/gn --fuchsia --no-lto --runtime-mode debug
ninja -C out/fuchsia_debug_x64 flutter/shell/platform/fuchsia/flutter:flutter_runner_tests
# Generate the far package
flutter/tools/fuchsia/gen_package.py\
--pm-bin $PWD/fuchsia/sdk/linux/tools/pm\
--package-dir $PWD/out/fuchsia_debug_x64/flutter_runner_tests_far\
--signing-key $PWD/flutter/tools/fuchsia/development.key\
--far-name flutter_runner_tests

View File

@@ -6,20 +6,23 @@ import("//build/fuchsia/sdk.gni")
import("$flutter_root/common/config.gni") import("$flutter_root/common/config.gni")
if (using_fuchsia_sdk) { if (using_fuchsia_sdk) {
testonly = true
product_suffix = "" product_suffix = ""
if (flutter_runtime_mode == "release") { if (flutter_runtime_mode == "release") {
product_suffix = "product_" product_suffix = "product_"
} }
flutter_runner_target = "flutter_jit_${product_suffix}runner"
dart_runner_target = "dart_jit_${product_suffix}runner" dart_runner_target = "dart_jit_${product_suffix}runner"
group("fuchsia") { group("fuchsia") {
deps = [ deps = [
"dart:kernel_compiler", "dart:kernel_compiler",
"dart_runner:$dart_runner_target", "dart_runner:$dart_runner_target",
"flutter:$flutter_runner_target", "flutter:flutter_aot_${product_suffix}runner",
"flutter:flutter_jit_${product_suffix}runner",
"flutter:flutter_runner_tests",
] ]
} }
} }

View File

@@ -8,7 +8,7 @@ import("//build/fuchsia/sdk.gni")
import("$flutter_root/common/fuchsia_config.gni") import("$flutter_root/common/fuchsia_config.gni")
import("$flutter_root/tools/fuchsia/common_libs.gni") import("$flutter_root/tools/fuchsia/common_libs.gni")
import("$flutter_root/tools/fuchsia/dart.gni") import("$flutter_root/tools/fuchsia/dart.gni")
import("$flutter_root/tools/fuchsia/package_dir.gni") import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
template("runner") { template("runner") {
assert(defined(invoker.product), "The parameter 'product' must be defined") assert(defined(invoker.product), "The parameter 'product' must be defined")
@@ -100,7 +100,7 @@ template("jit_runner_package") {
product_suffix = "_product" product_suffix = "_product"
} }
package_dir(target_name) { fuchsia_archive(target_name) {
deps = [ deps = [
":dart_jit${product_suffix}_runner_bin", ":dart_jit${product_suffix}_runner_bin",
"kernel:kernel_core_snapshot${product_suffix}", "kernel:kernel_core_snapshot${product_suffix}",

View File

@@ -9,7 +9,7 @@ import("$flutter_root/common/config.gni")
import("$flutter_root/shell/gpu/gpu.gni") import("$flutter_root/shell/gpu/gpu.gni")
import("$flutter_root/tools/fuchsia/common_libs.gni") import("$flutter_root/tools/fuchsia/common_libs.gni")
import("$flutter_root/tools/fuchsia/dart.gni") import("$flutter_root/tools/fuchsia/dart.gni")
import("$flutter_root/tools/fuchsia/package_dir.gni") import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
import("engine_flutter_runner.gni") import("engine_flutter_runner.gni")
shell_gpu_configuration("fuchsia_gpu_configuration") { shell_gpu_configuration("fuchsia_gpu_configuration") {
@@ -89,7 +89,7 @@ template("jit_runner") {
product_suffix = "_product" product_suffix = "_product"
} }
package_dir(target_name) { fuchsia_archive(target_name) {
snapshot_label = "kernel:kernel_core_snapshot${product_suffix}" snapshot_label = "kernel:kernel_core_snapshot${product_suffix}"
snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir") snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir")
@@ -174,7 +174,7 @@ template("aot_runner") {
product_suffix = "_product" product_suffix = "_product"
} }
package_dir(target_name) { fuchsia_archive(target_name) {
deps = [ deps = [
":aot${product_suffix}", ":aot${product_suffix}",
] ]
@@ -258,7 +258,7 @@ executable("flutter_runner_unittests") {
] ]
} }
package_dir("flutter_runner_tests") { fuchsia_archive("flutter_runner_tests") {
testonly = true testonly = true
deps = [ deps = [
@@ -273,7 +273,7 @@ package_dir("flutter_runner_tests") {
meta = [ meta = [
{ {
path = "meta/$target_name.cmx" path = rebase_path("meta/$target_name.cmx")
dest = "$target_name.cmx" dest = "$target_name.cmx"
}, },
] ]

View File

@@ -2,10 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# Creates a package dir that we will them use pm to package. # Creates a Fuchsia archive (.far) file using PM from the Fuchsia SDK.
# template("fuchsia_archive") {
# This currently ignores the CMX files and does minimal validation.
template("package_dir") {
assert(defined(invoker.binary), "package must define binary") assert(defined(invoker.binary), "package must define binary")
assert(defined(invoker.meta_dir), "package must define meta_dir") assert(defined(invoker.meta_dir), "package must define meta_dir")
@@ -67,12 +65,42 @@ template("package_dir") {
] ]
} }
action(target_name) { write_file("${far_base_dir}/meta/package",
{
name = pkg.package_name
version = pkg.package_version
},
"json")
pkg_dir_deps = pkg.deps + [ ":$cmx_target" ]
action("${target_name}_dir") {
script = "$flutter_root/tools/fuchsia/copy_path.py" script = "$flutter_root/tools/fuchsia/copy_path.py"
response_file_contents = rebase_path(copy_sources + copy_outputs) response_file_contents = rebase_path(copy_sources + copy_outputs)
deps = pkg.deps + [ ":$cmx_target" ] deps = pkg_dir_deps
args = [ "--file-list={{response_file_name}}" ] args = [ "--file-list={{response_file_name}}" ]
outputs = copy_outputs outputs = copy_outputs
testonly = pkg_testonly testonly = pkg_testonly
} }
action(target_name) {
script = "$flutter_root/tools/fuchsia/gen_package.py"
deps = pkg_dir_deps + [ ":${target_name}_dir" ]
sources = copy_outputs
args = [
"--pm-bin",
rebase_path("//fuchsia/sdk/$host_os/tools/pm"),
"--package-dir",
rebase_path(far_base_dir),
"--signing-key",
rebase_path("//flutter/tools/fuchsia/development.key"),
"--far-name",
target_name,
]
outputs = [
"${far_base_dir}.manifest",
"$root_out_dir/${target_name}.far",
]
testonly = pkg_testonly
}
} }