Fix Chrome build for RecreateSKPs and CommandBuffer bots for GYP->GN
authorborenet <borenet@chromium.org>
Tue, 2 Aug 2016 14:02:52 +0000 (07:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 2 Aug 2016 14:02:52 +0000 (07:02 -0700)
BUG=skia:5597
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2199273002

Review-Url: https://codereview.chromium.org/2199273002

infra/bots/recipe_modules/skia/api.py
infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json
infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Weekly-RecreateSKPs.json
infra/bots/recipes/swarm_RecreateSKPs.py
tools/build_command_buffer.py

index a173601e64badea13f16854323bcc4bed2253bec..96467eaaff19b47ad921981ca6a39edb21f86c81 100644 (file)
@@ -194,6 +194,9 @@ class SkiaApi(recipe_api.RecipeApi):
          'SAN' in self.builder_name) or
         'RecreateSKPs' in self.builder_name):
       self._need_chromium_checkout = True
+      if 'RecreateSKPs' in self.builder_name:
+        self.gclient_env['CPPFLAGS'] = (
+            '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1')
 
     # Some bots also require a checkout of PDFium.
     self._need_pdfium_checkout = 'PDFium' in self.builder_name
index fcba352a20f5e94a38a37620211525f97c1c624e..a1a4510ab4584f9804177c6d8e4494c77b40e13c 100644 (file)
@@ -84,6 +84,7 @@
     ],
     "cwd": "[CUSTOM_/_B_WORK]",
     "env": {
+      "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
       "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
     },
     "name": "gclient runhooks"
   },
   {
     "cmd": [
-      "python",
-      "-u",
-      "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
-      "runhooks"
-    ],
-    "cwd": "[CUSTOM_/_B_WORK]/skia",
-    "env": {
-      "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
-      "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
-    },
-    "name": "gclient runhooks (2)"
-  },
-  {
-    "cmd": [
-      "build/gyp_chromium"
+      "[CUSTOM_/_B_WORK]/src/buildtools/linux64/gn",
+      "gen",
+      "[CUSTOM_/_B_WORK]/src/out/Release"
     ],
     "cwd": "[CUSTOM_/_B_WORK]/src",
     "env": {
       "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
       "GYP_GENERATORS": "ninja"
     },
-    "name": "gyp_chromium"
+    "name": "GN"
   },
   {
     "cmd": [
       "ninja",
       "-C",
-      "out/Release",
+      "[CUSTOM_/_B_WORK]/src/out/Release",
       "chrome"
     ],
     "cwd": "[CUSTOM_/_B_WORK]/src",
index 51875510ee2931a1fcd3f4a6202539642d7af9b2..756babc7fb127d0cbab154d93f75a888597d32e1 100644 (file)
@@ -84,6 +84,7 @@
     ],
     "cwd": "[CUSTOM_/_B_WORK]",
     "env": {
+      "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
       "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
     },
     "name": "gclient runhooks"
   },
   {
     "cmd": [
-      "python",
-      "-u",
-      "RECIPE_PACKAGE_REPO[depot_tools]/gclient.py",
-      "runhooks"
-    ],
-    "cwd": "[CUSTOM_/_B_WORK]/skia",
-    "env": {
-      "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
-      "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]"
-    },
-    "name": "gclient runhooks (2)"
-  },
-  {
-    "cmd": [
-      "build/gyp_chromium"
+      "[CUSTOM_/_B_WORK]/src/buildtools/linux64/gn",
+      "gen",
+      "[CUSTOM_/_B_WORK]/src/out/Release"
     ],
     "cwd": "[CUSTOM_/_B_WORK]/src",
     "env": {
       "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1",
       "GYP_GENERATORS": "ninja"
     },
-    "name": "gyp_chromium"
+    "name": "GN"
   },
   {
     "cmd": [
       "ninja",
       "-C",
-      "out/Release",
+      "[CUSTOM_/_B_WORK]/src/out/Release",
       "chrome"
     ],
     "cwd": "[CUSTOM_/_B_WORK]/src",
index 6863b020b753ee453b08ee1dd59a4caf93e488f8..49f9c11678046d64aecef06e8724ab3448e4fb0a 100644 (file)
@@ -92,20 +92,21 @@ if os.path.isfile(backup_file):
 def RunSteps(api):
   # Check out Chrome.
   api.skia.setup()
-  api.gclient.runhooks(
-      env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1'})
 
   src_dir = api.skia.checkout_root.join('src')
+  out_dir = src_dir.join('out', 'Release')
 
-  # Call build/gyp_chromium
-  api.step('gyp_chromium',
-           ['build/gyp_chromium'],
+  # Call GN.
+  platform = 'linux64'  # This bot only runs on linux; don't bother checking.
+  gn = src_dir.join('buildtools', platform, 'gn')
+  api.step('GN',
+           [gn, 'gen', out_dir],
            env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1',
                 'GYP_GENERATORS': 'ninja'},
            cwd=src_dir)
   # Build Chrome.
   api.step('Build Chrome',
-           ['ninja', '-C', 'out/Release', 'chrome'],
+           ['ninja', '-C', out_dir, 'chrome'],
            cwd=src_dir)
 
   # Download boto file (needed by recreate_skps.py) to tmp dir.
index 015cdaf23ec8a4ce91022a4bf89b1765e2f19427..0349419030f56664f508f9619383ed1a967e1132 100755 (executable)
@@ -129,6 +129,25 @@ def main():
       sys.exit('Error (ret code: %s) calling "%s" in %s' % (error.returncode,
           error.cmd, chrome_src_dir))
 
+  try:
+    subprocess.check_call([gclient, 'runhooks'], cwd=chrome_src_dir)
+  except subprocess.CalledProcessError as error:
+    sys.exit('Error (ret code: %s) calling "%s" in %s' % (
+        error.returncode, error.cmd, chrome_src_dir))
+
+  platform = 'linux64'
+  if sys.platform == 'darwin':
+    platform = 'mac'
+  elif sys.platform == 'win32':
+    platform = 'win'
+  gn = os.path.join(chrome_src_dir, 'buildtools', platform, 'gn')
+  try:
+    subprocess.check_call([gn, 'gen', chrome_target_dir_rel],
+                          cwd=chrome_src_dir)
+  except subprocess.CalledProcessError as error:
+    sys.exit('Error (ret code: %s) calling "%s" in %s' % (
+        error.returncode, error.cmd, chrome_src_dir))
+
   try:
     subprocess.check_call(['ninja'] + shlex.split(args.extra_ninja_args) +
         ['-C', chrome_target_dir_rel, 'command_buffer_gles2'],