[autosiso] suggest using siso command direclty for non build commands

`autosiso` doesn't handle non build commands. e.g. help, version, login
We should encourage users to use `siso` command directly,
and get rid of  `autosiso` eventually at some point.

Bug: b/278675516
Change-Id: I651e537d8d03674f5d1996983083e25ab5d149c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4452374
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
changes/74/4452374/9
Junji Watanabe 2 years ago committed by LUCI CQ
parent 34f62b4af7
commit 48fcabef4c

@ -4,16 +4,41 @@
# found in the LICENSE file. # found in the LICENSE file.
""" """
Developers invoke this script via autosiso or autosiso.bat to simply run Developers invoke this script via autosiso or autosiso.bat to simply run
Siso builds. Siso/Reclient builds.
""" """
# TODO(b/278976196): `siso ninja` command should handle the reclient and
# authentication accordingly.
import os
import re
import sys import sys
import reclient_helper import reclient_helper
import siso import siso
def _use_remoteexec(argv):
out_dir = reclient_helper.find_ninja_out_dir(argv)
gn_args_path = os.path.join(out_dir, 'args.gn')
if not os.path.exists(gn_args_path):
return False
with open(gn_args_path) as f:
for line in f:
line_without_comment = line.split('#')[0]
if re.search(r'(^|\s)use_remoteexec\s*=\s*true($|\s)',
line_without_comment):
return True
return False
def main(argv): def main(argv):
if not _use_remoteexec(argv):
print(
"`use_remoteexec=true` is not detected.\n"
"Please run `siso` command directly.",
file=sys.stderr)
return 1
with reclient_helper.build_context(argv) as ret_code: with reclient_helper.build_context(argv) as ret_code:
if ret_code: if ret_code:
return ret_code return ret_code

Loading…
Cancel
Save