blob: d7c83298e2589e74cac945260a98eb4cd33a9ad4 [file] [log] [blame]
Ben Segall9e36ef62023-04-18 22:09:28 +00001#!/usr/bin/env python3
2# Copyright 2023 The Chromium Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5"""This script is a wrapper around the //buildtools/reclient/reclientreport
6binary that populates the log paths correctly for builds run via autoninja
7Call this script with the same -C argument used for the autoninja build
8Example usage:
9$ reclientreport -C out/my-ninja-out
10"""
11
12import argparse
13import os
14import subprocess
15import sys
16
Ben Segall6b62f422023-04-20 13:29:36 +000017import reclient_helper
Ben Segall9e36ef62023-04-18 22:09:28 +000018
19
20def main():
21 parser = argparse.ArgumentParser(description=__doc__)
22 parser.add_argument("--ninja_out",
23 "-C",
24 required=True,
25 help="ninja out directory used for the autoninja build")
26 parser.add_argument('args', nargs=argparse.REMAINDER)
27
28 args, extras = parser.parse_known_args()
29 if args.args and args.args[0] == '--':
30 args.args.pop(0)
31 if extras:
32 args.args = extras + args.args
33
Ben Segall6b62f422023-04-20 13:29:36 +000034 reclient_helper.set_reproxy_path_flags(args.ninja_out, make_dirs=False)
35 reclient_bin_dir = reclient_helper.find_reclient_bin_dir()
Ben Segall9e36ef62023-04-18 22:09:28 +000036 code = subprocess.call([os.path.join(reclient_bin_dir, 'reclientreport')] +
37 args.args)
38 if code != 0:
39 print("Failed to collect logs, make sure that %s/.reproxy_tmp exists" %
40 args.ninja_out,
41 file=sys.stderr)
42
43
44if __name__ == '__main__':
45 sys.exit(main())