Delete com_google_protobuf_previous_release and associated breaking tests

When trying to land https://github.com/protocolbuffers/protobuf/pull/28957, I ran into problems with the `@com_google_protobuf_previous_release` repo.  The root cause of these problems was that this repo combines a previous version of all of our `.bzl` files (like `proto_library.bzl`) with the *current* version of our `MODULE.bazel` file.

This is a combination that no user will actually encounter, and when skew between the two causes issues, it is very difficult to debug and fix.

If we want to re-introduce these breaking change tests in the future, an alternative approach that would cause fewer problems is to use the examples module at https://github.com/protocolbuffers/protobuf/tree/main/examples.  That module could include previous versions of the `.proto` files, as well as the breaking change tests to compare against the protos in `@com_google_protobuf`.

Since the examples module does not contain a copy of all our `.bzl` files, this design would avoid the `.bzl` skew that causes problems in the current setup.

PiperOrigin-RevId: 970790688
This commit is contained in:
Joshua Haberman 2026-08-25 14:18:12 -07:00 committed by Copybara-Service
parent 2d75af0868
commit 734819d9dc
6 changed files with 994 additions and 206 deletions

View file

@ -262,7 +262,6 @@ protobuf_maven_dev.install(
use_repo(protobuf_maven_dev, "protobuf_maven_dev")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", dev_dependency = True)
bazel_dep(name = "rules_buf", version = "0.3.0", dev_dependency = True)
bazel_dep(name = "rules_testing", version = "0.9.0", dev_dependency = True)
bazel_dep(
name = "abseil-py",
@ -302,18 +301,6 @@ archive_override(
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.0/protobuf-25.0.tar.gz"],
)
bazel_dep(name = "com_google_protobuf_previous_release", version = "33.0", dev_dependency = True)
archive_override(
module_name = "com_google_protobuf_previous_release",
integrity = "sha256-y8U2BkcGtijc/lB77zhu8+IhTVY2V2EilvF4GqFV7gc=",
patch_strip = 1,
patches = [
"@com_google_protobuf//:patches/protobuf_v33/0001-Update-module-name.patch",
],
strip_prefix = "protobuf-33.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v33.0/protobuf-33.0.tar.gz"],
)
# Register C++ toolchains for cross-compilation. These are used for compiling release binaries of
# protoc and the Python extension. They are disabled unless --//toolchain:release=true is passed.
register_toolchains(

View file

@ -262,29 +262,6 @@ http_archive(
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.9.0/rules_testing-v0.9.0.tar.gz",
)
# For checking breaking changes to well-known types from the previous release version.
http_archive(
name = "com_google_protobuf_previous_release",
integrity = "sha256-EKDVjzmhqQnpXgDougtbHcZNApl/dBFRlTorNln254w=",
strip_prefix = "protobuf-29.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protobuf-29.0.tar.gz"],
)
http_archive(
name = "rules_buf",
integrity = "sha256-Hr64Q/CaYr0E3ptAjEOgdZd1yc+cBjp7OG1wzuf3DIs=",
strip_prefix = "rules_buf-0.3.0",
urls = [
"https://github.com/bufbuild/rules_buf/archive/refs/tags/v0.3.0.zip",
],
)
load("@rules_buf//buf:repositories.bzl", "rules_buf_dependencies", "rules_buf_toolchains")
rules_buf_dependencies()
rules_buf_toolchains(version = "v1.32.1")
register_toolchains(
"//toolchain:osx-x86_64-toolchain",
"//toolchain:osx-aarch_64-toolchain",

View file

@ -1,4 +1,3 @@
load("@rules_buf//buf:defs.bzl", "buf_breaking_test")
load("@rules_java//java:java_library.bzl", "java_library")
# Simple build tests for compatibility of gencode from previous major versions
@ -23,122 +22,3 @@ java_library(
visibility = ["//java/core:__pkg__"],
deps = ["@com_google_protobuf_v25//java/core"],
)
# Breaking change detection for well-known types and descriptor.proto.
buf_breaking_test(
name = "any_proto_breaking",
against = "@com_google_protobuf_previous_release//:any_proto",
config = ":buf.yaml",
targets = ["//:any_proto"],
)
buf_breaking_test(
name = "api_proto_breaking",
against = "@com_google_protobuf_previous_release//:api_proto",
config = ":buf.yaml",
targets = ["//:api_proto"],
)
buf_breaking_test(
name = "descriptor_proto_breaking",
against = "@com_google_protobuf_previous_release//:descriptor_proto",
config = ":buf.yaml",
targets = ["//:descriptor_proto"],
)
buf_breaking_test(
name = "duration_proto_breaking",
against = "@com_google_protobuf_previous_release//:duration_proto",
config = ":buf.yaml",
targets = ["//:duration_proto"],
)
buf_breaking_test(
name = "empty_proto_breaking",
against = "@com_google_protobuf_previous_release//:empty_proto",
config = ":buf.yaml",
targets = ["//:empty_proto"],
)
buf_breaking_test(
name = "field_mask_proto_breaking",
against = "@com_google_protobuf_previous_release//:field_mask_proto",
config = ":buf.yaml",
targets = ["//:field_mask_proto"],
)
buf_breaking_test(
name = "source_context_proto_breaking",
against = "@com_google_protobuf_previous_release//:source_context_proto",
config = ":buf.yaml",
targets = ["//:source_context_proto"],
)
buf_breaking_test(
name = "struct_proto_breaking",
against = "@com_google_protobuf_previous_release//:struct_proto",
config = ":buf.yaml",
targets = ["//:struct_proto"],
)
buf_breaking_test(
name = "timestamp_proto_breaking",
against = "@com_google_protobuf_previous_release//:timestamp_proto",
config = ":buf.yaml",
targets = ["//:timestamp_proto"],
)
buf_breaking_test(
name = "type_proto_breaking",
against = "@com_google_protobuf_previous_release//:type_proto",
config = ":buf.yaml",
targets = ["//:type_proto"],
)
buf_breaking_test(
name = "wrappers_proto_breaking",
against = "@com_google_protobuf_previous_release//:wrappers_proto",
config = ":buf.yaml",
targets = ["//:wrappers_proto"],
)
buf_breaking_test(
name = "compiler_plugin_proto_breaking",
against = "@com_google_protobuf_previous_release//:compiler_plugin_proto",
config = ":buf.yaml",
targets = ["//:compiler_plugin_proto"],
)
buf_breaking_test(
name = "cpp_features_proto_breaking",
against = "@com_google_protobuf_previous_release//:cpp_features_proto",
config = ":buf.yaml",
targets = ["//:cpp_features_proto"],
)
buf_breaking_test(
name = "java_features_proto_breaking",
against = "@com_google_protobuf_previous_release//:java_features_proto",
config = ":buf.yaml",
targets = ["//:java_features_proto"],
)
test_suite(
name = "proto_breaking",
tests = [
"any_proto_breaking",
"api_proto_breaking",
"compiler_plugin_proto_breaking",
"cpp_features_proto_breaking",
"descriptor_proto_breaking",
"duration_proto_breaking",
"empty_proto_breaking",
"field_mask_proto_breaking",
"java_features_proto_breaking",
"source_context_proto_breaking",
"struct_proto_breaking",
"timestamp_proto_breaking",
"type_proto_breaking",
"wrappers_proto_breaking",
],
)

View file

@ -1 +0,0 @@
version: v1

File diff suppressed because it is too large Load diff

View file

@ -1,21 +0,0 @@
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -5,3 +5,3 @@
module(
- name = "protobuf",
+ name = "com_google_protobuf_previous_release",
version = "33.0", # Automatically updated on release
@@ -293,13 +293,1 @@
)
-
-bazel_dep(name = "com_google_protobuf_previous_release", version = "29.0", dev_dependency = True)
-archive_override(
- module_name = "com_google_protobuf_previous_release",
- integrity = "sha256-EKDVjzmhqQnpXgDougtbHcZNApl/dBFRlTorNln254w=",
- patch_strip = 1,
- patches = [
- "@com_google_protobuf//:patches/protobuf_v29/0001-Update-module-name.patch",
- ],
- strip_prefix = "protobuf-29.0",
- urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protobuf-29.0.tar.gz"],
-)