[reclient] Add temporary fix for reclientreport on windows

Test: Ran on windows cloudtop and all logs were collected
Bug: b/296402157
Change-Id: Ice5e76294d460b2369afd5524d04118a84c38807
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4791022
Auto-Submit: Ben Segall <bentekkie@google.com>
Reviewed-by: Ramy Medhat <abdelaal@google.com>
Commit-Queue: Ben Segall <bentekkie@google.com>
changes/22/4791022/3
Ben Segall 2 years ago committed by LUCI CQ
parent dfafd0a3c7
commit f1390e5ac1

@ -13,10 +13,25 @@ import argparse
import os
import subprocess
import sys
import tarfile
import tempfile
import reclient_helper
# TODO(b/296402157): Remove once reclientreport binary saves all logs on windows
def temp_win_impl__b_296402157(out_dir):
'''Temporary implementation until b/296402157 is fixed'''
log_dir = os.path.abspath(os.path.join(out_dir, '.reproxy_tmp', 'logs'))
with tempfile.NamedTemporaryFile(prefix='reclientreport',
suffix='.tar.gz',
delete=False) as f:
with tarfile.open(fileobj=f, mode='w:gz') as tar:
tar.add(log_dir, arcname=os.path.basename(log_dir))
print(
f'Created log file at {f.name}. Please attach this to your bug report!')
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--ninja_out",
@ -26,6 +41,9 @@ def main():
parser.add_argument('args', nargs=argparse.REMAINDER)
args, extras = parser.parse_known_args()
if sys.platform.startswith('win'):
temp_win_impl__b_296402157(args.ninja_out)
return
if args.args and args.args[0] == '--':
args.args.pop(0)
if extras:

Loading…
Cancel
Save