Skip to content

Commit

Permalink
Revert "Reland chromium#2: Android: Use locally-build devil deps only…
Browse files Browse the repository at this point in the history
… when build_with_chromium=true"

This reverts commit 8e2b321.

Reason for revert: Breaks angle_unittests on emulator

Original change's description:
> Reland chromium#2: Android: Use locally-build devil deps only when build_with_chromium=true
>
> This reverts commit 85773e5.
>
> Reason for reland:
>  * Fixed data deps
>  * _BuildWithChromium() handles missing key
>
> Original change's description:
> > Revert "Reland "Android: Use locally-build devil deps only when build_with_chromium=true""
> >
> > This reverts commit f8b7ec2.
> >
> > Reason for revert: Causing all builds to fail on android-pixel2-perf failing
> >
> > Original change's description:
> > > Reland "Android: Use locally-build devil deps only when build_with_chromium=true"
> > >
> > > This reverts commit b47e9c8.
> > >
> > > Reason for reland: Updated more .pydeps files.
> > >
> > > Original change's description:
> > > > Revert "Android: Use locally-build devil deps only when build_with_chromium=true"
> > > >
> > > > This reverts commit 49fdeca.
> > > >
> > > > Reason for revert: Breaking presubmit due to stale .pydeps file:
> > > > android_webview/tools/run_cts.pydeps
> > > >
> > > > Original change's description:
> > > > > Android: Use locally-build devil deps only when build_with_chromium=true
> > > > >
> > > > > Bug: 1120190
> > > > > Change-Id: I763e42a7ae69d14eb61caebd220844b756d6d171
> > > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480842
> > > > > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > > > > Reviewed-by: Ben Pastene <bpastene@chromium.org>
> > > > > Cr-Commit-Position: refs/heads/master@{#819489}
> > > >
> > > > TBR=agrieve@chromium.org,bpastene@chromium.org
> > > >
> > > > Change-Id: I960ad355283c66951e5931f61e25421c5a5dfdf7
> > > > No-Presubmit: true
> > > > No-Tree-Checks: true
> > > > No-Try: true
> > > > Bug: 1120190
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490857
> > > > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > > > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > > > Cr-Commit-Position: refs/heads/master@{#819668}
> > >
> > > TBR=agrieve # reland
> > >
> > > Bug: 1120190
> > > Change-Id: I8f3e21182e83a3e88da52331d56a8bef76507939
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490558
> > > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#819810}
> >
> > TBR=agrieve@chromium.org,bpastene@chromium.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: 1120190, 1141891
> > Change-Id: I490f2e8a972b260a81b942e248c0f920af11db46
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495335
> > Reviewed-by: John Chen <johnchen@chromium.org>
> > Commit-Queue: John Chen <johnchen@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#820355}
>
> Bug: 1120190
> Bug: 1141891
> Change-Id: Ic7a398fcd8cb5f45a03c20acbd4e9c7300442f38
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2497153
> Reviewed-by: Ben Pastene <bpastene@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#823651}

TBR=agrieve@chromium.org,bpastene@chromium.org

Change-Id: Ia586b0d8f68795e493074ba6b00ac36c529eb1ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1120190
Bug: 1145570
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519425
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824002}
  • Loading branch information
agrieve authored and Commit Bot committed Nov 4, 2020
1 parent a04f522 commit 6134a13
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 219 deletions.
4 changes: 0 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1254,11 +1254,7 @@ if (!is_ios) {
root_build_dir) + ")" ]

data = [
# These tests use //build/android/devil_chromium.py even when !is_android,
# so cannot use the helpers in //build/android (they assert(is_android)).
"//build/android/",
"//build/gn_helpers.py",
"//build/config/gclient_args.gni",
"//components/crash/content/tools/generate_breakpad_symbols.py",
"//third_party/blink/renderer/bindings/scripts/",
"//third_party/blink/renderer/build/scripts/",
Expand Down
1 change: 0 additions & 1 deletion PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,6 @@
'android_webview/tools/run_cts.pydeps',
'base/android/jni_generator/jni_generator.pydeps',
'base/android/jni_generator/jni_registration_generator.pydeps',
'build/android/apk_operations.pydeps',
'build/android/devil_chromium.pydeps',
'build/android/gyp/aar.pydeps',
'build/android/gyp/aidl.pydeps',
Expand Down
1 change: 1 addition & 0 deletions android_webview/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ python_library("webview_cts_tests") {
pydeps_file = "//android_webview/tools/run_cts.pydeps"
deps = [ "//android_webview:system_webview_apk" ]
data_deps = [
"//build/android:logdog_wrapper_py",
"//build/android:test_runner_py",
"//testing/buildbot/filters:webview_cts_tests_filters",
]
Expand Down
1 change: 0 additions & 1 deletion android_webview/tools/run_cts.pydeps
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
//build/android/pylib/local/emulator/proto/avd_pb2.py
//build/android/pylib/utils/__init__.py
//build/android/pylib/utils/test_filter.py
//build/gn_helpers.py
//third_party/catapult/common/py_utils/py_utils/__init__.py
//third_party/catapult/common/py_utils/py_utils/cloud_storage.py
//third_party/catapult/common/py_utils/py_utils/cloud_storage_global_lock.py
Expand Down
53 changes: 16 additions & 37 deletions build/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,9 @@ python_library("devil_chromium_py") {
"devil_chromium.json",
"//third_party/catapult/third_party/gsutil/",
"//third_party/catapult/devil/devil/devil_dependencies.json",

# Read by gn_helpers.BuildWithChromium()
"//build/config/gclient_args.gni",
]
}

# Contains runtime deps for installing apks.
# E.g. from test_runner.py or from apk_operations.py.
group("apk_installer_data") {
# Other //build users let devil library fetch these from Google Storage.
if (build_with_chromium) {
data_deps = [
"//build/android/pylib/device/commands",
"//tools/android/md5sum",
]
data = [
"//third_party/android_build_tools/bundletool/bundletool-all-1.2.0.jar",
]
}
}

python_library("apk_operations_py") {
pydeps_file = "apk_operations.pydeps"
deps = [ ":apk_installer_data" ]
}

python_library("test_runner_py") {
testonly = true
pydeps_file = "test_runner.pydeps"
Expand All @@ -92,17 +69,14 @@ python_library("test_runner_py") {
"${android_sdk_root}/platform-tools/adb",
"//third_party/requests/",
]
data_deps = [
":apk_installer_data",
":devil_chromium_py",
":logdog_wrapper_py",
":stack_tools",
]

# Other //build users let devil library fetch these from Google Storage.
data_deps = [ ":devil_chromium_py" ]
if (build_with_chromium) {
data_deps += [ "//tools/android/forwarder2" ]
data += [ "//tools/android/avd/proto/" ]
data += [
"//third_party/android_build_tools/bundletool/bundletool-all-1.2.0.jar",
"//tools/android/avd/proto/",
]
data_deps +=
[ "//third_party/android_platform/development/scripts:stack_py" ]
if (is_asan) {
data_deps += [ "//tools/android/asan/third_party:asan_device_setup" ]
}
Expand Down Expand Up @@ -130,14 +104,19 @@ python_library("resource_sizes_py") {
]
}

python_library("bundle_wrapper_script_py") {
pydeps_file = "gyp/create_bundle_wrapper_script.pydeps"
data = [
"//third_party/android_build_tools/bundletool/bundletool-all-1.2.0.jar",
]
}

# Tools necessary for symbolizing tombstones or stack traces that are output to
# logcat.
# Hidden behind build_with_chromium because some third party repos that use
# //build don't pull in //third_party/android_platform.
# TODO(crbug.com/1120190): Move stack script into //build/third_party
# and enable unconditionally.
group("stack_tools") {
if (build_with_chromium) {
if (build_with_chromium) {
group("stack_tools") {
data = [
"tombstones.py",
"pylib/symbols/",
Expand Down
110 changes: 0 additions & 110 deletions build/android/apk_operations.pydeps

This file was deleted.

65 changes: 18 additions & 47 deletions build/android/devil_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,14 @@
import os
import sys

from pylib import constants
from pylib.constants import host_paths

if host_paths.DEVIL_PATH not in sys.path:
sys.path.insert(1, host_paths.DEVIL_PATH)
sys.path.append(host_paths.DEVIL_PATH)

from devil import devil_env
from devil.android.ndk import abis

_BUILD_DIR = os.path.join(constants.DIR_SOURCE_ROOT, 'build')
if _BUILD_DIR not in sys.path:
sys.path.insert(1, _BUILD_DIR)

import gn_helpers

_DEVIL_CONFIG = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'devil_chromium.json'))

Expand Down Expand Up @@ -114,35 +107,6 @@
}


def _UseLocalBuildProducts(output_directory, devil_dynamic_config):
output_directory = os.path.abspath(output_directory)
devil_dynamic_config['dependencies'] = {
dep_name: {
'file_info': {
'%s_%s' % (dep_config['platform'], dep_config['arch']): {
'local_paths': [
os.path.join(output_directory,
*dep_config['path_components']),
],
}
for dep_config in dep_configs
}
}
for dep_name, dep_configs in _DEVIL_BUILD_PRODUCT_DEPS.iteritems()
}


def _BuildWithChromium():
"""Returns value of gclient's |build_with_chromium|."""
gni_path = os.path.join(_BUILD_DIR, 'config', 'gclient_args.gni')
if not os.path.exists(gni_path):
return False
with open(gni_path) as f:
data = f.read()
args = gn_helpers.FromGNArgs(data)
return args.get('build_with_chromium', False)


def Initialize(output_directory=None, custom_deps=None, adb_path=None):
"""Initializes devil with chromium's binaries and third-party libraries.
Expand Down Expand Up @@ -170,18 +134,26 @@ def Initialize(output_directory=None, custom_deps=None, adb_path=None):
adb_path: An optional path to use for the adb binary. If not set, this uses
the adb binary provided by the Android SDK.
"""
build_with_chromium = _BuildWithChromium()

devil_dynamic_config = {
'config_type': 'BaseConfig',
'dependencies': {},
}
if build_with_chromium and output_directory:
# Non-chromium users of chromium's //build directory fetch build products
# from google storage rather than use locally built copies. Chromium uses
# locally-built copies so that changes to the tools can be easily tested.
_UseLocalBuildProducts(output_directory, devil_dynamic_config)

if output_directory:
output_directory = os.path.abspath(output_directory)
devil_dynamic_config['dependencies'] = {
dep_name: {
'file_info': {
'%s_%s' % (dep_config['platform'], dep_config['arch']): {
'local_paths': [
os.path.join(output_directory, *dep_config['path_components']),
],
}
for dep_config in dep_configs
}
}
for dep_name, dep_configs in _DEVIL_BUILD_PRODUCT_DEPS.iteritems()
}
if custom_deps:
devil_dynamic_config['dependencies'].update(custom_deps)
if adb_path:
Expand All @@ -195,6 +167,5 @@ def Initialize(output_directory=None, custom_deps=None, adb_path=None):
}
})

config_files = [_DEVIL_CONFIG] if build_with_chromium else None
devil_env.config.Initialize(configs=[devil_dynamic_config],
config_files=config_files)
devil_env.config.Initialize(
configs=[devil_dynamic_config], config_files=[_DEVIL_CONFIG])
1 change: 0 additions & 1 deletion build/android/devil_chromium.pydeps
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
../../third_party/catapult/devil/devil/utils/timeout_retry.py
../../third_party/catapult/devil/devil/utils/watchdog_timer.py
../../third_party/catapult/third_party/zipfile/zipfile_2_7_13.py
../gn_helpers.py
devil_chromium.py
pylib/__init__.py
pylib/constants/__init__.py
Expand Down
5 changes: 5 additions & 0 deletions build/android/gyp/create_bundle_wrapper_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
import string
import sys

# Import apk_operations even though this script doesn't use it so that
# targets that depend on the wrapper scripts will rebuild when apk_operations
# or its deps change.
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir))
import apk_operations # pylint: disable=unused-import
from util import build_utils

SCRIPT_TEMPLATE = string.Template("""\
Expand Down
Loading

0 comments on commit 6134a13

Please sign in to comment.