Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: scripts/slave/recipes/chromium_trybot.py

Issue 211473006: Add GN (the build tool) to the chromium.linux buildbots and try jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: update w/ review feedback Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipes/chromium_trybot.py
diff --git a/scripts/slave/recipes/chromium_trybot.py b/scripts/slave/recipes/chromium_trybot.py
index 3cf68d44e5857c29d9a78ed00b6a56598cfbc491..02b1844041e1a28a47b7dd2f7795faea7e7387ea 100644
--- a/scripts/slave/recipes/chromium_trybot.py
+++ b/scripts/slave/recipes/chromium_trybot.py
@@ -265,6 +265,16 @@ def GenSteps(api):
api.chromium.runhooks(),
)
+ # TODO(dpranke): crbug.com/353690. Remove the gn-specific steps from this
+ # recipe and stand up a dedicated GN bot when the GN steps take up enough
+ # resources to be worth it. For now, we run GN and generate files into a new
+ # Debug_gn / Release_gn dir, and then run a compile in that dir.
+ gn_build_config_dir = str(api.chromium.c.BUILD_CONFIG) + '_gn'
+ gn_output_arg = '//out/' + gn_build_config_dir
+ gn_output_dir = api.path['checkout'].join('out', gn_build_config_dir)
+ should_run_gn = api.properties.get('buildername') in ('linux_chromium',
+ 'linux_chromium_rel')
+
test_spec = api.step_history['read test spec'].json.output
test_spec = [s.encode('utf-8') for s in test_spec]
@@ -281,7 +291,19 @@ def GenSteps(api):
name='compile (with patch)',
abort_on_failure=False,
can_fail_build=False)
- if api.step_history['compile (with patch)'].retcode != 0:
+ retry_at_lkcr = api.step_history['compile (with patch)'].retcode != 0
iannucci 2014/03/28 22:40:42 api.step_history.last_step().retcode might be cle
Dirk Pranke 2014/03/28 23:52:06 In this case, that's clearer, and I agree that we
+
+ if not retry_at_lkcr and should_run_gn:
+ yield api.chromium.run_gn(gn_output_arg, abort_on_failure=False,
+ can_fail_build=False)
+ yield api.chromium.compile_with_ninja('compile (gn with patch)',
+ gn_output_dir,
+ abort_on_failure=False,
+ can_fail_build=False)
+ retry_at_lkcr = (api.step_history['gn'].retcode != 0 or
+ api.step_history['compile (gn with patch)'].retcode != 0)
+
+ if retry_at_lkcr:
# Only use LKCR when compile fails. Note that requested specific revision
# can still override this.
api.gclient.set_config('chromium_lkcr')
@@ -309,6 +331,12 @@ def GenSteps(api):
force_clobber=True)
)
+ if should_run_gn:
+ yield api.path.rmcontents('slave gn build directory', gn_output_dir)
+ yield api.chromium.run_gn(gn_output_arg)
+ yield api.chromium.compile_with_ninja(
+ 'compile (gn with patch, lkcr, clobber)', gn_output_dir)
+
# Do not run tests if the build is already in a failed state.
if api.step_history.failed:
return
@@ -316,7 +344,12 @@ def GenSteps(api):
if recipe_config['compile_only']:
return
- # TODO(phajdan.jr): Make it possible to retry telemtry tests (add JSON).
+ # TODO(dpranke): crbug.com/353690. It would be good to run gn_unittests
+ # out of the gn build dir, but we can't use runtest()
+ # because of the different output directory; this means
+ # we don't get annotations and don't get retry of the tests for free :( .
+
+ # TODO(phajdan.jr): Make it possible to retry telemetry tests (add JSON).
yield (
api.chromium.run_telemetry_unittests(),
api.chromium.run_telemetry_perf_unittests(),
@@ -462,3 +495,21 @@ def GenTests(api):
api.step_data('compile (with patch, lkcr, clobber)', retcode=1) +
api.step_data('compile (with patch, lkcr, clobber, nuke)', retcode=1)
)
+
+ # TODO(dpranke): crbug.com/353690.
+ # Remove this when we make GN a standalone recipe.
+ yield (
+ api.test('unittest_should_run_gn') +
+ api.properties.tryserver(buildername='linux_chromium',
+ build_config='Debug') +
+ api.platform.name('linux') +
+ api.step_data('compile (gn with patch)')
iannucci 2014/03/28 22:40:42 can remove this empty step_data
Dirk Pranke 2014/03/28 23:52:44 okay.
+ )
+
+ yield (
+ api.test('unittest_should_run_gn_compile_failure') +
+ api.properties.tryserver(buildername='linux_chromium',
+ build_config='Debug') +
+ api.platform.name('linux') +
+ api.step_data('compile (gn with patch)', retcode=1)
+ )

Powered by Google App Engine
This is Rietveld 408576698