aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/suppressions.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/plugins/suppressions.py
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/plugins/suppressions.py')
-rw-r--r--build/plugins/suppressions.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/plugins/suppressions.py b/build/plugins/suppressions.py
new file mode 100644
index 0000000000..db5037646d
--- /dev/null
+++ b/build/plugins/suppressions.py
@@ -0,0 +1,24 @@
+def onsuppressions(unit, *args):
+ """
+ SUPPRESSIONS() - allows to specify files with suppression notation which will be used by
+ address, leak or thread sanitizer runtime by default.
+ Use asan.supp filename for address sanitizer, lsan.supp for leak sanitizer
+ and tsan.supp for thread sanitizer suppressions respectively.
+ See https://clang.llvm.org/docs/AddressSanitizer.html#suppressing-memory-leaks
+ for details.
+ """
+ import os
+
+ valid = ("asan.supp", "tsan.supp", "lsan.supp")
+
+ if unit.get("SANITIZER_TYPE") in ("leak", "address", "thread"):
+ for x in args:
+ if os.path.basename(x) not in valid:
+ unit.message(
+ [
+ 'error',
+ "Invalid suppression filename: {} (any of the following is expected: {})".format(x, valid),
+ ]
+ )
+ return
+ unit.onsrcs(["GLOBAL"] + list(args))