Commit 719ed707 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Revert "chromeos: Add only the current SDK version's items to a test's data."

This reverts commit 3a8d37c3.

Reason for revert: blocking uprevs; crbug.com/1087179

Original change's description:
> chromeos: Add only the current SDK version's items to a test's data.
> 
> Instead of adding every version of a given item, this will add only the
> current version's. This is a bit tricky since individual versions of an
> item are keyed by symlink. And since isolate doesn't follow symlinks,
> we have to follow them ourselves.
> 
> Bug: 1027382
> Change-Id: I6b3ea4ec15de3804e99fd6af768daac64f490d5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931155
> Commit-Queue: Ben Pastene <bpastene@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#771959}

TBR=thakis@chromium.org,dpranke@chromium.org,bpastene@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1027382, 1087179
Change-Id: Ie097ba50d36d7eba3865d5cee1775afd5d605354
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219315Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772513}
parent 95d96281
......@@ -14,49 +14,6 @@ declare_args() {
cros_board == "betty-pi-arc"
}
# Determine the real paths for various items in the SDK, which may be used
# in the 'generate_runner_script' template below. We do so outside the template
# to confine exec_script to a single invocation.
if (is_chromeos_device) {
_cache_path_prefix =
"//build/cros_cache/chrome-sdk/symlinks/${cros_board}+${cros_sdk_version}"
_symlinks = [
# Tast harness & test data.
rebase_path("${_cache_path_prefix}+chromeos-base/tast-cmd"),
rebase_path("${_cache_path_prefix}+chromeos-base/tast-remote-tests-cros"),
# Binutils (and other toolchain tools) used to deploy Chrome to the device.
rebase_path(
"${_cache_path_prefix}+environment_chromeos-base_chromeos-chrome.tar.xz"),
rebase_path("${_cache_path_prefix}+target_toolchain"),
]
if (cros_is_vm) {
# VM-related tools.
_symlinks += [
rebase_path("${_cache_path_prefix}+sys-firmware/seabios"),
rebase_path("${_cache_path_prefix}+chromiumos_qemu_image.tar.xz"),
rebase_path("${_cache_path_prefix}+app-emulation/qemu"),
]
}
_symlink_targets =
exec_script("//build/get_symlink_targets.py", _symlinks, "list lines")
tast_sdk_items = [
_symlink_targets[0],
_symlink_targets[1],
]
toolchain_sdk_items = [
_symlink_targets[2],
_symlink_targets[3],
]
if (cros_is_vm) {
vm_sdk_items = [
_symlink_targets[4],
_symlink_targets[5],
_symlink_targets[6],
]
}
}
# Creates a script at $generated_script that can be used to launch a cros VM
# and optionally run a test within it.
# Args:
......@@ -87,6 +44,12 @@ template("generate_runner_script") {
deploy_chrome = false
}
# These are the only 2 conditions when ${_cache_path_prefix} is used, so
# initialize it in a conditional.
if (deploy_chrome || cros_is_vm) {
_cache_path_prefix = "//build/cros_cache/chrome-sdk/tarballs/"
}
assert(defined(generated_script),
"Must specify where to place generated test launcher script via " +
"'generated_script'")
......@@ -129,10 +92,21 @@ template("generate_runner_script") {
# Add the VM/QEMU-launching bits if needed.
if (cros_is_vm) {
data += vm_sdk_items
assert(defined(_cache_path_prefix))
_vm_image_path = "${_cache_path_prefix}/chromiumos_qemu_image.tar.xz/"
_qemu_dir = "${_cache_path_prefix}/app-emulation/"
_firmware_dir = "${_cache_path_prefix}/sys-firmware/"
data += [
_firmware_dir,
_vm_image_path,
_qemu_dir,
]
}
if (is_tast) {
data += tast_sdk_items
data += [
"${_cache_path_prefix}/chromeos-base/tast-cmd/",
"${_cache_path_prefix}/chromeos-base/tast-remote-tests-cros/",
]
}
if (defined(invoker.data)) {
deps += invoker.data
......@@ -164,7 +138,11 @@ template("generate_runner_script") {
# To deploy chrome to the VM, it needs to be stripped down to fit into
# the VM. This is done by using binutils in the toolchain. So add the
# toolchain to the data.
data += toolchain_sdk_items
assert(defined(_cache_path_prefix))
data += [
"${_cache_path_prefix}/environment_chromeos-base_chromeos-chrome.tar.xz",
"${_cache_path_prefix}/target_toolchain/",
]
}
# When --test-exe is specified, test_runner.py will push the exe to the VM
......
......@@ -10,7 +10,6 @@ build_dotfile_settings = {
"//build/config/android/config.gni",
"//build/config/android/internal_rules.gni",
"//build/config/android/rules.gni",
"//build/config/chromeos/rules.gni",
"//build/config/compiler/BUILD.gn",
"//build/config/compiler/pgo/BUILD.gn",
"//build/config/gcc/gcc_version.gni",
......
#!/usr/bin/env python
# Copyright (c) 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the target paths of the given symlinks.
Prints out each target in the order that the links were passed in.
"""
import os
import sys
def main():
for link_name in sys.argv[1:]:
if not os.path.islink(link_name):
sys.stderr.write("%s is not a link" % link_name)
return 1
target = os.readlink(link_name)
if not os.path.isabs(target):
target = os.path.join(os.path.dirname(link_name), target)
print(os.path.realpath(target))
return 0
if __name__ == '__main__':
sys.exit(main())
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