Skip to content

Commit 304c9ba

Browse files
committed
Dropped support for Bazel 7.
This was previously announced here: https://protobuf.dev/support/migration/#dropped-bazel-7-support #test-continuous PiperOrigin-RevId: 870256373
1 parent 5d4ad45 commit 304c9ba

File tree

16 files changed

+12
-133
lines changed

16 files changed

+12
-133
lines changed

.github/workflows/test_cpp.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ jobs:
4040
- image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:8.0.1-b77fdae6d4771789dfc66a56bf8d806354e8011a
4141
- targets: //pkg/... //src/... //third_party/utf8_range/... //conformance:conformance_framework_tests
4242
# Override cases with custom images
43-
- config: { name: "Bazel7", flags: --cxxopt="-Wno-self-assign-overloaded" }
44-
cache_key: Bazel7bzlmod
45-
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604"
46-
targets: "//src/... //third_party/utf8_range/..."
4743
- config: { name: "Bazel8", flags: --cxxopt="-Wno-self-assign-overloaded" }
4844
cache_key: Bazel8
4945
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.0.1-e78301df86b3e4c46ec9ac4d98be00e19305d8f3"

.github/workflows/test_java.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ jobs:
4444
cache_key: '17'
4545
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8.0.1-17-168f9c9d015a0fa16611e1e9eede796fe9bfbb69
4646
targets: //java/... //java/internal:java_version //compatibility/...
47-
- name: Bazel7
48-
cache_key: 'bazel7bzlmod'
49-
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.6.1-e0df73e51131ccaf53451355d22577f377357604
50-
targets: //java/... //java/internal:java_version //compatibility/...
5147
# TODO: b/395623141 - restore this test once runtime uses / emulates aarch64.
5248
# - name: aarch64
5349
# cache_key: 'aarch64'

MODULE.bazel

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ bazel_dep(name = "rules_license", version = "1.0.0")
4444
bazel_dep(name = "rules_pkg", version = "1.0.1")
4545
bazel_dep(name = "rules_python", version = "1.6.0")
4646

47-
# Pin to rules_proto to 7.1.0 to avoid toolchain incompatibilities when
48-
# --incompatible_enable_proto_toolchain_resolution=true in Bazel 7.
49-
# rules_proto 7.0.2 from deps incorrectly rules_proto's toolchain_type but protobuf's toolchain, but
50-
# 7.1.0 uses protobuf's toolchain and toolchain_type.
51-
# TODO: Restore to dev_dependency once Bazel 7 is dropped.
52-
# rules_proto is needed for @com_google_protobuf_v25 used in //compatibility/... tests
53-
bazel_dep(name = "rules_proto", version = "7.1.0")
54-
5547
bazel_dep(name = "rules_rust", version = "0.63.0", dev_dependency = True)
5648
bazel_dep(name = "rules_ruby", version = "0.17.3", dev_dependency = True)
5749

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ release commits.
3636
### Bazel with Bzlmod
3737

3838
Protobuf supports
39-
[Bzlmod](https://bazel.build/external/module) with Bazel 7 +.
39+
[Bzlmod](https://bazel.build/external/module) with Bazel 8 +.
4040
Users should specify a dependency on protobuf in their MODULE.bazel file as
4141
follows.
4242

WORKSPACE

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
workspace(name = "com_google_protobuf")
22

3-
# An explicit self-reference to work around changes in Bazel 7.0
4-
# See https://github.com/bazelbuild/bazel/issues/19973#issuecomment-1787814450
5-
# buildifier: disable=duplicated-name
6-
local_repository(
7-
name = "com_google_protobuf",
8-
path = ".",
9-
)
10-
113
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
124

135
# Load common dependencies first to ensure we use the correct version

bazel/cc_proto_library.bzl

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

1010
load("//bazel/private/oss:cc_proto_library.bzl", _cc_proto_library = "cc_proto_library")
1111

12-
def cc_proto_library(**kwattrs):
13-
# Only use Starlark rules when they are removed from Bazel
14-
if not hasattr(native, "cc_proto_library"):
15-
_cc_proto_library(**kwattrs)
16-
else:
17-
native.cc_proto_library(**kwattrs) # buildifier: disable=native-cc-proto
12+
cc_proto_library = _cc_proto_library

bazel/java_lite_proto_library.bzl

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

1010
load("//bazel/private:java_lite_proto_library.bzl", _java_lite_proto_library = "java_lite_proto_library")
1111

12-
def java_lite_proto_library(**kwattrs):
13-
# Only use Starlark rules when they are removed from Bazel
14-
if not hasattr(native, "java_lite_proto_library"):
15-
_java_lite_proto_library(**kwattrs)
16-
else:
17-
native.java_lite_proto_library(**kwattrs) # buildifier: disable=native-java-lite-proto
12+
java_lite_proto_library = _java_lite_proto_library

bazel/java_proto_library.bzl

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

1010
load("//bazel/private:java_proto_library.bzl", _java_proto_library = "java_proto_library")
1111

12-
def java_proto_library(**kwattrs):
13-
# Only use Starlark rules when they are removed from Bazel
14-
if not hasattr(native, "java_proto_library"):
15-
_java_proto_library(**kwattrs)
16-
else:
17-
native.java_proto_library(**kwattrs) # buildifier: disable=native-java-proto
12+
java_proto_library = _java_proto_library

bazel/private/oss/cc_proto_library.bzl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ def _aspect_impl(target, ctx):
5959

6060
if should_generate_code:
6161
if len(proto_info.direct_sources) != 0:
62-
# Bazel 7 didn't expose cc_proto_library_source_suffixes used by Kythe
63-
# gradually falling back to .pb.cc
64-
if type(get_flag_value(ctx, "cc_proto_library_source_suffixes")) == "builtin_function_or_method":
65-
source_suffixes = [".pb.cc"]
66-
header_suffixes = [".pb.h"]
67-
else:
68-
source_suffixes = get_flag_value(ctx, "cc_proto_library_source_suffixes")
69-
header_suffixes = get_flag_value(ctx, "cc_proto_library_header_suffixes")
62+
source_suffixes = get_flag_value(ctx, "cc_proto_library_source_suffixes")
63+
header_suffixes = get_flag_value(ctx, "cc_proto_library_header_suffixes")
7064
sources = _get_output_files(ctx.actions, proto_info, source_suffixes)
7165
headers = _get_output_files(ctx.actions, proto_info, header_suffixes)
7266
header_provider = _ProtoCcHeaderInfo(headers = depset(headers))

bazel/private/oss/toolchains/BUILD.bazel

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,6 @@ toolchain(
4646
toolchain_type = "//bazel/private:python_toolchain_type",
4747
)
4848

49-
# Following toolchain registrations are for builtin Bazel 7 rules
50-
# which defined them in other repositories.
51-
toolchain(
52-
name = "cc_source_toolchain_bazel7",
53-
exec_compatible_with = [],
54-
target_compatible_with = [],
55-
toolchain = "//:cc_toolchain",
56-
toolchain_type = "@rules_cc//cc/proto:toolchain_type",
57-
)
58-
59-
toolchain(
60-
name = "java_source_toolchain_bazel7",
61-
exec_compatible_with = [],
62-
target_compatible_with = [],
63-
toolchain = "//java/core:toolchain",
64-
toolchain_type = "@rules_java//java/proto:toolchain_type",
65-
)
66-
67-
toolchain(
68-
name = "javalite_source_toolchain_bazel7",
69-
exec_compatible_with = [],
70-
target_compatible_with = [],
71-
toolchain = "//java/lite:toolchain",
72-
toolchain_type = "@rules_java//java/proto:lite_toolchain_type",
73-
)
74-
7549
filegroup(
7650
name = "for_bazel_tests",
7751
testonly = True,

0 commit comments

Comments
 (0)