Browse Source

autoninja: show warning if siso builtin remote exec is not used on cog

If user forgets to set `use_reclient=false`,

```
ukai@ukai /google/cog/cloud/ukai/siso-test/chromium
 % ~/depot_tools/autoninja -C out/Default base
WARNING: You're not using Siso's built-in remote execution. The build will be slow.
You should set the following in args.gn to get better performance:
  use_remoteexec=true
  use_reclient=false
  use_siso=true

Proxy started successfully.
```

Bug: b/362301140
Change-Id: I40972b96fd2576c32232f88e6248a1000708c3e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5816108
Reviewed-by: Junji Watanabe <jwata@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Gary Tong <gatong@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Philipp Wollermann <philwo@google.com>
Fumitoshi Ukai 11 months ago
parent
commit
1f6ef165b7
1 changed files with 14 additions and 0 deletions
  1. 14 0
      autoninja.py

+ 14 - 0
autoninja.py

@@ -33,6 +33,7 @@ import google.auth
 from google.auth.transport.requests import AuthorizedSession
 
 import build_telemetry
+import gclient_utils
 import gn_helper
 import ninja
 import ninjalog_uploader
@@ -272,6 +273,19 @@ def _main_inner(input_args, build_id, should_collect_logs=False):
                 )
                 return 1
 
+        if gclient_utils.IsEnvCog():
+            if not use_remoteexec or use_reclient or not use_siso:
+                print(
+                    "WARNING: You're not using Siso's built-in remote "
+                    "execution. The build will be slow.\n"
+                    "You should set the following in args.gn to get better "
+                    "performance:\n"
+                    "  use_remoteexec=true\n"
+                    "  use_reclient=false\n"
+                    "  use_siso=true\n",
+                    file=sys.stderr,
+                )
+
         siso_marker = os.path.join(output_dir, ".siso_deps")
         if use_siso:
             # siso generates a .ninja_log file so the mere existence of a