Enable compiling with automatically-downloaded VS toolchain on Windows bots
authorEric Boren <borenet@google.com>
Mon, 16 Jun 2014 14:02:42 +0000 (10:02 -0400)
committerEric Boren <borenet@google.com>
Mon, 16 Jun 2014 14:02:42 +0000 (10:02 -0400)
Requires that the bots have CHROME_HEADLESS=1 and CHROME_PATH set.

BUG=skia:2216
R=epoger@google.com

Review URL: https://codereview.chromium.org/332833002

gyp_skia
make.bat
make.py

index be90916..1f3f337 100755 (executable)
--- a/gyp_skia
+++ b/gyp_skia
@@ -93,6 +93,16 @@ if __name__ == '__main__':
     os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators
   print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS))
 
+  if os.getenv('CHROME_HEADLESS', '0') == '1':
+    if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
+      chrome_path = os.getenv('CHROME_PATH')
+      os.chdir(chrome_path)
+      sys.path.append(os.path.join(chrome_path, 'build'))
+      sys.path.append(os.path.join(chrome_path, 'tools'))
+      import vs_toolchain
+      vs_toolchain.Update()
+      vs_toolchain.GetToolchainDir()
+
   # Set CWD to the directory containing this script.
   # This allows us to launch it from other directories, in spite of gyp's
   # finickyness about the current working directory.
index a996107..2b6a629 100644 (file)
--- a/make.bat
+++ b/make.bat
@@ -7,6 +7,9 @@
 rem Launches make.py on Windows, after setting Visual Studio environment variables.\r
 rem See http://code.google.com/p/skia/wiki/GettingStartedOnWindows\r
 \r
+rem Skip environment setup on bots.\r
+if "%CHROME_HEADLESS%"=="1" goto run_python\r
+\r
 if "%DevEnvDir%"=="" goto setup_env_vars\r
 \r
 :run_python\r
diff --git a/make.py b/make.py
index fc959a0..cb6c2a4 100644 (file)
--- a/make.py
+++ b/make.py
@@ -92,8 +92,9 @@ def MakeWindows(targets):
     parameters:\r
         targets: build targets as a list of strings\r
     """\r
-    # TODO(epoger): I'm not sure if this is needed for ninja builds.\r
-    CheckWindowsEnvironment()\r
+    if os.environ.get('CHROME_HEADLESS', '0') != '1':\r
+        # TODO(epoger): I'm not sure if this is needed for ninja builds.\r
+        CheckWindowsEnvironment()\r
 \r
     # Run gyp_skia to prepare Visual Studio projects.\r
     cd(SCRIPT_DIR)\r