How to add executable tool and its environment path to all tests? (sanitizers, symbolizer) #26239
-
Hi! Context. I'm using toolchains_llvm to get an LLVM toolchain to built my code with, which has been working great for both local fixed-toolchain builds and cross-compilation. Now, I want to be able to build and run my test suite (locally, not cross-compiled, at least for now) under the different sanitizers (AddressSanitizer, MemorySanitizer, ThreadSanitizer, UndefinedSanitizer). So far, this pretty much worked out-of-the-box (with a bit of fiddling with flags). But there are some false-positives that I have to exclude through ignorelists, and the ignorelists require that the relevant sanitized binaries have access to a symbolizer (i.e., "llvm-symbolizer"). The toolchains_llvm provides the symbolizer binary and it is available as a Label in Bazel. Question. For example, for AddressSanitizer, I need every test (cc_test) to run with the environment variable Some options that I believe might offer solutions (but I seem to be missing pieces):
I'm hoping there is a much easier way, and that I've missed something obvious. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
--run_under
accepts a label (as well as a shell command) and, at least with a recent rolling release, configures it for the test exec platform (e262d02). Does that work for you?