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

Unified Diff: infra/bots/flavor/xsan_flavor.py

Issue 1703663002: Port Skia recipe to normal Python scripts, move to Skia repo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 10 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
« no previous file with comments | « infra/bots/flavor/valgrind_flavor.py ('k') | infra/bots/skia_repo.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/flavor/xsan_flavor.py
diff --git a/infra/bots/flavor/xsan_flavor.py b/infra/bots/flavor/xsan_flavor.py
new file mode 100644
index 0000000000000000000000000000000000000000..5807be0180e5c8df85940ac02664c012975cd4dc
--- /dev/null
+++ b/infra/bots/flavor/xsan_flavor.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+"""Utils for running under *SAN"""
+
+
+import default_flavor
+import os
+
+
+class XSanFlavorUtils(default_flavor.DefaultFlavorUtils):
+ def __init__(self, *args, **kwargs):
+ super(XSanFlavorUtils, self).__init__(*args, **kwargs)
+ 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
+ # with a set of checks that we know pass or nearly pass. See here for
+ # more information:
+ # http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
+ 'ASAN': ('address,bool,function,integer-divide-by-zero,nonnull-attribute,'
+ 'null,object-size,return,returns-nonnull-attribute,shift,'
+ 'signed-integer-overflow,unreachable,vla-bound,vptr'),
+ # MSAN and TSAN can't run together with ASAN, so they're their own bots.
+ 'MSAN': 'memory',
+ 'TSAN': 'thread',
+ }[self._bot_info.bot_cfg['extra_config']]
+
+ def compile(self, target):
+ cmd = [os.path.join(self._bot_info.skia_dir, 'tools', 'xsan_build'),
+ self._sanitizer, target]
+ self._bot_info.run(cmd)
+
+ def step(self, cmd, env=None, **kwargs):
+ """Wrapper for the Step API; runs a step as appropriate for this flavor."""
+ lsan_suppressions = self._bot_info.skia_dir.join('tools', 'lsan.supp')
+ tsan_suppressions = self._bot_info.skia_dir.join('tools', 'tsan.supp')
+ ubsan_suppressions = self._bot_info.skia_dir.join('tools', 'ubsan.supp')
+ env = dict(env or {})
+ env['ASAN_OPTIONS'] = 'symbolize=1 detect_leaks=1'
+ env['LSAN_OPTIONS'] = ('symbolize=1 print_suppressions=1 suppressions=%s' %
+ lsan_suppressions)
+ env['TSAN_OPTIONS'] = 'suppressions=%s' % tsan_suppressions
+ env['UBSAN_OPTIONS'] = 'suppressions=%s' % ubsan_suppressions
+
+ path_to_app = os.path.join(self._bot_info.out_dir,
+ self._bot_info.configuration, cmd[0])
+ new_cmd = [path_to_app]
+ new_cmd.extend(cmd[1:])
+ return self._bot_info.run(new_cmd, env=env, **kwargs)
« no previous file with comments | « infra/bots/flavor/valgrind_flavor.py ('k') | infra/bots/skia_repo.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698