mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Use already existing function from ninja parse_args to fetch the logs folder.
Change ninja.parse_args algorithm slightly to prevent error due to the incorrect parameters, and change ninjalog uploader expectations. Bug: b/449906174 Change-Id: I64b76396078ae36e288d1f23977518416a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7019133 Reviewed-by: Junji Watanabe <jwata@google.com> Commit-Queue: Alex Ovsienko <ovsienko@google.com>
This commit is contained in:
@@ -36,6 +36,7 @@ import urllib.request
|
||||
|
||||
import build_telemetry
|
||||
import gclient_utils
|
||||
import ninja
|
||||
|
||||
# Configs that should not be uploaded as is.
|
||||
SENSITIVE_CONFIGS = (
|
||||
@@ -218,22 +219,8 @@ def _getGCEInfo():
|
||||
|
||||
def GetNinjalog(cmdline):
|
||||
"""GetNinjalog returns the path to ninjalog from cmdline."""
|
||||
# ninjalog is in current working directory by default.
|
||||
ninjalog_dir = "."
|
||||
|
||||
i = 0
|
||||
while i < len(cmdline):
|
||||
cmd = cmdline[i]
|
||||
i += 1
|
||||
if cmd == "-C" and i < len(cmdline):
|
||||
ninjalog_dir = cmdline[i]
|
||||
i += 1
|
||||
continue
|
||||
|
||||
if cmd.startswith("-C") and len(cmd) > len("-C"):
|
||||
ninjalog_dir = cmd[len("-C"):]
|
||||
|
||||
return os.path.join(ninjalog_dir, ".ninja_log")
|
||||
_, out_dir = ninja.parse_args(cmdline)
|
||||
return os.path.join(out_dir, ".ninja_log")
|
||||
|
||||
|
||||
def UploadNinjaLog(server, ninjalog, metadata):
|
||||
|
||||
Reference in New Issue
Block a user