Skip to content

Commit

Permalink
Convert proto toolchain string to Label
Browse files Browse the repository at this point in the history
Without it the still slightly weird setup of Bazel unit tests causes problems.

PiperOrigin-RevId: 684391633
  • Loading branch information
protobuf-github-bot authored and comius committed Oct 15, 2024
1 parent 1822c8a commit aa181e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bazel/private/bazel_cc_proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion bazel/private/bazel_java_proto_library_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion bazel/private/java_lite_proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bazel/private/toolchain_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)

0 comments on commit aa181e2

Please sign in to comment.