Commit 8f372d5f authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Split the cros_boards gclient var into two for fetching QEMU images.

This will help with the TODO at:
https://source.chromium.org/chromium/chromium/src/+/master:build/config/chromeos/rules.gni;drc=ded9eb5153bb13b3f8821a6fa6fac6b3f0f590fd;l=22

It will also remove the need for hard-coding the names of all these
QEMU-compatible boards.

Bug: 937821
Change-Id: Iab180fc012bd694b4908ba0654da93d42e2274fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2265498
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#786005}
parent 4f474f6a
...@@ -43,6 +43,8 @@ gclient_gn_args = [ ...@@ -43,6 +43,8 @@ gclient_gn_args = [
'checkout_nacl', 'checkout_nacl',
'checkout_oculus_sdk', 'checkout_oculus_sdk',
'checkout_openxr', 'checkout_openxr',
'cros_boards',
'cros_boards_with_qemu_images',
'mac_xcode_version', 'mac_xcode_version',
] ]
...@@ -154,11 +156,14 @@ vars = { ...@@ -154,11 +156,14 @@ vars = {
# Default to the empty board. Desktop Chrome OS builds don't need cros SDK # Default to the empty board. Desktop Chrome OS builds don't need cros SDK
# dependencies. Other Chrome OS builds should always define this explicitly. # dependencies. Other Chrome OS builds should always define this explicitly.
'cros_boards': '', 'cros_boards': 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': '(checkout_chromeos and host_os == "linux") and ("{cros_boards}" != "")',
# Surround the board var in quotes so gclient doesn't try parsing the string # Surround the board var in quotes so gclient doesn't try parsing the string
# as an expression. # 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")', '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.
......
...@@ -3,9 +3,12 @@ This directory is used to store GN arg mapping for Chrome OS boards. ...@@ -3,9 +3,12 @@ This directory is used to store GN arg mapping for Chrome OS boards.
Files in this directory are populated by running `gclient sync` with specific Files in this directory are populated by running `gclient sync` with specific
arguments set in the .gclient file. Specifically: arguments set in the .gclient file. Specifically:
* The file must have a top-level variable set: `target_os = ["chromeos"]` * The file must have a top-level variable set: `target_os = ["chromeos"]`
* The `"custom_vars"` parameter of the chromium/src.git solution must include the * The `"custom_vars"` parameter of the chromium/src.git solution must include
parameter: `"cros_boards": "{BOARD_NAMES}"` where `{BOARD_NAMES}` is a the parameter: `"cros_boards": "{BOARD_NAMES}"` where `{BOARD_NAMES}` is a
colon-separated list of boards you'd like to checkout. colon-separated list of boards you'd like to checkout.
* If you'd like to a checkout a QEMU-bootable image for a given board, include
it in the `cros_boards_with_qemu_images` var rather than the `cros_boards`
var.
A typical .gclient file is a sibling of the src/ directory, and might look like A typical .gclient file is a sibling of the src/ directory, and might look like
this: this:
...@@ -18,7 +21,10 @@ solutions = [ ...@@ -18,7 +21,10 @@ solutions = [
"custom_deps": {}, "custom_deps": {},
"custom_vars" : { "custom_vars" : {
"checkout_src_internal": True, "checkout_src_internal": True,
"cros_boards": "eve", "cros_boards": "eve:kevin",
# If a QEMU-bootable image is desired for any board, move it from
# the previous var to the following:
"cros_boards_with_qemu_images": "amd64-generic",
}, },
}, },
] ]
......
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