GN: take over Windows -Exceptions bot.

This will make it temporarily 64-bit until I sort out 32-bit builds (tomorrow?) but that's an unimportant dimension for this bot... we just want to make sure we can build with /EHsc.

CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Win-MSVC-x86-Debug-Exceptions-Trybot

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3255

Change-Id: Ie3c604e7ce779d0b45149e0151b7ecc93f9dd523
Reviewed-on: https://skia-review.googlesource.com/3255
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index 3602737..548bd85 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -16,6 +16,7 @@
       'SAN' in extra_config,
       extra_config == 'ANGLE' and 'Win' not in os,
       extra_config == 'CommandBuffer',
+      extra_config == 'Exceptions',
       extra_config == 'Fast',
       extra_config == 'GN',
       extra_config == 'Mesa',
@@ -74,6 +75,8 @@
     elif compiler == 'GCC':
       cc, cxx = 'gcc', 'g++'
 
+    if extra_config == 'Exceptions':
+      extra_cflags.append('/EHsc')
     if extra_config == 'Fast':
       extra_cflags.extend(['-march=native', '-fomit-frame-pointer', '-O3',
                            '-ffp-contract=off'])
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Debug-Exceptions.json b/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Debug-Exceptions.json
index 64bd286..90053e0 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Debug-Exceptions.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Debug-Exceptions.json
@@ -123,30 +123,38 @@
     "cmd": [
       "python",
       "-u",
-      "[CUSTOM_C:\\_B_WORK]\\skia\\infra\\bots\\bootstrap_win_toolchain_json.py",
-      "--win_toolchain_json",
-      "[SLAVE_BUILD]\\src\\build\\win_toolchain.json",
-      "--depot_tools_parent_dir",
-      "[SLAVE_BUILD]"
-    ],
-    "name": "bootstrap win toolchain"
-  },
-  {
-    "cmd": [
-      "python",
-      "make.py",
-      "most"
+      "[CUSTOM_C:\\_B_WORK]\\skia\\bin\\fetch-gn"
     ],
     "cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
     "env": {
-      "BUILDTYPE": "Debug",
-      "CHROME_HEADLESS": "1",
-      "CHROME_PATH": "[SLAVE_BUILD]\\src",
-      "GYP_DEFINES": "qt_sdk=C:/Qt/4.8.5/ skia_arch_type=x86 skia_warnings_as_errors=0 skia_win_debuggers_path=c:/DbgHelp skia_win_exceptions=1 skia_win_ltcg=0",
-      "PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]",
-      "SKIA_OUT": "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Debug-Exceptions"
+      "PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
     },
-    "name": "build most"
+    "name": "fetch-gn"
+  },
+  {
+    "cmd": [
+      "gn.bat",
+      "gen",
+      "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Debug-Exceptions\\Debug",
+      "--args=extra_cflags=[\"/EHsc\"] target_cpu=\"x86\" windk=\"[SLAVE_BUILD]\\t\\depot_tools\\win_toolchain\\vs_files\\95ddda401ec5678f15eeed01d2bee08fcbc5ee97\""
+    ],
+    "cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
+    "env": {
+      "PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
+    },
+    "name": "gn gen"
+  },
+  {
+    "cmd": [
+      "ninja.exe",
+      "-C",
+      "[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Debug-Exceptions\\Debug"
+    ],
+    "cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
+    "env": {
+      "PATH": "%(PATH)s;RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools];RECIPE_PACKAGE_REPO[depot_tools]"
+    },
+    "name": "ninja"
   },
   {
     "cmd": [