Index: build/android/pylib/constants/__init__.py |
diff --git a/build/android/pylib/constants/__init__.py b/build/android/pylib/constants/__init__.py |
index 21001f9ccf22734842965c1132b9310747dd1bd4..f1844df3dd07f6b8063028d1c832fa9087687f2a 100644 |
--- a/build/android/pylib/constants/__init__.py |
+++ b/build/android/pylib/constants/__init__.py |
@@ -9,6 +9,7 @@ |
# pylint: disable=W0212 |
import collections |
+import glob |
import logging |
import os |
import subprocess |
@@ -260,6 +261,15 @@ def CheckOutputDirectory(): |
if os.path.exists('build.ninja'): |
output_dir = os.getcwd() |
SetOutputDirectory(output_dir) |
+ elif os.environ.get('CHROME_HEADLESS'): |
+ # When running on bots, see if the output directory is obvious. |
+ dirs = glob.glob(os.path.join(DIR_SOURCE_ROOT, 'out', '*', 'build.ninja')) |
jbudorick
2016/03/14 17:41:35
I don't think this will work with gyp bots, which
|
+ if len(dirs) == 1: |
+ SetOutputDirectory(dirs[0]) |
+ else: |
+ raise Exception('Neither CHROMIUM_OUTPUT_DIR nor CHROMIUM_OUT_DIR ' |
+ 'has been set. CHROME_HEADLESS detected, but multiple ' |
+ 'out dirs exist: %r' % dirs) |
else: |
raise Exception('Neither CHROMIUM_OUTPUT_DIR nor CHROMIUM_OUT_DIR ' |
'has been set') |