Skip to content

Commit dd9a1f8

Browse files
habermancopybara-github
authored andcommitted
Post-Bazel 7 cleanups.
PiperOrigin-RevId: 891019618
1 parent 28e4512 commit dd9a1f8

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

bazel/common/BUILD

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ bzl_library(
1010
visibility = ["//visibility:public"],
1111
deps = [
1212
":proto_lang_toolchain_info_bzl",
13-
"//bazel/private:native_bzl",
1413
"//bazel/private:toolchain_helpers_bzl",
1514
"@proto_bazel_features//:features",
1615
],
@@ -24,7 +23,6 @@ bzl_library(
2423
visibility = ["//visibility:public"],
2524
deps = [
2625
"//bazel/private:proto_info_bzl",
27-
"@proto_bazel_features//:features",
2826
],
2927
)
3028

@@ -34,9 +32,6 @@ bzl_library(
3432
"proto_lang_toolchain_info.bzl",
3533
],
3634
visibility = ["//visibility:public"],
37-
deps = [
38-
"//bazel/private:native_bzl",
39-
],
4035
)
4136

4237
filegroup(

bazel/common/proto_common.bzl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
load("@proto_bazel_features//:features.bzl", "bazel_features")
1111
load("//bazel/common:proto_lang_toolchain_info.bzl", "ProtoLangToolchainInfo")
12-
load("//bazel/private:native.bzl", "native_proto_common")
1312
load("//bazel/private:toolchain_helpers.bzl", "toolchains")
1413

1514
def _import_virtual_proto_path(path):
@@ -100,10 +99,6 @@ def _check_collocated(label, proto_info, proto_lang_toolchain_info):
10099
Obtained from a `proto_lang_toolchain` target.
101100
"""
102101
_PackageSpecificationInfo = bazel_features.globals.PackageSpecificationInfo
103-
if not _PackageSpecificationInfo:
104-
if proto_lang_toolchain_info.allowlist_different_package or getattr(proto_info, "allow_exports", None):
105-
fail("Allowlist checks not supported before Bazel 6.4.0")
106-
return
107102

108103
if (proto_info.direct_descriptor_set.owner.package != label.package and
109104
proto_lang_toolchain_info.allowlist_different_package):
@@ -351,8 +346,5 @@ proto_common = struct(
351346
get_import_path = _get_import_path,
352347
ProtoLangToolchainInfo = ProtoLangToolchainInfo,
353348
INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION = toolchains.INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION,
354-
INCOMPATIBLE_PASS_TOOLCHAIN_TYPE = (
355-
getattr(native_proto_common, "INCOMPATIBLE_PASS_TOOLCHAIN_TYPE", False) or
356-
not hasattr(native_proto_common, "ProtoLangToolchainInfo")
357-
),
349+
INCOMPATIBLE_PASS_TOOLCHAIN_TYPE = True,
358350
)

bazel/common/proto_info.bzl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""ProtoInfo"""
22

3-
load("@proto_bazel_features//:features.bzl", "bazel_features")
43
load("//bazel/private:proto_info.bzl", _ProtoInfo = "ProtoInfo")
54

6-
# This resolves to Starlark ProtoInfo in Bazel 8 or with --incompatible_enable_autoload flag
7-
ProtoInfo = getattr(bazel_features.globals, "ProtoInfo", None) or _ProtoInfo
5+
ProtoInfo = _ProtoInfo

bazel/common/proto_lang_toolchain_info.bzl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""ProtoLangToolchainInfo"""
22

3-
load("//bazel/private:native.bzl", "native_proto_common")
4-
5-
# Use Starlark implementation only if native_proto_common.ProtoLangToolchainInfo doesn't exist
6-
ProtoLangToolchainInfo = getattr(native_proto_common, "ProtoLangToolchainInfo", provider(
3+
ProtoLangToolchainInfo = provider(
74
doc = """Specifies how to generate language-specific code from .proto files.
85
Used by LANG_proto_library rules.""",
96
fields = dict(
@@ -23,4 +20,4 @@ ProtoLangToolchainInfo = getattr(native_proto_common, "ProtoLangToolchainInfo",
2320
different package than proto_library""",
2421
toolchain_type = """(Label) Toolchain type that was used to obtain this info""",
2522
),
26-
))
23+
)

0 commit comments

Comments
 (0)