From aa181e28db6e5cc36580519b49a08d0ff7042dba Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 10 Oct 2024 04:24:58 -0700 Subject: [PATCH] Convert proto toolchain string to Label Without it the still slightly weird setup of Bazel unit tests causes problems. PiperOrigin-RevId: 684391633 --- bazel/private/bazel_cc_proto_library.bzl | 2 +- bazel/private/bazel_java_proto_library_rule.bzl | 2 +- bazel/private/java_lite_proto_library.bzl | 2 +- bazel/private/toolchain_helpers.bzl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/private/bazel_cc_proto_library.bzl b/bazel/private/bazel_cc_proto_library.bzl index 20803ad527e5..5c044c713971 100644 --- a/bazel/private/bazel_cc_proto_library.bzl +++ b/bazel/private/bazel_cc_proto_library.bzl @@ -13,7 +13,7 @@ load("//bazel/common:proto_info.bzl", "ProtoInfo") load("//bazel/private:cc_proto_support.bzl", "cc_proto_compile_and_link") load("//bazel/private:toolchain_helpers.bzl", "toolchains") -_CC_PROTO_TOOLCHAIN = "//bazel/private:cc_toolchain_type" +_CC_PROTO_TOOLCHAIN = Label("//bazel/private:cc_toolchain_type") _ProtoCcFilesInfo = provider(fields = ["files"], doc = "Provide cc proto files.") _ProtoCcHeaderInfo = provider(fields = ["headers"], doc = "Provide cc proto headers.") diff --git a/bazel/private/bazel_java_proto_library_rule.bzl b/bazel/private/bazel_java_proto_library_rule.bzl index e5217f2de438..3f298c3aad93 100644 --- a/bazel/private/bazel_java_proto_library_rule.bzl +++ b/bazel/private/bazel_java_proto_library_rule.bzl @@ -12,7 +12,7 @@ load("//bazel/common:proto_info.bzl", "ProtoInfo") load("//bazel/private:java_proto_support.bzl", "JavaProtoAspectInfo", "java_compile_for_protos", "java_info_merge_for_protos") load("//bazel/private:toolchain_helpers.bzl", "toolchains") -_JAVA_PROTO_TOOLCHAIN = "//bazel/private:java_toolchain_type" +_JAVA_PROTO_TOOLCHAIN = Label("//bazel/private:java_toolchain_type") def _filter_provider(provider, *attrs): return [dep[provider] for attr in attrs for dep in attr if provider in dep] diff --git a/bazel/private/java_lite_proto_library.bzl b/bazel/private/java_lite_proto_library.bzl index 1a7ba1a5ad7b..d2b3821c5cd3 100644 --- a/bazel/private/java_lite_proto_library.bzl +++ b/bazel/private/java_lite_proto_library.bzl @@ -16,7 +16,7 @@ load("//bazel/private:toolchain_helpers.bzl", "toolchains") _PROTO_TOOLCHAIN_ATTR = "_aspect_proto_toolchain_for_javalite" -_JAVA_LITE_PROTO_TOOLCHAIN = "//bazel/private:javalite_toolchain_type" +_JAVA_LITE_PROTO_TOOLCHAIN = Label("//bazel/private:javalite_toolchain_type") def _aspect_impl(target, ctx): """Generates and compiles Java code for a proto_library dependency graph. diff --git a/bazel/private/toolchain_helpers.bzl b/bazel/private/toolchain_helpers.bzl index aa49eb8cf4c8..edf3a8b69fe7 100644 --- a/bazel/private/toolchain_helpers.bzl +++ b/bazel/private/toolchain_helpers.bzl @@ -45,5 +45,5 @@ toolchains = struct( find_toolchain = _find_toolchain, if_legacy_toolchain = _if_legacy_toolchain, INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION = _incompatible_toolchain_resolution, - PROTO_TOOLCHAIN = "//bazel/private:proto_toolchain_type", + PROTO_TOOLCHAIN = Label("//bazel/private:proto_toolchain_type"), )