WORKSPACE 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. workspace(name = "com_github_grpc_grpc")
  2. load("//bazel:grpc_deps.bzl", "grpc_deps", "grpc_test_only_deps")
  3. grpc_deps()
  4. grpc_test_only_deps()
  5. load("//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
  6. grpc_extra_deps()
  7. register_execution_platforms(
  8. "//third_party/toolchains:rbe_windows",
  9. )
  10. register_toolchains(
  11. "//third_party/toolchains/bazel_0.26.0_rbe_windows:cc-toolchain-x64_windows",
  12. )
  13. load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_exec_properties_dict", "custom_exec_properties", "merge_dicts")
  14. custom_exec_properties(
  15. name = "grpc_custom_exec_properties",
  16. constants = {
  17. "LARGE_MACHINE": merge_dicts(
  18. create_exec_properties_dict(),
  19. # TODO(jtattermusch): specifying 'labels = {"abc": "xyz"}' in create_exec_properties_dict
  20. # is not possible without https://github.com/bazelbuild/bazel-toolchains/pull/748
  21. # and currently the toolchain we're using is too old for that. To be able to select worker
  22. # pools through labels, we use a workaround and populate the corresponding label values
  23. # manually (see create_exec_properties_dict logic for how labels get transformed)
  24. # Remove this workaround once we transition to a new-enough bazel toolchain.
  25. # The next line corresponds to 'labels = {"os": "ubuntu", "machine_size": "large"}'
  26. {"label:os": "ubuntu", "label:machine_size": "large"}
  27. ),
  28. },
  29. )
  30. load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
  31. # Create toolchain configuration for remote execution.
  32. rbe_autoconfig(
  33. name = "rbe_default",
  34. exec_properties = merge_dicts(
  35. create_exec_properties_dict(
  36. docker_add_capabilities = "SYS_PTRACE",
  37. docker_privileged = True,
  38. os_family = "Linux",
  39. ),
  40. # TODO(jtattermusch): specifying 'labels = {"abc": "xyz"}' in create_exec_properties_dict
  41. # is not possible without https://github.com/bazelbuild/bazel-toolchains/pull/748
  42. # and currently the toolchain we're using is too old for that. To be able to select worker
  43. # pools through labels, we use a workaround and populate the corresponding label values
  44. # manually (see create_exec_properties_dict logic for how labels get transformed)
  45. # Remove this workaround once we transition to a new-enough bazel toolchain.
  46. # The next line corresponds to 'labels = {"os": "ubuntu", "machine_size": "small"}'
  47. {"label:os": "ubuntu", "label:machine_size": "small"}
  48. ),
  49. # use exec_properties instead of deprecated remote_execution_properties
  50. use_legacy_platform_definition = False,
  51. )
  52. load("@bazel_toolchains//rules:environments.bzl", "clang_env")
  53. load("@bazel_skylib//lib:dicts.bzl", "dicts")
  54. # Create msan toolchain configuration for remote execution.
  55. rbe_autoconfig(
  56. name = "rbe_msan",
  57. env = dicts.add(
  58. clang_env(),
  59. {
  60. "BAZEL_LINKOPTS": "-lc++:-lc++abi:-lm",
  61. },
  62. ),
  63. )
  64. load("@io_bazel_rules_python//python:pip.bzl", "pip_import", "pip_repositories")
  65. pip_import(
  66. name = "grpc_python_dependencies",
  67. requirements = "@com_github_grpc_grpc//:requirements.bazel.txt",
  68. )
  69. load("@grpc_python_dependencies//:requirements.bzl", "pip_install")
  70. pip_repositories()
  71. pip_install()