Add convenience wrapper for reclientreport for autoninja users
This is designed to be called by a developer when they want to submit an reclient bug report. Developers could just call the //buildtools/reclient/reclientreport binary directly but this wrapper provides an easier way to set the same log flags that are set by ninja_reclient. I dont think we should bundle this logic into autoninja as this is not required in 99% of builds. Bug: b/277763387 Change-Id: I0204b6acc22f199b461ef710d0dfd07e05534af7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4414921 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Takuto Ikuta <tikuta@chromium.org> Auto-Submit: Ben Segall <bentekkie@google.com>changes/21/4414921/6
parent
da6ce67245
commit
9e36ef60d0
@ -0,0 +1,2 @@
|
||||
abdelaal@google.com
|
||||
bentekkie@google.com
|
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023 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.
|
||||
|
||||
base_dir=$(dirname "$0")
|
||||
PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/reclientreport.py" "$@"
|
@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
:: Copyright 2023 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.
|
||||
setlocal
|
||||
|
||||
:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used
|
||||
:: standalone, but allow other PATH manipulations to take priority.
|
||||
set PATH=%PATH%;%~dp0
|
||||
|
||||
:: Defer control.
|
||||
python3 "%~dp0\reclientreport.py" "%*"
|
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 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.
|
||||
"""This script is a wrapper around the //buildtools/reclient/reclientreport
|
||||
binary that populates the log paths correctly for builds run via autoninja
|
||||
Call this script with the same -C argument used for the autoninja build
|
||||
Example usage:
|
||||
$ reclientreport -C out/my-ninja-out
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import ninja_reclient
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--ninja_out",
|
||||
"-C",
|
||||
required=True,
|
||||
help="ninja out directory used for the autoninja build")
|
||||
parser.add_argument('args', nargs=argparse.REMAINDER)
|
||||
|
||||
args, extras = parser.parse_known_args()
|
||||
if args.args and args.args[0] == '--':
|
||||
args.args.pop(0)
|
||||
if extras:
|
||||
args.args = extras + args.args
|
||||
|
||||
ninja_reclient.set_reproxy_path_flags(args.ninja_out, make_dirs=False)
|
||||
reclient_bin_dir = ninja_reclient.find_reclient_bin_dir()
|
||||
code = subprocess.call([os.path.join(reclient_bin_dir, 'reclientreport')] +
|
||||
args.args)
|
||||
if code != 0:
|
||||
print("Failed to collect logs, make sure that %s/.reproxy_tmp exists" %
|
||||
args.ninja_out,
|
||||
file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
Loading…
Reference in New Issue