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

Unified Diff: scripts/slave/recipe_modules/skia/xsan_flavor.py

Issue 1920283002: Modify Skia recipes to allow running XSAN on Swarming. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 8 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/recipe_modules/skia/xsan_flavor.py
diff --git a/scripts/slave/recipe_modules/skia/xsan_flavor.py b/scripts/slave/recipe_modules/skia/xsan_flavor.py
index f070882ed1a4150dd5332540ca4a6c2f2dece3e5..ce3038ced3cd540e1a1ac1f1a2865d6b320ae043 100644
--- a/scripts/slave/recipe_modules/skia/xsan_flavor.py
+++ b/scripts/slave/recipe_modules/skia/xsan_flavor.py
@@ -12,6 +12,10 @@ import default_flavor
class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
def __init__(self, *args, **kwargs):
super(XSanFlavorUtils, self).__init__(*args, **kwargs)
+ key = self._skia_api.builder_cfg['extra_config']
+ # Remove "Swarming" from the beginning of extra_config.
+ if key.startswith("Swarming"):
+ key = key[len("Swarming"):]
self._sanitizer = {
# We'd love to just pass 'address,undefined' and get all the checks, but
# we're not anywhere close to being able to do that. Instead we start
@@ -24,7 +28,7 @@ class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
# MSAN and TSAN can't run together with ASAN, so they're their own bots.
'MSAN': 'memory',
'TSAN': 'thread',
- }[self._skia_api.builder_cfg['extra_config']]
+ }[key]
borenet 2016/05/04 11:15:55 I think I'd just do this: }[self._skia_api.builde
dogben 2016/05/04 13:48:02 I can do that if you think it's best, but I want t
dogben 2016/05/04 13:49:56 I'll change it to self._skia_api.builder_cfg['extr
borenet 2016/05/04 13:51:57 Oh, right. Replace SGTM, or you can leave it as-is
def compile(self, target):
cmd = [self._skia_api.skia_dir.join('tools', 'xsan_build'),
@@ -32,6 +36,26 @@ class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
self._skia_api.run(self._skia_api.m.step, 'build %s' % target, cmd=cmd,
cwd=self._skia_api.skia_dir)
+ def copy_extra_build_products(self, swarming_out_dir):
+ # Include msan_out if MSAN.
+ if 'MSAN' in self._skia_api.builder_cfg['extra_config']:
+ msan_out = self._skia_api.m.path.join(
+ 'third_party', 'externals', 'llvm', 'msan_out')
+ self._skia_api.m.file.copytree(
+ 'copy msan_out',
+ self._skia_api.skia_dir.join(msan_out),
+ swarming_out_dir.join(msan_out),
+ symlinks=True)
+ # Include llvm_symbolizer from the Chromium DEPS so that suppressions work
+ # by symbol name.
+ # TODO(benjaminwagner): Figure out how to add this to Skia DEPS for
+ # target_os 'llvm'.
+ self._skia_api.m.file.copytree(
+ 'copy llvm-build',
+ self._skia_api.checkout_root.join('src', 'third_party', 'llvm-build'),
+ swarming_out_dir.join('llvm-build'),
+ symlinks=True)
+
def step(self, name, cmd, env=None, **kwargs):
"""Wrapper for the Step API; runs a step as appropriate for this flavor."""
skia_dir = self._skia_api.skia_dir
@@ -44,10 +68,13 @@ class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
lsan_suppressions)
env['TSAN_OPTIONS'] = 'suppressions=%s' % tsan_suppressions
env['UBSAN_OPTIONS'] = 'suppressions=%s' % ubsan_suppressions
+ if self._skia_api.running_in_swarming:
+ self._skia_api.default_env['PATH'] = '%s:%s' % (
+ self._skia_api.default_env['PATH'],
+ self._skia_api.slave_dir.join('llvm-build', 'Release+Asserts', 'bin'))
path_to_app = self.out_dir.join(cmd[0])
new_cmd = [path_to_app]
new_cmd.extend(cmd[1:])
return self._skia_api.run(self._skia_api.m.step, name, cmd=new_cmd, env=env,
**kwargs)
-

Powered by Google App Engine
This is Rietveld 408576698