Commit 072cfd65 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Simplify Simple Chrome's gclient and GN conditionals.

Now uses the new gclient var 'cros_boards_with_qemu_images' for DEPS
hooks as well as for building the data_deps for CrOS tests in GN.

Bug: 937821
Change-Id: Ifdd05f09a4200328a06028be86aeb22c8486c65c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285361Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786312}
parent be60d733
...@@ -159,12 +159,8 @@ vars = { ...@@ -159,12 +159,8 @@ vars = {
'cros_boards': Str(''), 'cros_boards': Str(''),
'cros_boards_with_qemu_images': Str(''), 'cros_boards_with_qemu_images': Str(''),
# Building for CrOS is only supported on linux currently. # Building for CrOS is only supported on linux currently.
'checkout_simplechrome': '(checkout_chromeos and host_os == "linux") and ("{cros_boards}" != "")', 'checkout_simplechrome': '"{cros_boards}" != ""',
# Surround the board var in quotes so gclient doesn't try parsing the string 'checkout_simplechrome_with_vms': '"{cros_boards_with_qemu_images}" != ""',
# as an expression.
# TODO(crbug.com/937821): Replace uses of this var with
# 'cros_boards_with_qemu_images' above.
'cros_download_vm': '(("{cros_boards}" == "amd64-generic") or ("{cros_boards}" == "betty")) or ("{cros_boards}" == "betty-pi-arc")',
# Should we build and test for public (ie: full) CrOS images, or private # Should we build and test for public (ie: full) CrOS images, or private
# (ie: release) images. # (ie: release) images.
'use_public_cros_config': 'not checkout_src_internal', 'use_public_cros_config': 'not checkout_src_internal',
...@@ -4830,7 +4826,7 @@ hooks = [ ...@@ -4830,7 +4826,7 @@ hooks = [
{ {
'name': 'cros_simplechrome_artifacts_with_vm', 'name': 'cros_simplechrome_artifacts_with_vm',
'pattern': '.', 'pattern': '.',
'condition': '(checkout_simplechrome and cros_download_vm) and use_public_cros_config', 'condition': 'checkout_simplechrome_with_vms and use_public_cros_config',
'action': [ 'action': [
'src/third_party/chromite/bin/cros', 'src/third_party/chromite/bin/cros',
'chrome-sdk', 'chrome-sdk',
...@@ -4839,7 +4835,7 @@ hooks = [ ...@@ -4839,7 +4835,7 @@ hooks = [
'--fallback-versions=10', '--fallback-versions=10',
'--nogn-gen', '--nogn-gen',
'--download-vm', '--download-vm',
'--boards={cros_boards}', '--boards={cros_boards_with_qemu_images}',
'--cache-dir=src/build/cros_cache/', '--cache-dir=src/build/cros_cache/',
'--log-level=error', '--log-level=error',
'--no-shell', '--no-shell',
...@@ -4848,7 +4844,7 @@ hooks = [ ...@@ -4848,7 +4844,7 @@ hooks = [
{ {
'name': 'cros_simplechrome_artifacts_with_no_vm', 'name': 'cros_simplechrome_artifacts_with_no_vm',
'pattern': '.', 'pattern': '.',
'condition': '(checkout_simplechrome and not cros_download_vm) and use_public_cros_config', 'condition': 'checkout_simplechrome and use_public_cros_config',
'action': [ 'action': [
'src/third_party/chromite/bin/cros', 'src/third_party/chromite/bin/cros',
'chrome-sdk', 'chrome-sdk',
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import("//build/config/chrome_build.gni") import("//build/config/chrome_build.gni")
import("//build/config/chromeos/args.gni") import("//build/config/chromeos/args.gni")
import("//build/config/gclient_args.gni")
assert(is_chromeos) assert(is_chromeos)
...@@ -15,15 +16,11 @@ if (is_chromeos_device && cros_sdk_version != "") { ...@@ -15,15 +16,11 @@ if (is_chromeos_device && cros_sdk_version != "") {
_cache_path_prefix = _cache_path_prefix =
"//build/cros_cache/chrome-sdk/symlinks/${cros_board}+${cros_sdk_version}" "//build/cros_cache/chrome-sdk/symlinks/${cros_board}+${cros_sdk_version}"
# It's difficult to determine if any given board supports QEMU images. So foreach(b, string_split(cros_boards_with_qemu_images, ":")) {
# check if there's one present in the expected location. if (cros_board == b) {
_qemu_image_path = "${_cache_path_prefix}+chromiumos_qemu_image.tar.xz" cros_is_vm = true
}
# TODO(crbug.com/937821): Check for the board in a gclient list var to }
# determine if we expect a VM image.
cros_is_vm = exec_script("//build/dir_exists.py",
[ rebase_path(_qemu_image_path) ],
"string") == "True"
_symlinks = [ _symlinks = [
# Tast harness & test data. # Tast harness & test data.
...@@ -39,7 +36,7 @@ if (is_chromeos_device && cros_sdk_version != "") { ...@@ -39,7 +36,7 @@ if (is_chromeos_device && cros_sdk_version != "") {
# VM-related tools. # VM-related tools.
_symlinks += [ _symlinks += [
rebase_path("${_cache_path_prefix}+sys-firmware/seabios"), rebase_path("${_cache_path_prefix}+sys-firmware/seabios"),
rebase_path(_qemu_image_path), rebase_path("${_cache_path_prefix}+chromiumos_qemu_image.tar.xz"),
rebase_path("${_cache_path_prefix}+app-emulation/qemu"), rebase_path("${_cache_path_prefix}+app-emulation/qemu"),
] ]
} }
......
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