mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
autoninja: Do not collect Reclient build metrics
We don't need to collect metrics from Reclient, anymore since most builds are done by Siso. Change-Id: I38fcb42aca966acc1b45a0876634cb9949bd255d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6733778 Auto-Submit: Junji Watanabe <jwata@google.com> Reviewed-by: Fumitoshi Ukai <ukai@google.com> Commit-Queue: Junji Watanabe <jwata@google.com> Commit-Queue: Fumitoshi Ukai <ukai@google.com>
This commit is contained in:
28
autoninja.py
28
autoninja.py
@@ -251,7 +251,7 @@ def _convert_ninja_j_to_siso_flags(j_value, use_remoteexec, args):
|
|||||||
return return_args
|
return return_args
|
||||||
|
|
||||||
|
|
||||||
def _main_inner(input_args, build_id, should_collect_logs=False):
|
def _main_inner(input_args, build_id):
|
||||||
# if user doesn't set PYTHONPYCACHEPREFIX and PYTHONDONTWRITEBYTECODE
|
# if user doesn't set PYTHONPYCACHEPREFIX and PYTHONDONTWRITEBYTECODE
|
||||||
# set PYTHONDONTWRITEBYTECODE=1 not to create many *.pyc in workspace
|
# set PYTHONDONTWRITEBYTECODE=1 not to create many *.pyc in workspace
|
||||||
# and keep workspace clean.
|
# and keep workspace clean.
|
||||||
@@ -465,16 +465,14 @@ def _main_inner(input_args, build_id, should_collect_logs=False):
|
|||||||
if use_reclient and not t_specified:
|
if use_reclient and not t_specified:
|
||||||
# TODO: crbug.com/379584977 - Remove siso/reclient
|
# TODO: crbug.com/379584977 - Remove siso/reclient
|
||||||
# integration.
|
# integration.
|
||||||
return reclient_helper.run_siso(
|
return reclient_helper.run_siso([
|
||||||
[
|
'siso',
|
||||||
'siso',
|
'ninja',
|
||||||
'ninja',
|
# Do not authenticate when using Reproxy.
|
||||||
# Do not authenticate when using Reproxy.
|
'-project=',
|
||||||
'-project=',
|
'-reapi_instance=',
|
||||||
'-reapi_instance=',
|
'-reapi_address=',
|
||||||
'-reapi_address=',
|
] + input_args[1:])
|
||||||
] + input_args[1:],
|
|
||||||
should_collect_logs)
|
|
||||||
return run_siso(["siso", "ninja"] + input_args[1:])
|
return run_siso(["siso", "ninja"] + input_args[1:])
|
||||||
return run_siso(["siso", "ninja", "--offline"] + input_args[1:])
|
return run_siso(["siso", "ninja", "--offline"] + input_args[1:])
|
||||||
|
|
||||||
@@ -572,7 +570,7 @@ def _main_inner(input_args, build_id, should_collect_logs=False):
|
|||||||
build_id, output_dir,
|
build_id, output_dir,
|
||||||
use_android_build_server=use_android_build_server):
|
use_android_build_server=use_android_build_server):
|
||||||
if use_reclient and not t_specified:
|
if use_reclient and not t_specified:
|
||||||
return reclient_helper.run_ninja(ninja_args, should_collect_logs)
|
return reclient_helper.run_ninja(ninja_args)
|
||||||
return ninja.main(ninja_args)
|
return ninja.main(ninja_args)
|
||||||
|
|
||||||
|
|
||||||
@@ -609,8 +607,6 @@ def main(args):
|
|||||||
build_id = str(uuid.uuid4())
|
build_id = str(uuid.uuid4())
|
||||||
os.environ.setdefault("AUTONINJA_BUILD_ID", build_id)
|
os.environ.setdefault("AUTONINJA_BUILD_ID", build_id)
|
||||||
|
|
||||||
# Check the log collection opt-in/opt-out status, and display notice if necessary.
|
|
||||||
should_collect_logs = build_telemetry.enabled()
|
|
||||||
# On Windows the autoninja.bat script passes along the arguments enclosed in
|
# On Windows the autoninja.bat script passes along the arguments enclosed in
|
||||||
# double quotes. This prevents multiple levels of parsing of the special '^'
|
# double quotes. This prevents multiple levels of parsing of the special '^'
|
||||||
# characters needed when compiling a single file but means that this script
|
# characters needed when compiling a single file but means that this script
|
||||||
@@ -623,10 +619,12 @@ def main(args):
|
|||||||
if sys.platform.startswith("win") and len(args) == 2:
|
if sys.platform.startswith("win") and len(args) == 2:
|
||||||
input_args = args[:1] + args[1].split()
|
input_args = args[:1] + args[1].split()
|
||||||
try:
|
try:
|
||||||
exit_code = _main_inner(input_args, build_id, should_collect_logs)
|
exit_code = _main_inner(input_args, build_id)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
exit_code = 1
|
exit_code = 1
|
||||||
finally:
|
finally:
|
||||||
|
# Check the log collection opt-in/opt-out status, and display notice if necessary.
|
||||||
|
should_collect_logs = build_telemetry.enabled()
|
||||||
if should_collect_logs:
|
if should_collect_logs:
|
||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
_upload_ninjalog(input_args, exit_code, elapsed)
|
_upload_ninjalog(input_args, exit_code, elapsed)
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ def reclient_setup_docs_url():
|
|||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def build_context(argv, tool, should_collect_logs):
|
def build_context(argv, tool, should_collect_logs=False):
|
||||||
# If use_remoteexec is set, but the reclient binaries or configs don't
|
# If use_remoteexec is set, but the reclient binaries or configs don't
|
||||||
# exist, display an error message and stop. Otherwise, the build will
|
# exist, display an error message and stop. Otherwise, the build will
|
||||||
# attempt to run with rewrapper wrapping actions, but will fail with
|
# attempt to run with rewrapper wrapping actions, but will fail with
|
||||||
|
|||||||
Reference in New Issue
Block a user