Commit 7eb0506f authored by Chong Gu's avatar Chong Gu Committed by Commit Bot

[Fuchsia] Conditionally include emulators and host tools in target.

Determine which host tools should be added to the isolates through new gn arg test_host_cpu
Determine whether emulator related files are needed through new gn arg test_isolate_uses_emulator

Bug: 1080854
Change-Id: I5d283a858717162160211f6084a7b4ca167e1215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463846Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Commit-Queue: Chong Gu <chonggu@google.com>
Auto-Submit: Chong Gu <chonggu@google.com>
Cr-Commit-Position: refs/heads/master@{#817239}
parent 81bb4681
...@@ -38,6 +38,7 @@ gclient_gn_args = [ ...@@ -38,6 +38,7 @@ gclient_gn_args = [
'checkout_android', 'checkout_android',
'checkout_android_prebuilts_build_tools', 'checkout_android_prebuilts_build_tools',
'checkout_android_native_support', 'checkout_android_native_support',
'checkout_fuchsia_for_arm64_host',
'checkout_google_benchmark', 'checkout_google_benchmark',
'checkout_ios_webkit', 'checkout_ios_webkit',
'checkout_nacl', 'checkout_nacl',
......
...@@ -4,10 +4,8 @@ ...@@ -4,10 +4,8 @@
assert(is_fuchsia) assert(is_fuchsia)
# Compute the emulator paths. # Compute the AEMU path.
aemu_root = "//third_party/aemu-${host_os}-${host_cpu}" aemu_root = "//third_party/aemu-${host_os}-${host_cpu}"
qemu_root = "//third_party/qemu-${host_os}-${host_cpu}"
qemu_arm64_root = "//third_party/qemu-${host_os}-arm64"
# Compute the path to the arch-specific boot image directory. # Compute the path to the arch-specific boot image directory.
boot_image_root = "//third_party/fuchsia-sdk/images/${target_cpu}" boot_image_root = "//third_party/fuchsia-sdk/images/${target_cpu}"
...@@ -17,12 +17,13 @@ declare_args() { ...@@ -17,12 +17,13 @@ declare_args() {
# will be used. # will be used.
default_fuchsia_build_dir_for_installation = "" default_fuchsia_build_dir_for_installation = ""
# Architecture of the host tools included in Fuchsia test targets. # CPU architecture of the host used to run the tests.
# Defaults to target_cpu. test_host_cpu = host_cpu
fuchsia_override_host_tool_arch_for_isolated_testing = target_cpu
# A list that contains additional Fuchsia boot images to include in the test # Sets whether emulators need to be included in the test isolates
# targets. test_isolate_uses_emulator = true
# A list of additional Fuchsia boot images to include in the test isolates.
fuchsia_additional_boot_images = [] fuchsia_additional_boot_images = []
} }
...@@ -101,31 +102,40 @@ template("fuchsia_package_runner") { ...@@ -101,31 +102,40 @@ template("fuchsia_package_runner") {
"//third_party/fuchsia-sdk/sdk/bin/fpave.sh", "//third_party/fuchsia-sdk/sdk/bin/fpave.sh",
"//third_party/fuchsia-sdk/sdk/bin/fuchsia-common.sh", "//third_party/fuchsia-sdk/sdk/bin/fuchsia-common.sh",
"//third_party/fuchsia-sdk/sdk/meta/manifest.json", "//third_party/fuchsia-sdk/sdk/meta/manifest.json",
"${boot_image_root}/qemu/qemu-kernel.kernel",
"${boot_image_root}/qemu/storage-full.blk",
"${boot_image_root}/qemu/zircon-a.zbi",
] ]
if (host_cpu == "x64" && (host_os == "linux" || host_os == "mac")) { # TODO(crbug.com/1137662): Remove checkout_fuchsia_for_arm64_host from
data += [ "${aemu_root}/" ] # gclient_gn_args in //DEPS as well as this condition when builders have
# test_host_cpu set correctly.
if (checkout_fuchsia_for_arm64_host) {
test_host_cpu = "arm64"
}
if (test_host_cpu == "x64") {
data += [ "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer" ]
} }
data += [ data += [
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/device-finder", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/device-finder",
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/fvm", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/fvm",
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/merkleroot", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/merkleroot",
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/pm", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/pm",
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/symbolize", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/symbolize",
"//third_party/fuchsia-sdk/sdk/tools/${fuchsia_override_host_tool_arch_for_isolated_testing}/zbi", "//third_party/fuchsia-sdk/sdk/tools/${test_host_cpu}/zbi",
] ]
if (target_cpu == "arm64") { if (test_isolate_uses_emulator) {
data += [ "${qemu_arm64_root}/" ]
} else {
data += [ data += [
"${qemu_root}/", "${boot_image_root}/qemu/qemu-kernel.kernel",
"//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer", "${boot_image_root}/qemu/storage-full.blk",
"${boot_image_root}/qemu/zircon-a.zbi",
"//third_party/qemu-${host_os}-${test_host_cpu}/",
] ]
# Include AEMU for x64 emulator hosts.
if (test_host_cpu == "x64") {
data += [ "${aemu_root}/" ]
}
} }
foreach(fuchsia_additional_boot_image, fuchsia_additional_boot_images) { foreach(fuchsia_additional_boot_image, fuchsia_additional_boot_images) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment