summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/toolchain/get_goma_dir.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/libwebrtc/build/toolchain/get_goma_dir.py
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/build/toolchain/get_goma_dir.py')
-rw-r--r--third_party/libwebrtc/build/toolchain/get_goma_dir.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/third_party/libwebrtc/build/toolchain/get_goma_dir.py b/third_party/libwebrtc/build/toolchain/get_goma_dir.py
new file mode 100644
index 0000000000..114da6c0ea
--- /dev/null
+++ b/third_party/libwebrtc/build/toolchain/get_goma_dir.py
@@ -0,0 +1,42 @@
+# Copyright 2020 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 gets default goma_dir for depot_tools goma.
+
+import os
+import sys
+
+
+def main():
+ gomacc = 'gomacc'
+ candidates = []
+ if sys.platform in ['win32', 'cygwin']:
+ gomacc = 'gomacc.exe'
+
+ for path in os.environ.get('PATH', '').split(os.pathsep):
+ # normpath() required to strip trailing slash when present.
+ if os.path.basename(os.path.normpath(path)) == 'depot_tools':
+ candidates.append(os.path.join(path, '.cipd_bin'))
+
+ for d in candidates:
+ if os.path.isfile(os.path.join(d, gomacc)):
+ sys.stdout.write(d)
+ return 0
+ # mb analyze step set use_goma=true, but goma_dir="",
+ # and bot doesn't have goma in default locataion above.
+ # to mitigate this, just use initial depot_tools path
+ # or default path as before (if depot_tools doesn't exist
+ # in PATH).
+ # TODO(ukai): crbug.com/1073276: fix mb analyze step and make it hard error?
+ if sys.platform in ['win32', 'cygwin']:
+ sys.stdout.write('C:\\src\\goma\\goma-win64')
+ elif 'GOMA_DIR' in os.environ:
+ sys.stdout.write(os.environ.get('GOMA_DIR'))
+ else:
+ sys.stdout.write(os.path.join(os.environ.get('HOME', ''), 'goma'))
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())