From ff7d726a919e32eab920dabcb53b52490efcbb63 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 28 Oct 2024 10:45:09 -0700 Subject: [PATCH] [Python Bazel] Use `PyInfo` provider and `py_*` rules from rules_python (#37995) The native one will be removed soon (Bazel 8?). Closes #37995 PiperOrigin-RevId: 690671136 --- bazel/python_rules.bzl | 1 + examples/objective-c/BUILD | 2 +- examples/python/auth/BUILD.bazel | 2 + examples/python/cancellation/BUILD.bazel | 1 + examples/python/compression/BUILD.bazel | 2 + examples/python/data_transmission/BUILD | 2 + examples/python/debug/BUILD.bazel | 2 + examples/python/errors/BUILD.bazel | 1 + examples/python/multiprocessing/BUILD | 1 + examples/python/observability/csm/BUILD.bazel | 1 + examples/python/wait_for_ready/BUILD.bazel | 2 + src/python/grpcio/grpc/BUILD.bazel | 2 + src/python/grpcio/grpc/_cython/BUILD.bazel | 4 +- .../grpcio/grpc/experimental/BUILD.bazel | 2 + src/python/grpcio/grpc/framework/BUILD.bazel | 2 + .../grpcio/grpc/framework/common/BUILD.bazel | 2 + .../grpc/framework/foundation/BUILD.bazel | 2 + .../grpc/framework/interfaces/BUILD.bazel | 2 + .../framework/interfaces/base/BUILD.bazel | 2 + .../framework/interfaces/face/BUILD.bazel | 2 + .../grpcio_admin/grpc_admin/BUILD.bazel | 2 + .../grpc_channelz/v1/BUILD.bazel | 1 + src/python/grpcio_csds/grpc_csds/BUILD.bazel | 2 + .../grpc_csm_observability/BUILD.bazel | 1 + .../grpc_health/v1/BUILD.bazel | 1 + .../grpc_observability/BUILD.bazel | 1 + .../grpc_reflection/v1alpha/BUILD.bazel | 1 + .../grpcio_status/grpc_status/BUILD.bazel | 1 + src/python/grpcio_tests/tests/BUILD.bazel | 2 + .../grpcio_tests/tests/admin/BUILD.bazel | 2 + .../grpcio_tests/tests/channelz/BUILD.bazel | 2 + .../grpcio_tests/tests/csds/BUILD.bazel | 2 + .../grpcio_tests/tests/fork/BUILD.bazel | 1 + .../tests/health_check/BUILD.bazel | 2 + .../grpcio_tests/tests/interop/BUILD.bazel | 1 + .../tests/observability/BUILD.bazel | 1 + src/python/grpcio_tests/tests/qps/BUILD.bazel | 2 + .../grpcio_tests/tests/reflection/BUILD.bazel | 1 + .../grpcio_tests/tests/status/BUILD.bazel | 1 + .../grpcio_tests/tests/stress/BUILD.bazel | 4 +- .../grpcio_tests/tests/testing/BUILD.bazel | 2 + .../grpcio_tests/tests/unit/BUILD.bazel | 3 +- .../tests/unit/_cython/BUILD.bazel | 2 + .../tests/unit/framework/common/BUILD.bazel | 2 + .../unit/framework/foundation/BUILD.bazel | 2 + .../tests_aio/benchmark/BUILD.bazel | 2 + .../tests_aio/channelz/BUILD.bazel | 2 + .../tests_aio/health_check/BUILD.bazel | 2 + .../tests_aio/interop/BUILD.bazel | 1 + .../tests_aio/reflection/BUILD.bazel | 2 + .../grpcio_tests/tests_aio/status/BUILD.bazel | 1 + .../grpcio_tests/tests_aio/unit/BUILD.bazel | 2 + .../tests_py3_only/interop/BUILD.bazel | 1 + .../tests_py3_only/unit/BUILD.bazel | 2 + test/distrib/bazel/cpp/protos/BUILD | 2 +- test/distrib/bazel/python/BUILD | 3 +- .../python/namespaced/upper/example/BUILD | 3 +- .../bazel/python/python_rules_test.bzl | 1 + third_party/py/BUILD | 2 +- third_party/toolchains/BUILD | 23 +- .../toolchains/rbe_ubuntu2004/cc/BUILD | 148 +++++---- .../toolchains/rbe_ubuntu2004/config/BUILD | 3 +- .../rbe_windows_bazel_6.3.2_vs2019/cc/BUILD | 314 +++++++++--------- .../config/BUILD | 3 +- third_party/upb/upb/BUILD | 1 - third_party/upb/upb/bazel/BUILD | 1 - third_party/upb/upb/cmake/BUILD.bazel | 1 + tools/distrib/python/grpcio_tools/BUILD.bazel | 1 + .../grpcio_tools/grpc_tools/test/BUILD.bazel | 1 + tools/distrib/python/xds_protos/BUILD.bazel | 2 + 70 files changed, 363 insertions(+), 240 deletions(-) diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index e195d2790b6..f5fa1a05509 100644 --- a/bazel/python_rules.bzl +++ b/bazel/python_rules.bzl @@ -14,6 +14,7 @@ """Generates and compiles Python gRPC stubs from proto_library rules.""" load("@rules_proto//proto:defs.bzl", "ProtoInfo") +load("@rules_python//python:py_info.bzl", "PyInfo") load( "//bazel:protobuf.bzl", "declare_out_files", diff --git a/examples/objective-c/BUILD b/examples/objective-c/BUILD index 1bcac950ff6..945a5086777 100644 --- a/examples/objective-c/BUILD +++ b/examples/objective-c/BUILD @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@com_github_grpc_grpc//bazel:objc_grpc_library.bzl", "objc_grpc_library") load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") load("@build_bazel_rules_apple//apple:macos.bzl", "macos_application") +load("@com_github_grpc_grpc//bazel:objc_grpc_library.bzl", "objc_grpc_library") licenses(["notice"]) diff --git a/examples/python/auth/BUILD.bazel b/examples/python/auth/BUILD.bazel index 0ed770b827d..29b0f1d9cbc 100644 --- a/examples/python/auth/BUILD.bazel +++ b/examples/python/auth/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") + filegroup( name = "_credentials_files", testonly = 1, diff --git a/examples/python/cancellation/BUILD.bazel b/examples/python/cancellation/BUILD.bazel index 3eb7a8fdf3e..dbb4d84424c 100644 --- a/examples/python/cancellation/BUILD.bazel +++ b/examples/python/cancellation/BUILD.bazel @@ -15,6 +15,7 @@ # limitations under the License. load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") package(default_testonly = 1) diff --git a/examples/python/compression/BUILD.bazel b/examples/python/compression/BUILD.bazel index beba230ba5f..20e22763dc6 100644 --- a/examples/python/compression/BUILD.bazel +++ b/examples/python/compression/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_test") + py_binary( name = "server", srcs = ["server.py"], diff --git a/examples/python/data_transmission/BUILD b/examples/python/data_transmission/BUILD index c8c4134eaac..caabf4df4f8 100644 --- a/examples/python/data_transmission/BUILD +++ b/examples/python/data_transmission/BUILD @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary") + licenses(["notice"]) py_binary( diff --git a/examples/python/debug/BUILD.bazel b/examples/python/debug/BUILD.bazel index 680fad26bfc..20aa9daec00 100644 --- a/examples/python/debug/BUILD.bazel +++ b/examples/python/debug/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_test") + package(default_testonly = 1) py_binary( diff --git a/examples/python/errors/BUILD.bazel b/examples/python/errors/BUILD.bazel index e1026426b07..c2ae8f52c07 100644 --- a/examples/python/errors/BUILD.bazel +++ b/examples/python/errors/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library", "py_test") py_library( name = "client", diff --git a/examples/python/multiprocessing/BUILD b/examples/python/multiprocessing/BUILD index 6e9af7de06d..e0d62184651 100644 --- a/examples/python/multiprocessing/BUILD +++ b/examples/python/multiprocessing/BUILD @@ -15,6 +15,7 @@ # limitations under the License. load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_python//python:defs.bzl", "py_binary", "py_test") load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") proto_library( diff --git a/examples/python/observability/csm/BUILD.bazel b/examples/python/observability/csm/BUILD.bazel index 63ad4e75b9b..fa139f2fe09 100644 --- a/examples/python/observability/csm/BUILD.bazel +++ b/examples/python/observability/csm/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_binary") # TODO(xuanwn): Instead of using Bazel build, we should pip install all dependencies # once we have a released version of grpcio-csm-observability. diff --git a/examples/python/wait_for_ready/BUILD.bazel b/examples/python/wait_for_ready/BUILD.bazel index e36d05dee9e..e33581ea408 100644 --- a/examples/python/wait_for_ready/BUILD.bazel +++ b/examples/python/wait_for_ready/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_test") + package(default_testonly = 1) py_binary( diff --git a/src/python/grpcio/grpc/BUILD.bazel b/src/python/grpcio/grpc/BUILD.bazel index 75961b3effc..e142f82b4a2 100644 --- a/src/python/grpcio/grpc/BUILD.bazel +++ b/src/python/grpcio/grpc/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/_cython/BUILD.bazel b/src/python/grpcio/grpc/_cython/BUILD.bazel index 8b2471a0a01..52740967bc3 100644 --- a/src/python/grpcio/grpc/_cython/BUILD.bazel +++ b/src/python/grpcio/grpc/_cython/BUILD.bazel @@ -1,5 +1,3 @@ -load("//bazel:cython_library.bzl", "pyx_library") - # Copyright 2021 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,6 +11,8 @@ load("//bazel:cython_library.bzl", "pyx_library") # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("//bazel:cython_library.bzl", "pyx_library") + package(default_visibility = ["//visibility:public"]) genrule( diff --git a/src/python/grpcio/grpc/experimental/BUILD.bazel b/src/python/grpcio/grpc/experimental/BUILD.bazel index 48a9f5304d5..1b484340082 100644 --- a/src/python/grpcio/grpc/experimental/BUILD.bazel +++ b/src/python/grpcio/grpc/experimental/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/BUILD.bazel b/src/python/grpcio/grpc/framework/BUILD.bazel index ad34d06c229..4b4fbc1cc68 100644 --- a/src/python/grpcio/grpc/framework/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/common/BUILD.bazel b/src/python/grpcio/grpc/framework/common/BUILD.bazel index 4d2ee71ee21..e125a947373 100644 --- a/src/python/grpcio/grpc/framework/common/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/common/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/foundation/BUILD.bazel b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel index 285aa0bf083..3be3a30dda3 100644 --- a/src/python/grpcio/grpc/framework/foundation/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/foundation/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel index 647662a42f3..9bc5672f6a6 100644 --- a/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/interfaces/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel index 311dc8bc261..1cf13509c05 100644 --- a/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/interfaces/base/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel index 3d4b3b64a4f..9d2149c0c0d 100644 --- a/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel +++ b/src/python/grpcio/grpc/framework/interfaces/face/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_admin/grpc_admin/BUILD.bazel b/src/python/grpcio_admin/grpc_admin/BUILD.bazel index bd81a665497..bb693b58ec4 100644 --- a/src/python/grpcio_admin/grpc_admin/BUILD.bazel +++ b/src/python/grpcio_admin/grpc_admin/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel index ba3429b0b8e..d1d32b07cc2 100644 --- a/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel +++ b/src/python/grpcio_channelz/grpc_channelz/v1/BUILD.bazel @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_csds/grpc_csds/BUILD.bazel b/src/python/grpcio_csds/grpc_csds/BUILD.bazel index f258eb30fc8..8955239e044 100644 --- a/src/python/grpcio_csds/grpc_csds/BUILD.bazel +++ b/src/python/grpcio_csds/grpc_csds/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_csm_observability/grpc_csm_observability/BUILD.bazel b/src/python/grpcio_csm_observability/grpc_csm_observability/BUILD.bazel index 8d65857630f..4a7fdb9ce29 100644 --- a/src/python/grpcio_csm_observability/grpc_csm_observability/BUILD.bazel +++ b/src/python/grpcio_csm_observability/grpc_csm_observability/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library") package(default_visibility = ["//:__subpackages__"]) diff --git a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel index f82edaa6ab5..35f6f85f45a 100644 --- a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel +++ b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_observability/grpc_observability/BUILD.bazel b/src/python/grpcio_observability/grpc_observability/BUILD.bazel index f6144418273..3d812d7f4cf 100644 --- a/src/python/grpcio_observability/grpc_observability/BUILD.bazel +++ b/src/python/grpcio_observability/grpc_observability/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library") load("//bazel:cython_library.bzl", "pyx_library") package(default_visibility = ["//visibility:private"]) diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel index b94377120bd..07c5f48f970 100644 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_status/grpc_status/BUILD.bazel b/src/python/grpcio_status/grpc_status/BUILD.bazel index 36b57044577..e1fa9d299f1 100644 --- a/src/python/grpcio_status/grpc_status/BUILD.bazel +++ b/src/python/grpcio_status/grpc_status/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/BUILD.bazel b/src/python/grpcio_tests/tests/BUILD.bazel index 21b5306a258..b6da2bf0111 100644 --- a/src/python/grpcio_tests/tests/BUILD.bazel +++ b/src/python/grpcio_tests/tests/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + py_library( name = "bazel_namespace_package_hack", srcs = ["bazel_namespace_package_hack.py"], diff --git a/src/python/grpcio_tests/tests/admin/BUILD.bazel b/src/python/grpcio_tests/tests/admin/BUILD.bazel index a21c8505f33..ed424971481 100644 --- a/src/python/grpcio_tests/tests/admin/BUILD.bazel +++ b/src/python/grpcio_tests/tests/admin/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + py_test( name = "admin_test", size = "small", diff --git a/src/python/grpcio_tests/tests/channelz/BUILD.bazel b/src/python/grpcio_tests/tests/channelz/BUILD.bazel index 39c65bf7b24..6f19f4b0406 100644 --- a/src/python/grpcio_tests/tests/channelz/BUILD.bazel +++ b/src/python/grpcio_tests/tests/channelz/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package(default_visibility = ["//visibility:public"]) py_test( diff --git a/src/python/grpcio_tests/tests/csds/BUILD.bazel b/src/python/grpcio_tests/tests/csds/BUILD.bazel index 7a2d647dcce..495956afa20 100644 --- a/src/python/grpcio_tests/tests/csds/BUILD.bazel +++ b/src/python/grpcio_tests/tests/csds/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + py_test( name = "csds_test", size = "small", diff --git a/src/python/grpcio_tests/tests/fork/BUILD.bazel b/src/python/grpcio_tests/tests/fork/BUILD.bazel index 5c7b24de9fe..bfead2cf680 100644 --- a/src/python/grpcio_tests/tests/fork/BUILD.bazel +++ b/src/python/grpcio_tests/tests/fork/BUILD.bazel @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") load("//bazel:cython_library.bzl", "pyx_library") pyx_library( diff --git a/src/python/grpcio_tests/tests/health_check/BUILD.bazel b/src/python/grpcio_tests/tests/health_check/BUILD.bazel index 91eeeced529..e98f2be2ec1 100644 --- a/src/python/grpcio_tests/tests/health_check/BUILD.bazel +++ b/src/python/grpcio_tests/tests/health_check/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package(default_visibility = ["//visibility:public"]) py_test( diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel index 75366d67c4a..fc1f327ce81 100644 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/observability/BUILD.bazel b/src/python/grpcio_tests/tests/observability/BUILD.bazel index 20914412e2e..3baa2ad44a6 100644 --- a/src/python/grpcio_tests/tests/observability/BUILD.bazel +++ b/src/python/grpcio_tests/tests/observability/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library", "py_test") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/qps/BUILD.bazel b/src/python/grpcio_tests/tests/qps/BUILD.bazel index 9285b0fc119..d99644af05b 100644 --- a/src/python/grpcio_tests/tests/qps/BUILD.bazel +++ b/src/python/grpcio_tests/tests/qps/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_library") + package( default_testonly = 1, default_visibility = ["//visibility:public"], diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel index 5505a8bca56..d3145049e58 100644 --- a/src/python/grpcio_tests/tests/reflection/BUILD.bazel +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_test") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/status/BUILD.bazel b/src/python/grpcio_tests/tests/status/BUILD.bazel index 307cb34f48c..cd9acf2faf9 100644 --- a/src/python/grpcio_tests/tests/status/BUILD.bazel +++ b/src/python/grpcio_tests/tests/status/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_test") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/stress/BUILD.bazel b/src/python/grpcio_tests/tests/stress/BUILD.bazel index 94ae6fe3804..8cde71f774e 100644 --- a/src/python/grpcio_tests/tests/stress/BUILD.bazel +++ b/src/python/grpcio_tests/tests/stress/BUILD.bazel @@ -1,5 +1,3 @@ -load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") - # Copyright 2021 The gRPC Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +11,9 @@ load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_pro # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_python//python:defs.bzl", "py_binary") proto_library( name = "unary_stream_benchmark_proto", diff --git a/src/python/grpcio_tests/tests/testing/BUILD.bazel b/src/python/grpcio_tests/tests/testing/BUILD.bazel index 1521270e6a3..e3aac5c06f1 100644 --- a/src/python/grpcio_tests/tests/testing/BUILD.bazel +++ b/src/python/grpcio_tests/tests/testing/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index de04e87b41a..60b93be6cdd 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -11,8 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -load("//bazel:internal_python_rules.bzl", "internal_py_grpc_test") load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_library") +load("//bazel:internal_python_rules.bzl", "internal_py_grpc_test") package(default_visibility = ["//visibility:public"]) diff --git a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel index 4ec9a00e760..69e0db67494 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library", "py_test") + package(default_visibility = ["//visibility:public"]) GRPCIO_TESTS_UNIT_CYTHON = [ diff --git a/src/python/grpcio_tests/tests/unit/framework/common/BUILD.bazel b/src/python/grpcio_tests/tests/unit/framework/common/BUILD.bazel index 809d90d0d06..475ea087c64 100644 --- a/src/python/grpcio_tests/tests/unit/framework/common/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/framework/common/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel index 9fae83d444e..b84b697a359 100644 --- a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel @@ -11,6 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library", "py_test") + package(default_visibility = ["//visibility:public"]) py_library( diff --git a/src/python/grpcio_tests/tests_aio/benchmark/BUILD.bazel b/src/python/grpcio_tests/tests_aio/benchmark/BUILD.bazel index e0cb07c3357..a3e4f4388d1 100644 --- a/src/python/grpcio_tests/tests_aio/benchmark/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/benchmark/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_binary", "py_library") + package( default_testonly = 1, default_visibility = ["//visibility:public"], diff --git a/src/python/grpcio_tests/tests_aio/channelz/BUILD.bazel b/src/python/grpcio_tests/tests_aio/channelz/BUILD.bazel index 2ead714e446..da57cb44545 100644 --- a/src/python/grpcio_tests/tests_aio/channelz/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/channelz/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package(default_visibility = ["//visibility:public"]) py_test( diff --git a/src/python/grpcio_tests/tests_aio/health_check/BUILD.bazel b/src/python/grpcio_tests/tests_aio/health_check/BUILD.bazel index 4e1b088d0b8..bf006aab364 100644 --- a/src/python/grpcio_tests/tests_aio/health_check/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/health_check/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package(default_testonly = 1) py_test( diff --git a/src/python/grpcio_tests/tests_aio/interop/BUILD.bazel b/src/python/grpcio_tests/tests_aio/interop/BUILD.bazel index 4b908ecd47f..513b9712466 100644 --- a/src/python/grpcio_tests/tests_aio/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/interop/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test") package(default_testonly = 1) diff --git a/src/python/grpcio_tests/tests_aio/reflection/BUILD.bazel b/src/python/grpcio_tests/tests_aio/reflection/BUILD.bazel index 88bf8cc903f..e93c02f1a96 100644 --- a/src/python/grpcio_tests/tests_aio/reflection/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/reflection/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package(default_testonly = 1) py_test( diff --git a/src/python/grpcio_tests/tests_aio/status/BUILD.bazel b/src/python/grpcio_tests/tests_aio/status/BUILD.bazel index 2fd82f2684c..a8501ea0dad 100644 --- a/src/python/grpcio_tests/tests_aio/status/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/status/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_test") py_test( name = "grpc_status_test", diff --git a/src/python/grpcio_tests/tests_aio/unit/BUILD.bazel b/src/python/grpcio_tests/tests_aio/unit/BUILD.bazel index 580cfca60f3..901aa57ec10 100644 --- a/src/python/grpcio_tests/tests_aio/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests_aio/unit/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library", "py_test") + package( default_testonly = 1, default_visibility = ["//visibility:public"], diff --git a/src/python/grpcio_tests/tests_py3_only/interop/BUILD.bazel b/src/python/grpcio_tests/tests_py3_only/interop/BUILD.bazel index ef1320a70c7..cfa9b32a1a5 100644 --- a/src/python/grpcio_tests/tests_py3_only/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests_py3_only/interop/BUILD.bazel @@ -13,6 +13,7 @@ # limitations under the License. load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@rules_python//python:defs.bzl", "py_binary", "py_test") py_binary( name = "xds_interop_client", diff --git a/src/python/grpcio_tests/tests_py3_only/unit/BUILD.bazel b/src/python/grpcio_tests/tests_py3_only/unit/BUILD.bazel index 86b4b02c429..4f1be4bdc56 100644 --- a/src/python/grpcio_tests/tests_py3_only/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests_py3_only/unit/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") + package( default_testonly = True, ) diff --git a/test/distrib/bazel/cpp/protos/BUILD b/test/distrib/bazel/cpp/protos/BUILD index 5923542b55c..936758a4ebc 100644 --- a/test/distrib/bazel/cpp/protos/BUILD +++ b/test/distrib/bazel/cpp/protos/BUILD @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_proto//proto:defs.bzl", "proto_library") load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") +load("@rules_proto//proto:defs.bzl", "proto_library") licenses(["notice"]) diff --git a/test/distrib/bazel/python/BUILD b/test/distrib/bazel/python/BUILD index 39634b0e633..83b477e4457 100644 --- a/test/distrib/bazel/python/BUILD +++ b/test/distrib/bazel/python/BUILD @@ -14,12 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_proto//proto:defs.bzl", "proto_library") load( "@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library", ) +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_python//python:defs.bzl", "py_library", "py_test") load("//:python_rules_test.bzl", "python_rules_test_suite") package( diff --git a/test/distrib/bazel/python/namespaced/upper/example/BUILD b/test/distrib/bazel/python/namespaced/upper/example/BUILD index 942c2f11844..9fe323ecff8 100644 --- a/test/distrib/bazel/python/namespaced/upper/example/BUILD +++ b/test/distrib/bazel/python/namespaced/upper/example/BUILD @@ -14,12 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_proto//proto:defs.bzl", "proto_library") load( "@com_github_grpc_grpc//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library", ) +load("@rules_proto//proto:defs.bzl", "proto_library") +load("@rules_python//python:defs.bzl", "py_test") _IMPORT_PREFIX = "foo/bar" diff --git a/test/distrib/bazel/python/python_rules_test.bzl b/test/distrib/bazel/python/python_rules_test.bzl index afb35c8edf8..a0e85afc0f8 100644 --- a/test/distrib/bazel/python/python_rules_test.bzl +++ b/test/distrib/bazel/python/python_rules_test.bzl @@ -14,6 +14,7 @@ """Bazel rule tests of bazel/python_rules.bzl""" load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") +load("@rules_python//python:py_info.bzl", "PyInfo") def _assert_in(env, item, container): asserts.true( diff --git a/third_party/py/BUILD b/third_party/py/BUILD index 6ab5124ce3c..9d87fb88594 100644 --- a/third_party/py/BUILD +++ b/third_party/py/BUILD @@ -1,5 +1,5 @@ exports_files([ "BUILD.tpl", "python_configure.bzl", - "variety.tpl" + "variety.tpl", ]) diff --git a/third_party/toolchains/BUILD b/third_party/toolchains/BUILD index 97ac9afba0a..6dc99427f4b 100644 --- a/third_party/toolchains/BUILD +++ b/third_party/toolchains/BUILD @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict") + licenses(["notice"]) # Apache v2 package(default_visibility = ["//visibility:public"]) -load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict") - # The default toolchain suite for RBE linux, pass it to --crosstool_top alias( name = "rbe_linux_default_toolchain_suite", @@ -32,10 +32,8 @@ alias( # The default platform for RBE Linux platform( - name = "rbe_linux_default_platform", - # Inherit from the platform target generated by 'rbe_configs_gen'. - parents = ["//third_party/toolchains/rbe_ubuntu2004/config:platform"], - exec_properties = create_rbe_exec_properties_dict( + name = "rbe_linux_default_platform", + exec_properties = create_rbe_exec_properties_dict( docker_add_capabilities = "SYS_PTRACE", docker_privileged = True, # by default, all RBE actions will run on "small" workers. @@ -47,6 +45,8 @@ platform( }, os_family = "Linux", ), + # Inherit from the platform target generated by 'rbe_configs_gen'. + parents = ["//third_party/toolchains/rbe_ubuntu2004/config:platform"], ) # The default toolchain suite for RBE windows, pass it to --crosstool_top @@ -64,11 +64,14 @@ alias( # The default platform for RBE windows platform( name = "rbe_windows_default_platform", - # Inherit from the platform target generated by 'rbe_configs_gen'. - parents = ["//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:platform"], exec_properties = create_rbe_exec_properties_dict( - os_family = "Windows", # by default, all RBE actions will run on "small" workers. - labels = {"os": "windows_2019", "machine_size": "small"}, + labels = { + "os": "windows_2019", + "machine_size": "small", + }, + os_family = "Windows", ), + # Inherit from the platform target generated by 'rbe_configs_gen'. + parents = ["//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:platform"], ) diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/BUILD b/third_party/toolchains/rbe_ubuntu2004/cc/BUILD index 3e91221432a..f993e63333e 100644 --- a/third_party/toolchains/rbe_ubuntu2004/cc/BUILD +++ b/third_party/toolchains/rbe_ubuntu2004/cc/BUILD @@ -14,9 +14,9 @@ # This becomes the BUILD file for @local_config_cc// under non-BSD unixes. -load(":cc_toolchain_config.bzl", "cc_toolchain_config") -load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") +load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") +load(":cc_toolchain_config.bzl", "cc_toolchain_config") package(default_visibility = ["//visibility:public"]) @@ -56,8 +56,13 @@ filegroup( filegroup( name = "compiler_deps", - srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths", - ":cc_wrapper"], + srcs = glob( + ["extra_tools/**"], + allow_empty = True, + ) + [ + ":builtin_include_directory_paths", + ":cc_wrapper", + ], ) # This is the entry point for --crosstool_top. Toolchains are found @@ -75,42 +80,87 @@ cc_toolchain_suite( cc_toolchain( name = "cc-compiler-k8", - toolchain_identifier = "linux_gnu_x86", - toolchain_config = ":linux_gnu_x86", all_files = ":compiler_deps", ar_files = ":compiler_deps", as_files = ":compiler_deps", compiler_files = ":compiler_deps", dwp_files = ":empty", linker_files = ":compiler_deps", + module_map = ":module.modulemap", objcopy_files = ":empty", strip_files = ":empty", supports_header_parsing = 1, supports_param_files = 1, - module_map = ":module.modulemap", + toolchain_config = ":linux_gnu_x86", + toolchain_identifier = "linux_gnu_x86", ) cc_toolchain_config( name = "linux_gnu_x86", - cpu = "k8", + abi_libc_version = "glibc_2.19", + abi_version = "clang", + compile_flags = [ + "-fstack-protector", + "-Wall", + "-Wthread-safety", + "-Wself-assign", + "-Wunused-but-set-parameter", + "-Wno-free-nonheap-object", + "-fcolor-diagnostics", + "-fno-omit-frame-pointer", + ], compiler = "clang", - toolchain_identifier = "linux_gnu_x86", + conly_flags = [], + coverage_compile_flags = ["--coverage"], + coverage_link_flags = ["--coverage"], + cpu = "k8", + cxx_builtin_include_directories = [ + "/usr/local/lib/clang/19/include", + "/usr/local/include", + "/usr/include/x86_64-linux-gnu", + "/usr/include", + "/usr/local/lib/clang/19/share", + "/usr/include/c++/9", + "/usr/include/x86_64-linux-gnu/c++/9", + "/usr/include/c++/9/backward", + "/usr/local/include/c++/v1", + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", + ], + cxx_flags = ["-std=c++14"], + dbg_compile_flags = ["-g"], + extra_flags_per_feature = {"use_module_maps": [ + "-Xclang", + "-fno-cxx-modules", + ]}, host_system_name = "i686-unknown-linux-gnu", - target_system_name = "x86_64-unknown-linux-gnu", + link_flags = [ + "-fuse-ld=/usr/local/bin/ld.lld", + "-B/usr/local/bin", + "-Wl,-no-as-needed", + "-Wl,-z,relro,-z,now", + ], + link_libs = [ + "-Wl,--push-state,-as-needed", + "-lstdc++", + "-Wl,--pop-state", + "-Wl,--push-state,-as-needed", + "-lm", + "-Wl,--pop-state", + ], + opt_compile_flags = [ + "-g0", + "-O2", + "-D_FORTIFY_SOURCE=1", + "-DNDEBUG", + "-ffunction-sections", + "-fdata-sections", + ], + opt_link_flags = ["-Wl,--gc-sections"], + supports_start_end_lib = True, target_libc = "glibc_2.19", - abi_version = "clang", - abi_libc_version = "glibc_2.19", - cxx_builtin_include_directories = ["/usr/local/lib/clang/19/include", - "/usr/local/include", - "/usr/include/x86_64-linux-gnu", - "/usr/include", - "/usr/local/lib/clang/19/share", - "/usr/include/c++/9", - "/usr/include/x86_64-linux-gnu/c++/9", - "/usr/include/c++/9/backward", - "/usr/local/include/c++/v1", - "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"], - tool_paths = {"ar": "/usr/bin/ar", + target_system_name = "x86_64-unknown-linux-gnu", + tool_paths = { + "ar": "/usr/bin/ar", "ld": "/usr/bin/ld", "llvm-cov": "/usr/local/bin/llvm-cov", "llvm-profdata": "/usr/local/bin/llvm-profdata", @@ -122,51 +172,21 @@ cc_toolchain_config( "objcopy": "/usr/bin/objcopy", "objdump": "/usr/bin/objdump", "strip": "/usr/bin/strip", - "parse_headers": "cc_wrapper.sh"}, - compile_flags = ["-fstack-protector", - "-Wall", - "-Wthread-safety", - "-Wself-assign", - "-Wunused-but-set-parameter", - "-Wno-free-nonheap-object", - "-fcolor-diagnostics", - "-fno-omit-frame-pointer"], - opt_compile_flags = ["-g0", - "-O2", - "-D_FORTIFY_SOURCE=1", - "-DNDEBUG", - "-ffunction-sections", - "-fdata-sections"], - dbg_compile_flags = ["-g"], - conly_flags = [], - cxx_flags = ["-std=c++14"], - link_flags = ["-fuse-ld=/usr/local/bin/ld.lld", - "-B/usr/local/bin", - "-Wl,-no-as-needed", - "-Wl,-z,relro,-z,now"], - link_libs = ["-Wl,--push-state,-as-needed", - "-lstdc++", - "-Wl,--pop-state", - "-Wl,--push-state,-as-needed", - "-lm", - "-Wl,--pop-state"], - opt_link_flags = ["-Wl,--gc-sections"], - unfiltered_compile_flags = ["-no-canonical-prefixes", - "-Wno-builtin-macro-redefined", - "-D__DATE__=\"redacted\"", - "-D__TIMESTAMP__=\"redacted\"", - "-D__TIME__=\"redacted\""], - coverage_compile_flags = ["--coverage"], - coverage_link_flags = ["--coverage"], - supports_start_end_lib = True, - extra_flags_per_feature = {"use_module_maps": ["-Xclang", "-fno-cxx-modules"]}, + "parse_headers": "cc_wrapper.sh", + }, + toolchain_identifier = "linux_gnu_x86", + unfiltered_compile_flags = [ + "-no-canonical-prefixes", + "-Wno-builtin-macro-redefined", + "-D__DATE__=\"redacted\"", + "-D__TIMESTAMP__=\"redacted\"", + "-D__TIME__=\"redacted\"", + ], ) # Android tooling requires a default toolchain for the armeabi-v7a cpu. cc_toolchain( name = "cc-compiler-armeabi-v7a", - toolchain_identifier = "stub_armeabi-v7a", - toolchain_config = ":stub_armeabi-v7a", all_files = ":empty", ar_files = ":empty", as_files = ":empty", @@ -176,6 +196,8 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":stub_armeabi-v7a", + toolchain_identifier = "stub_armeabi-v7a", ) armeabi_cc_toolchain_config(name = "stub_armeabi-v7a") diff --git a/third_party/toolchains/rbe_ubuntu2004/config/BUILD b/third_party/toolchains/rbe_ubuntu2004/config/BUILD index c674b6e64ea..6e61e647c17 100755 --- a/third_party/toolchains/rbe_ubuntu2004/config/BUILD +++ b/third_party/toolchains/rbe_ubuntu2004/config/BUILD @@ -17,7 +17,6 @@ package(default_visibility = ["//visibility:public"]) - toolchain( name = "cc-toolchain", exec_compatible_with = [ @@ -35,7 +34,6 @@ toolchain( platform( name = "platform", - parents = ["@local_config_platform//:host"], constraint_values = [ "@platforms//os:linux", "@platforms//cpu:x86_64", @@ -45,4 +43,5 @@ platform( "container-image": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68", "OSFamily": "Linux", }, + parents = ["@local_config_platform//:host"], ) diff --git a/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc/BUILD b/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc/BUILD index d61eb817175..2f447968744 100755 --- a/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc/BUILD +++ b/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc/BUILD @@ -14,9 +14,9 @@ # This becomes the BUILD file for @local_config_cc// under Windows. -load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite", "cc_library") -load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite") load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") +load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config") package(default_visibility = ["//visibility:public"]) @@ -31,17 +31,17 @@ filegroup( filegroup( name = "mingw_compiler_files", - srcs = [":builtin_include_directory_paths_mingw"] + srcs = [":builtin_include_directory_paths_mingw"], ) filegroup( name = "clangcl_compiler_files", - srcs = [":builtin_include_directory_paths_clangcl"] + srcs = [":builtin_include_directory_paths_clangcl"], ) filegroup( name = "msvc_compiler_files", - srcs = [":builtin_include_directory_paths_msvc"] + srcs = [":builtin_include_directory_paths_msvc"], ) # Hardcoded toolchain, legacy behaviour. @@ -71,8 +71,6 @@ cc_toolchain_suite( cc_toolchain( name = "cc-compiler-x64_windows_msys", - toolchain_identifier = "msys_x64", - toolchain_config = ":msys_x64", all_files = ":empty", ar_files = ":empty", as_files = ":mingw_compiler_files", @@ -82,20 +80,27 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":msys_x64", + toolchain_identifier = "msys_x64", ) cc_toolchain_config( name = "msys_x64", - cpu = "x64_windows", + abi_libc_version = "local", + abi_version = "local", compiler = "msys-gcc", + cpu = "x64_windows", + cxx_builtin_include_directories = [ + "c:/msys64/usr/", + ], + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", host_system_name = "local", - target_system_name = "local", target_libc = "msys", - abi_version = "local", - abi_libc_version = "local", - cxx_builtin_include_directories = [ "c:/msys64/usr/", - ], - tool_paths = {"ar": "c:/msys64/usr/bin/ar", + target_system_name = "local", + tool_bin_path = "c:/msys64/usr/bin", + tool_paths = { + "ar": "c:/msys64/usr/bin/ar", "cpp": "c:/msys64/usr/bin/cpp", "dwp": "c:/msys64/usr/bin/dwp", "gcc": "c:/msys64/usr/bin/gcc", @@ -104,10 +109,8 @@ cc_toolchain_config( "nm": "c:/msys64/usr/bin/nm", "objcopy": "c:/msys64/usr/bin/objcopy", "objdump": "c:/msys64/usr/bin/objdump", - "strip": "c:/msys64/usr/bin/strip"}, - tool_bin_path = "c:/msys64/usr/bin", - dbg_mode_debug_flag = "/DEBUG:FULL", - fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + "strip": "c:/msys64/usr/bin/strip", + }, ) toolchain( @@ -127,8 +130,6 @@ toolchain( cc_toolchain( name = "cc-compiler-x64_windows_mingw", - toolchain_identifier = "msys_x64_mingw", - toolchain_config = ":msys_x64_mingw", all_files = ":empty", ar_files = ":empty", as_files = ":mingw_compiler_files", @@ -138,21 +139,27 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 0, + toolchain_config = ":msys_x64_mingw", + toolchain_identifier = "msys_x64_mingw", ) cc_toolchain_config( name = "msys_x64_mingw", - cpu = "x64_windows", + abi_libc_version = "local", + abi_version = "local", compiler = "mingw-gcc", + cpu = "x64_windows", + cxx_builtin_include_directories = [ + "c:/msys64/mingw64/", + ], + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", host_system_name = "local", - target_system_name = "local", target_libc = "mingw", - abi_version = "local", - abi_libc_version = "local", + target_system_name = "local", tool_bin_path = "c:/msys64/mingw64/bin", - cxx_builtin_include_directories = [ "c:/msys64/mingw64/", - ], - tool_paths = {"ar": "c:/msys64/mingw64/bin/ar", + tool_paths = { + "ar": "c:/msys64/mingw64/bin/ar", "cpp": "c:/msys64/mingw64/bin/cpp", "dwp": "c:/msys64/mingw64/bin/dwp", "gcc": "c:/msys64/mingw64/bin/gcc", @@ -161,9 +168,8 @@ cc_toolchain_config( "nm": "c:/msys64/mingw64/bin/nm", "objcopy": "c:/msys64/mingw64/bin/objcopy", "objdump": "c:/msys64/mingw64/bin/objdump", - "strip": "c:/msys64/mingw64/bin/strip"}, - dbg_mode_debug_flag = "/DEBUG:FULL", - fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + "strip": "c:/msys64/mingw64/bin/strip", + }, ) toolchain( @@ -183,8 +189,6 @@ toolchain( cc_toolchain( name = "cc-compiler-x64_windows", - toolchain_identifier = "msvc_x64", - toolchain_config = ":msvc_x64", all_files = ":empty", ar_files = ":empty", as_files = ":msvc_compiler_files", @@ -194,32 +198,39 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":msvc_x64", + toolchain_identifier = "msvc_x64", ) cc_toolchain_config( name = "msvc_x64", - cpu = "x64_windows", - compiler = "msvc-cl", - host_system_name = "local", - target_system_name = "local", - target_libc = "msvcrt", - abi_version = "local", abi_libc_version = "local", - toolchain_identifier = "msvc_x64", - msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", - msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", - msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", - msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x64", - msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", - msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe", - msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe", - msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe", - cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", + abi_version = "local", + archiver_flags = ["/MACHINE:X64"], + compiler = "msvc-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = [ + "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt"], + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", + ], + dbg_mode_debug_flag = "/DEBUG:FULL", + default_link_flags = ["/MACHINE:X64"], + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + host_system_name = "local", + msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", + msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", + msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x64", + msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", + msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", + msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe", + msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe", + msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe", + target_libc = "msvcrt", + target_system_name = "local", tool_paths = { "ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe", "ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe", @@ -232,10 +243,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:X64"], - default_link_flags = ["/MACHINE:X64"], - dbg_mode_debug_flag = "/DEBUG:FULL", - fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + toolchain_identifier = "msvc_x64", ) toolchain( @@ -254,8 +262,6 @@ toolchain( cc_toolchain( name = "cc-compiler-x64_x86_windows", - toolchain_identifier = "msvc_x64_x86", - toolchain_config = ":msvc_x64_x86", all_files = ":empty", ar_files = ":empty", as_files = ":msvc_compiler_files", @@ -265,32 +271,39 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":msvc_x64_x86", + toolchain_identifier = "msvc_x64_x86", ) cc_toolchain_config( name = "msvc_x64_x86", - cpu = "x64_windows", - compiler = "msvc-cl", - host_system_name = "local", - target_system_name = "local", - target_libc = "msvcrt", - abi_version = "local", abi_libc_version = "local", - toolchain_identifier = "msvc_x64_x86", - msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", - msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", - msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", - msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x86", - msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe", - msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe", - msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe", - msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe", - cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", + abi_version = "local", + archiver_flags = ["/MACHINE:X86"], + compiler = "msvc-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = [ + "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt"], + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", + ], + dbg_mode_debug_flag = "/DEBUG:FULL", + default_link_flags = ["/MACHINE:X86"], + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + host_system_name = "local", + msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe", + msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt", + msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x86", + msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", + msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", + msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe", + msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe", + msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe", + target_libc = "msvcrt", + target_system_name = "local", tool_paths = { "ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe", "ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe", @@ -303,10 +316,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:X86"], - default_link_flags = ["/MACHINE:X86"], - dbg_mode_debug_flag = "/DEBUG:FULL", - fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", + toolchain_identifier = "msvc_x64_x86", ) toolchain( @@ -325,8 +335,6 @@ toolchain( cc_toolchain( name = "cc-compiler-x64_arm_windows", - toolchain_identifier = "msvc_x64_arm", - toolchain_config = ":msvc_x64_arm", all_files = ":empty", ar_files = ":empty", as_files = ":msvc_compiler_files", @@ -336,27 +344,32 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":msvc_x64_arm", + toolchain_identifier = "msvc_x64_arm", ) cc_toolchain_config( name = "msvc_x64_arm", - cpu = "x64_windows", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:ARM"], compiler = "msvc-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = [], + dbg_mode_debug_flag = "/DEBUG", + default_link_flags = ["/MACHINE:ARM"], + fastbuild_mode_debug_flag = "/DEBUG", host_system_name = "local", - target_system_name = "local", - target_libc = "msvcrt", - abi_version = "local", - abi_libc_version = "local", - toolchain_identifier = "msvc_x64_arm", - msvc_env_tmp = "msvc_not_found", - msvc_env_path = "msvc_not_found", + msvc_cl_path = "vc_installation_error_arm.bat", msvc_env_include = "msvc_not_found", msvc_env_lib = "msvc_not_found", - msvc_cl_path = "vc_installation_error_arm.bat", - msvc_ml_path = "vc_installation_error_arm.bat", - msvc_link_path = "vc_installation_error_arm.bat", + msvc_env_path = "msvc_not_found", + msvc_env_tmp = "msvc_not_found", msvc_lib_path = "vc_installation_error_arm.bat", - cxx_builtin_include_directories = [], + msvc_link_path = "vc_installation_error_arm.bat", + msvc_ml_path = "vc_installation_error_arm.bat", + target_libc = "msvcrt", + target_system_name = "local", tool_paths = { "ar": "vc_installation_error_arm.bat", "ml": "vc_installation_error_arm.bat", @@ -369,10 +382,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:ARM"], - default_link_flags = ["/MACHINE:ARM"], - dbg_mode_debug_flag = "/DEBUG", - fastbuild_mode_debug_flag = "/DEBUG", + toolchain_identifier = "msvc_x64_arm", ) toolchain( @@ -391,8 +401,6 @@ toolchain( cc_toolchain( name = "cc-compiler-arm64_windows", - toolchain_identifier = "msvc_arm64", - toolchain_config = ":msvc_arm64", all_files = ":empty", ar_files = ":empty", as_files = ":msvc_compiler_files", @@ -402,27 +410,32 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":msvc_arm64", + toolchain_identifier = "msvc_arm64", ) cc_toolchain_config( name = "msvc_arm64", - cpu = "x64_windows", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:ARM64"], compiler = "msvc-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = [], + dbg_mode_debug_flag = "/DEBUG", + default_link_flags = ["/MACHINE:ARM64"], + fastbuild_mode_debug_flag = "/DEBUG", host_system_name = "local", - target_system_name = "local", - target_libc = "msvcrt", - abi_version = "local", - abi_libc_version = "local", - toolchain_identifier = "msvc_arm64", - msvc_env_tmp = "msvc_not_found", - msvc_env_path = "msvc_not_found", + msvc_cl_path = "vc_installation_error_arm64.bat", msvc_env_include = "msvc_not_found", msvc_env_lib = "msvc_not_found", - msvc_cl_path = "vc_installation_error_arm64.bat", - msvc_ml_path = "vc_installation_error_arm64.bat", - msvc_link_path = "vc_installation_error_arm64.bat", + msvc_env_path = "msvc_not_found", + msvc_env_tmp = "msvc_not_found", msvc_lib_path = "vc_installation_error_arm64.bat", - cxx_builtin_include_directories = [], + msvc_link_path = "vc_installation_error_arm64.bat", + msvc_ml_path = "vc_installation_error_arm64.bat", + target_libc = "msvcrt", + target_system_name = "local", tool_paths = { "ar": "vc_installation_error_arm64.bat", "ml": "vc_installation_error_arm64.bat", @@ -435,10 +448,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:ARM64"], - default_link_flags = ["/MACHINE:ARM64"], - dbg_mode_debug_flag = "/DEBUG", - fastbuild_mode_debug_flag = "/DEBUG", + toolchain_identifier = "msvc_arm64", ) toolchain( @@ -454,11 +464,8 @@ toolchain( toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", ) - cc_toolchain( name = "cc-compiler-x64_windows-clang-cl", - toolchain_identifier = "clang_cl_x64", - toolchain_config = ":clang_cl_x64", all_files = ":empty", ar_files = ":empty", as_files = ":clangcl_compiler_files", @@ -468,27 +475,35 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":clang_cl_x64", + toolchain_identifier = "clang_cl_x64", ) cc_toolchain_config( name = "clang_cl_x64", - cpu = "x64_windows", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:X64"], compiler = "clang-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = [], + dbg_mode_debug_flag = "/DEBUG", + default_link_flags = [ + "/MACHINE:X64", + "/DEFAULTLIB:clang_rt.builtins-x86_64.lib", + ], + fastbuild_mode_debug_flag = "/DEBUG", host_system_name = "local", - target_system_name = "local", - target_libc = "msvcrt", - abi_version = "local", - abi_libc_version = "local", - toolchain_identifier = "clang_cl_x64", - msvc_env_tmp = "clang_cl_not_found", - msvc_env_path = "clang_cl_not_found", + msvc_cl_path = "clang_installation_error.bat", msvc_env_include = "clang_cl_not_found", msvc_env_lib = "clang_cl_not_found", - msvc_cl_path = "clang_installation_error.bat", - msvc_ml_path = "clang_installation_error.bat", - msvc_link_path = "clang_installation_error.bat", + msvc_env_path = "clang_cl_not_found", + msvc_env_tmp = "clang_cl_not_found", msvc_lib_path = "clang_installation_error.bat", - cxx_builtin_include_directories = [], + msvc_link_path = "clang_installation_error.bat", + msvc_ml_path = "clang_installation_error.bat", + target_libc = "msvcrt", + target_system_name = "local", tool_paths = { "ar": "clang_installation_error.bat", "ml": "clang_installation_error.bat", @@ -501,10 +516,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:X64"], - default_link_flags = ["/MACHINE:X64", "/DEFAULTLIB:clang_rt.builtins-x86_64.lib"], - dbg_mode_debug_flag = "/DEBUG", - fastbuild_mode_debug_flag = "/DEBUG", + toolchain_identifier = "clang_cl_x64", ) toolchain( @@ -524,8 +536,6 @@ toolchain( cc_toolchain( name = "cc-compiler-arm64_windows-clang-cl", - toolchain_identifier = "clang_cl_arm64", - toolchain_config = ":clang_cl_arm64", all_files = ":empty", ar_files = ":empty", as_files = ":clangcl_compiler_files", @@ -535,27 +545,32 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":clang_cl_arm64", + toolchain_identifier = "clang_cl_arm64", ) cc_toolchain_config( name = "clang_cl_arm64", - cpu = "arm64_windows", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:ARM64"], compiler = "clang-cl", + cpu = "arm64_windows", + cxx_builtin_include_directories = [], + dbg_mode_debug_flag = "/DEBUG", + default_link_flags = ["/MACHINE:ARM64"], + fastbuild_mode_debug_flag = "/DEBUG", host_system_name = "local", - target_system_name = "aarch64-pc-windows-msvc", - target_libc = "msvcrt", - abi_version = "local", - abi_libc_version = "local", - toolchain_identifier = "clang_cl_arm64", - msvc_env_tmp = "clang_cl_not_found", - msvc_env_path = "clang_cl_not_found", + msvc_cl_path = "vc_installation_error_arm64.bat", msvc_env_include = "clang_cl_not_found", msvc_env_lib = "clang_cl_not_found", - msvc_cl_path = "vc_installation_error_arm64.bat", - msvc_ml_path = "vc_installation_error_arm64.bat", - msvc_link_path = "vc_installation_error_arm64.bat", + msvc_env_path = "clang_cl_not_found", + msvc_env_tmp = "clang_cl_not_found", msvc_lib_path = "vc_installation_error_arm64.bat", - cxx_builtin_include_directories = [], + msvc_link_path = "vc_installation_error_arm64.bat", + msvc_ml_path = "vc_installation_error_arm64.bat", + target_libc = "msvcrt", + target_system_name = "aarch64-pc-windows-msvc", tool_paths = { "ar": "vc_installation_error_arm64.bat", "ml": "vc_installation_error_arm64.bat", @@ -568,10 +583,7 @@ cc_toolchain_config( "objdump": "wrapper/bin/msvc_nop.bat", "strip": "wrapper/bin/msvc_nop.bat", }, - archiver_flags = ["/MACHINE:ARM64"], - default_link_flags = ["/MACHINE:ARM64"], - dbg_mode_debug_flag = "/DEBUG", - fastbuild_mode_debug_flag = "/DEBUG", + toolchain_identifier = "clang_cl_arm64", ) toolchain( @@ -590,8 +602,6 @@ toolchain( cc_toolchain( name = "cc-compiler-armeabi-v7a", - toolchain_identifier = "stub_armeabi-v7a", - toolchain_config = ":stub_armeabi-v7a", all_files = ":empty", ar_files = ":empty", as_files = ":empty", @@ -601,6 +611,8 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, + toolchain_config = ":stub_armeabi-v7a", + toolchain_identifier = "stub_armeabi-v7a", ) armeabi_cc_toolchain_config(name = "stub_armeabi-v7a") diff --git a/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config/BUILD b/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config/BUILD index e6a62ca6d95..9ef48ca0148 100755 --- a/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config/BUILD +++ b/third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config/BUILD @@ -17,7 +17,6 @@ package(default_visibility = ["//visibility:public"]) - toolchain( name = "cc-toolchain", exec_compatible_with = [ @@ -34,7 +33,6 @@ toolchain( platform( name = "platform", - parents = ["@local_config_platform//:host"], constraint_values = [ "@platforms//os:windows", "@platforms//cpu:x86_64", @@ -43,4 +41,5 @@ platform( "container-image": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:63aed074a2ca1bf5af45bb43b255d21d51882d7169ec57be7f0f5454ea5d2c98", "OSFamily": "Windows", }, + parents = ["@local_config_platform//:host"], ) diff --git a/third_party/upb/upb/BUILD b/third_party/upb/upb/BUILD index 42797dc2ecb..f66f9a23851 100644 --- a/third_party/upb/upb/BUILD +++ b/third_party/upb/upb/BUILD @@ -6,7 +6,6 @@ # https://developers.google.com/open-source/licenses/bsd load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") -load("@rules_python//python:defs.bzl", "py_binary") load("//bazel/private:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts") load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") diff --git a/third_party/upb/upb/bazel/BUILD b/third_party/upb/upb/bazel/BUILD index 03e7f3615b5..1e6e0a94065 100644 --- a/third_party/upb/upb/bazel/BUILD +++ b/third_party/upb/upb/bazel/BUILD @@ -5,7 +5,6 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("@bazel_skylib//lib:selects.bzl", "selects") load("@rules_python//python:defs.bzl", "py_binary") # begin:google_only diff --git a/third_party/upb/upb/cmake/BUILD.bazel b/third_party/upb/upb/cmake/BUILD.bazel index e17ce8450a0..5f86762611c 100644 --- a/third_party/upb/upb/cmake/BUILD.bazel +++ b/third_party/upb/upb/cmake/BUILD.bazel @@ -5,6 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd +load("@rules_python//python:defs.bzl", "py_binary", "py_library") load( "//upb/bazel:build_defs.bzl", "make_shell_script", diff --git a/tools/distrib/python/grpcio_tools/BUILD.bazel b/tools/distrib/python/grpcio_tools/BUILD.bazel index ba24e779e7a..1830ab5b450 100644 --- a/tools/distrib/python/grpcio_tools/BUILD.bazel +++ b/tools/distrib/python/grpcio_tools/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") load("//bazel:cython_library.bzl", "pyx_library") load("grpcio_tools.bzl", "internal_copied_filegroup") diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel b/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel index 3104d30311f..303c1b75d53 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel +++ b/tools/distrib/python/grpcio_tools/grpc_tools/test/BUILD.bazel @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_test") load("//bazel:python_rules.bzl", "py_proto_library") package(default_testonly = 1) diff --git a/tools/distrib/python/xds_protos/BUILD.bazel b/tools/distrib/python/xds_protos/BUILD.bazel index 52f61b3cd0a..a1877e96703 100755 --- a/tools/distrib/python/xds_protos/BUILD.bazel +++ b/tools/distrib/python/xds_protos/BUILD.bazel @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@rules_python//python:defs.bzl", "py_library") + package(default_visibility = ["//src/python/grpcio_csds:__subpackages__"]) _XDS_PROTO_DIRECTORIES = [