Convert proto toolchain string to Label

Without it the still slightly weird setup of Bazel unit tests causes problems.

PiperOrigin-RevId: 686745551
pull/18754/head
Protobuf Team Bot 1 month ago committed by Copybara-Service
parent 1f7f08d21d
commit e358a4025e
  1. 2
      bazel/private/bazel_cc_proto_library.bzl
  2. 2
      bazel/private/bazel_java_proto_library_rule.bzl
  3. 2
      bazel/private/java_lite_proto_library.bzl
  4. 2
      bazel/private/toolchain_helpers.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.")

@ -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]

@ -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.

@ -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"),
)

Loading…
Cancel
Save