2
0

.bazelrc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright The OpenTelemetry Authors
  2. # SPDX-License-Identifier: Apache-2.0
  3. # bazel configurations for running tests under sanitizers.
  4. # Based on https://github.com/bazelment/trunk/blob/master/tools/bazel.rc
  5. # Enable automatic configs based on platform
  6. common --enable_platform_specific_config
  7. # Make globs that don't match anything fail
  8. common --incompatible_disallow_empty_glob
  9. # Needed by gRPC to build on some platforms.
  10. build --copt -DGRPC_BAZEL_BUILD
  11. # Workaround abseil libraries missing symbols
  12. build:windows --dynamic_mode=off
  13. # Set minimum supported C++ version
  14. build:macos --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
  15. build:linux --host_cxxopt=-std=c++14 --cxxopt=-std=c++14
  16. build:windows --host_cxxopt=/std:c++14 --cxxopt=/std:c++14
  17. # --config=asan : Address Sanitizer.
  18. common:asan --copt -DADDRESS_SANITIZER
  19. common:asan --copt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
  20. common:asan --copt -fsanitize-address-use-after-scope
  21. common:asan --copt -fno-sanitize-recover=all
  22. common:asan --linkopt -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,null,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound
  23. common:asan --linkopt -fsanitize-address-use-after-scope
  24. common:asan --linkopt -fno-sanitize-recover=all
  25. common:asan --cc_output_directory_tag=asan
  26. # --config=tsan : Thread Sanitizer.
  27. common:tsan --copt -fsanitize=thread
  28. common:tsan --copt -DTHREAD_SANITIZER
  29. common:tsan --linkopt -fsanitize=thread
  30. common:tsan --cc_output_directory_tag=tsan
  31. # This is needed to address false positive problem with abseil.The same setting as gRPC
  32. # https://github.com/google/sanitizers/issues/953
  33. common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0