rbe_common.bazelrc 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #@IgnoreInspection BashAddShebang
  2. # Copyright 2018 The gRPC Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # bazelrc with Foundry setting common to both manual run and runs started by Kokoro
  16. # see https://github.com/bazelbuild/bazel-toolchains/tree/master/bazelrc
  17. # for examples and more documentation
  18. startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
  19. build --crosstool_top=@rbe_default//cc:toolchain
  20. build --extra_toolchains=@rbe_default//config:cc-toolchain
  21. # Use custom execution platforms defined in third_party/toolchains
  22. build --extra_execution_platforms=@rbe_default//config:platform
  23. build --host_platform=@rbe_default//config:platform
  24. build --platforms=@rbe_default//config:platform
  25. build --spawn_strategy=remote
  26. build --strategy=Javac=remote
  27. build --strategy=Closure=remote
  28. build --genrule_strategy=remote
  29. build --remote_timeout=7200 # very large value to avoid problems like https://github.com/grpc/grpc/issues/20777
  30. build --remote_instance_name=projects/grpc-testing/instances/default_instance
  31. build --verbose_failures=true
  32. build --experimental_strict_action_env=true
  33. build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
  34. # don't use port server
  35. build --define GRPC_PORT_ISOLATED_RUNTIME=1
  36. # without verbose gRPC logs the test outputs are not very useful
  37. test --test_env=GRPC_VERBOSITY=debug
  38. # we assume the default bazel RBE build is on linux,
  39. # so filter out stuff that should not be built or run there.
  40. build --test_tag_filters=-no_linux
  41. build --build_tag_filters=-no_linux
  42. # address sanitizer: most settings are already in %workspace%/.bazelrc
  43. # we only need a few additional ones that are Foundry specific
  44. build:asan --copt=-gmlt
  45. # use double the default value for "moderate" and "long" timeout as sanitizer
  46. # tests tend to be slower
  47. build:asan --test_timeout=60,600,1800,3600
  48. build:asan --test_tag_filters=-no_linux,-noasan,-qps_json_driver
  49. # memory sanitizer: most settings are already in %workspace%/.bazelrc
  50. # we only need a few additional ones that are Foundry specific
  51. build:msan --copt=-gmlt
  52. # "moderate" timeout 3x the default, "long" timeout 2x the default
  53. build:msan --test_timeout=60,900,1800,3600
  54. # TODO(jtattermusch): revisit the disabled tests
  55. build:msan --test_tag_filters=-no_linux,-nomsan,-json_run_localhost
  56. build:msan --cxxopt=--stdlib=libc++
  57. # setting LD_LIBRARY_PATH is necessary
  58. # to avoid "libc++.so.1: cannot open shared object file"
  59. build:msan --action_env=LD_LIBRARY_PATH=/usr/local/lib
  60. build:msan --host_crosstool_top=@rbe_default//cc:toolchain
  61. # override the config-agnostic crosstool_top
  62. build:msan --crosstool_top=@rbe_msan//cc:toolchain
  63. # thread sanitizer: most settings are already in %workspace%/.bazelrc
  64. # we only need a few additional ones that are Foundry specific
  65. build:tsan --copt=-gmlt
  66. # use double the default value for "moderate" and "long" timeout as sanitizer
  67. # tests tend to be slower
  68. build:tsan --test_timeout=60,600,1800,3600
  69. build:tsan --test_tag_filters=-no_linux,-notsan,-qps_json_driver
  70. # undefined behavior sanitizer: most settings are already in %workspace%/.bazelrc
  71. # we only need a few additional ones that are Foundry specific
  72. build:ubsan --copt=-gmlt
  73. # use double the default value for "moderate" and "long" timeout as sanitizer
  74. # tests tend to be slower
  75. build:ubsan --test_timeout=60,600,1800,3600
  76. # RBE docker image only has a msan specific version of libc++, so to be able to link against it,
  77. # we need to involuntarily enable msan as well to be able to build. See b/200667821
  78. # TODO(jtattermusch): disable memory sanitizer for ubsan build as soon as possible.
  79. build:ubsan --copt=-fsanitize=memory
  80. build:ubsan --copt=-fsanitize-recover=memory
  81. build:ubsan --linkopt=-fsanitize=memory
  82. build:ubsan --cxxopt=--stdlib=libc++
  83. build:ubsan --action_env=MSAN_OPTIONS=halt_on_error=0
  84. build:ubsan --test_tag_filters=-no_linux,-noubsan