Move previous_release dependency out of WORKSPACE.bzlmod and into MODULE.bazel

While I was at it, I upgraded the previous release to 29.0.

`PROTOBUF_PREVIOUS_RELEASE` is not currently getting updated, and I deleted it
because I don't see an obvious way of referring to it from `MODULE.bazel`.
Hopefully soon we can drop it from `WORKSPACE` and then the only place to
update will be `MODULE.bazel`.

PiperOrigin-RevId: 743211189
This commit is contained in:
Adam Cozzette 2025-04-02 11:18:45 -07:00 committed by Copybara-Service
parent b1986448e0
commit bb422b1fd5
5 changed files with 28 additions and 18 deletions

View file

@ -237,3 +237,15 @@ archive_override(
"@com_google_protobuf//:patches/protobuf_v25/0006-Add-repo_name.patch",
],
)
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=",
strip_prefix = "protobuf-29.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protobuf-29.0.tar.gz"],
patch_strip = 1,
patches = [
"@com_google_protobuf//:patches/protobuf_v29/0001-Update-module-name.patch",
],
)

View file

@ -317,12 +317,11 @@ http_archive(
)
# For checking breaking changes to well-known types from the previous release version.
load("//:protobuf_version.bzl", "PROTOBUF_PREVIOUS_RELEASE")
http_archive(
name = "com_google_protobuf_previous_release",
strip_prefix = "protobuf-" + PROTOBUF_PREVIOUS_RELEASE,
url = "https://github.com/protocolbuffers/protobuf/releases/download/v{0}/protobuf-{0}.tar.gz".format(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(

View file

@ -1,16 +1,3 @@
# This is a WORKSPACE file used by bzlmod in combination with MODULE.bazel.
# It's used for a gradual migration and it should be empty.
# Don't remove this file. If the file doesn't exist, bzlmod falls back to WORKSPACE file.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Following are just needed to run conformance tests, not really needed to support them via MODULE.bazel
# Needed for checking breaking changes from the previous release version.
load("//:protobuf_version.bzl", "PROTOBUF_PREVIOUS_RELEASE")
http_archive(
name = "com_google_protobuf_previous_release",
strip_prefix = "protobuf-" + PROTOBUF_PREVIOUS_RELEASE,
url = "https://github.com/protocolbuffers/protobuf/releases/download/v{0}/protobuf-{0}.tar.gz".format(PROTOBUF_PREVIOUS_RELEASE),
)

View file

@ -0,0 +1,13 @@
diff --git a/MODULE.bazel b/MODULE.bazel
index 400186b53..1194db9ca 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -2,7 +2,7 @@
# https://github.com/protocolbuffers/protobuf/issues/14313
module(
- name = "protobuf",
+ name = "com_google_protobuf_previous_release",
version = "29.0", # Automatically updated on release
compatibility_level = 1,
repo_name = "com_google_protobuf",

View file

@ -5,4 +5,3 @@ PROTOBUF_PYTHON_VERSION = "6.31.0"
PROTOBUF_PHP_VERSION = "4.31.0"
PROTOBUF_RUBY_VERSION = "4.31.0"
PROTOBUF_RUST_VERSION = "4.31.0"
PROTOBUF_PREVIOUS_RELEASE = "28.0-rc1"