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

Side by Side Diff: infra/bots/recipe_modules/flavor/xsan_flavor.py

Issue 2198173002: Re-organize Skia recipes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix missing dependency Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 """Utils for running under *SAN""" 6 """Utils for running under *SAN"""
7 7
8 8
9 import default_flavor 9 import default_flavor
10 10
11 11
12 class XSanFlavorUtils(default_flavor.DefaultFlavorUtils): 12 class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
13 def __init__(self, *args, **kwargs): 13 def __init__(self, m):
14 super(XSanFlavorUtils, self).__init__(*args, **kwargs) 14 super(XSanFlavorUtils, self).__init__(m)
15 self._sanitizer = { 15 self._sanitizer = {
16 # We'd love to just pass 'address,undefined' and get all the checks, but 16 # We'd love to just pass 'address,undefined' and get all the checks, but
17 # we're not anywhere close to being able to do that. Instead we start 17 # we're not anywhere close to being able to do that. Instead we start
18 # with a set of checks that we know pass or nearly pass. See here for 18 # with a set of checks that we know pass or nearly pass. See here for
19 # more information: 19 # more information:
20 # http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation 20 # http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
21 'ASAN': ('address,bool,function,integer-divide-by-zero,nonnull-attribute,' 21 'ASAN': ('address,bool,function,integer-divide-by-zero,nonnull-attribute,'
22 'null,object-size,return,returns-nonnull-attribute,shift,' 22 'null,object-size,return,returns-nonnull-attribute,shift,'
23 'signed-integer-overflow,unreachable,vla-bound,vptr'), 23 'signed-integer-overflow,unreachable,vla-bound,vptr'),
24 # MSAN and TSAN can't run together with ASAN, so they're their own bots. 24 # MSAN and TSAN can't run together with ASAN, so they're their own bots.
25 'MSAN': 'memory', 25 'MSAN': 'memory',
26 'TSAN': 'thread', 26 'TSAN': 'thread',
27 }[self._skia_api.builder_cfg['extra_config'].replace('Swarming', '')] 27 }[self.m.vars.builder_cfg['extra_config'].replace('Swarming', '')]
28 28
29 def compile(self, target): 29 def compile(self, target):
30 cmd = [self._skia_api.skia_dir.join('tools', 'xsan_build'), 30 cmd = [self.m.vars.skia_dir.join('tools', 'xsan_build'),
31 self._sanitizer, target] 31 self._sanitizer, target]
32 self._skia_api.run(self._skia_api.m.step, 'build %s' % target, cmd=cmd, 32 self.m.run(self.m.step, 'build %s' % target, cmd=cmd,
33 cwd=self._skia_api.skia_dir) 33 cwd=self.m.vars.skia_dir)
34 34
35 def copy_extra_build_products(self, swarming_out_dir): 35 def copy_extra_build_products(self, swarming_out_dir):
36 # Include msan_out if MSAN. 36 # Include msan_out if MSAN.
37 if 'MSAN' in self._skia_api.builder_cfg['extra_config']: 37 if 'MSAN' in self.m.vars.builder_cfg['extra_config']:
38 msan_out = self._skia_api.m.path.join( 38 msan_out = self.m.path.join(
39 'third_party', 'externals', 'llvm', 'msan_out') 39 'third_party', 'externals', 'llvm', 'msan_out')
40 self._skia_api.m.file.copytree( 40 self.m.file.copytree(
41 'copy msan_out', 41 'copy msan_out',
42 self._skia_api.skia_dir.join(msan_out), 42 self.m.vars.skia_dir.join(msan_out),
43 swarming_out_dir.join(msan_out), 43 swarming_out_dir.join(msan_out),
44 symlinks=True) 44 symlinks=True)
45 # Include llvm_symbolizer from the Chromium DEPS so that suppressions work 45 # Include llvm_symbolizer from the Chromium DEPS so that suppressions work
46 # by symbol name. 46 # by symbol name.
47 # TODO(benjaminwagner): Figure out how to add this to Skia DEPS for 47 # TODO(benjaminwagner): Figure out how to add this to Skia DEPS for
48 # target_os 'llvm'. 48 # target_os 'llvm'.
49 self._skia_api.m.file.copytree( 49 self.m.file.copytree(
50 'copy llvm-build', 50 'copy llvm-build',
51 self._skia_api.checkout_root.join('src', 'third_party', 'llvm-build'), 51 self.m.vars.checkout_root.join('src', 'third_party', 'llvm-build'),
52 swarming_out_dir.join('llvm-build'), 52 swarming_out_dir.join('llvm-build'),
53 symlinks=True) 53 symlinks=True)
54 54
55 def step(self, name, cmd, env=None, **kwargs): 55 def step(self, name, cmd, env=None, **kwargs):
56 """Wrapper for the Step API; runs a step as appropriate for this flavor.""" 56 """Wrapper for the Step API; runs a step as appropriate for this flavor."""
57 skia_dir = self._skia_api.skia_dir 57 skia_dir = self.m.vars.skia_dir
58 lsan_suppressions = skia_dir.join('tools', 'lsan.supp') 58 lsan_suppressions = skia_dir.join('tools', 'lsan.supp')
59 tsan_suppressions = skia_dir.join('tools', 'tsan.supp') 59 tsan_suppressions = skia_dir.join('tools', 'tsan.supp')
60 ubsan_suppressions = skia_dir.join('tools', 'ubsan.supp') 60 ubsan_suppressions = skia_dir.join('tools', 'ubsan.supp')
61 env = dict(env or {}) 61 env = dict(env or {})
62 env['ASAN_OPTIONS'] = 'symbolize=1 detect_leaks=1' 62 env['ASAN_OPTIONS'] = 'symbolize=1 detect_leaks=1'
63 env['LSAN_OPTIONS'] = ('symbolize=1 print_suppressions=1 suppressions=%s' % 63 env['LSAN_OPTIONS'] = ('symbolize=1 print_suppressions=1 suppressions=%s' %
64 lsan_suppressions) 64 lsan_suppressions)
65 env['TSAN_OPTIONS'] = 'suppressions=%s' % tsan_suppressions 65 env['TSAN_OPTIONS'] = 'suppressions=%s' % tsan_suppressions
66 env['UBSAN_OPTIONS'] = 'suppressions=%s' % ubsan_suppressions 66 env['UBSAN_OPTIONS'] = 'suppressions=%s' % ubsan_suppressions
67 self._skia_api.default_env['PATH'] = '%%(PATH)s:%s' % ( 67 self.m.vars.default_env['PATH'] = '%%(PATH)s:%s' % (
68 self._skia_api.slave_dir.join('llvm-build', 'Release+Asserts', 'bin')) 68 self.m.vars.slave_dir.join('llvm-build', 'Release+Asserts', 'bin'))
69 env['LD_LIBRARY_PATH'] = self._skia_api.slave_dir.join( 69 env['LD_LIBRARY_PATH'] = self.m.vars.slave_dir.join(
70 'third_party', 'externals', 'llvm', 'msan_out', 'lib') 70 'third_party', 'externals', 'llvm', 'msan_out', 'lib')
71 71
72 path_to_app = self.out_dir.join(cmd[0]) 72 path_to_app = self.out_dir.join(cmd[0])
73 new_cmd = [path_to_app] 73 new_cmd = [path_to_app]
74 new_cmd.extend(cmd[1:]) 74 new_cmd.extend(cmd[1:])
75 return self._skia_api.run(self._skia_api.m.step, name, cmd=new_cmd, env=env, 75 return self.m.run(self.m.step, name, cmd=new_cmd, env=env, **kwargs)
76 **kwargs)
OLDNEW
« no previous file with comments | « infra/bots/recipe_modules/flavor/valgrind_flavor.py ('k') | infra/bots/recipe_modules/run/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698