Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# LINT.IfChange(bazelci_presubmit)
matrix:
platform: ["debian10", "macos", "macos_arm64", "ubuntu2004", "windows"]
bazel: [8.x]
bazel: [8.x, 9.x]

tasks:
verify_targets:
Expand Down
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ build --features=layering_check

common --enable_platform_specific_config

common --incompatible_check_testonly_for_output_files

# Use clang-cl by default on Windows (see https://github.com/protocolbuffers/protobuf/issues/20085).
build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//build_defs:x64_windows-clang-cl --host_platform=//build_defs:x64_windows-clang-cl
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bcr_test_module:
module_path: examples
matrix:
platform: ["debian10", "macos", "macos_arm64", "ubuntu2004", "windows"]
bazel: [8.x]
bazel: [8.x, 9.x]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match /.bazelci/presubmit.yml to runs the same tests in CI instead of just BCR presubmit so we can catch issues ahead of release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated


tasks:
verify_targets:
Expand Down
3 changes: 3 additions & 0 deletions .github/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
load("@build_bazel_apple_support//xcode:xcode_config.bzl", "xcode_config")
load("@build_bazel_apple_support//xcode:xcode_version.bzl", "xcode_version")

# This information is extracted from the MacOS runner specs located at:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
#
Expand Down
25 changes: 11 additions & 14 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ module(
# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution
# Thus the highest version in their module graph is resolved.

bazel_dep(name = "apple_support", version = "1.15.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "apple_support", version = "1.16.0", repo_name = "build_bazel_apple_support")

# Keep apple_support on 1.15.1 for now to avoid this issue:
# https://github.com/bazelbuild/apple_support/issues/316
single_version_override(
module_name = "apple_support",
version = "1.15.1",
)
# Unused but must be pinned to avoid old broken versions
bazel_dep(name = "rules_proto", version = "7.1.0")

#ifndef PROTO2_OPENSOURCE
# LINT.IfChange
Expand All @@ -36,16 +32,16 @@ bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
# other dependencies
bazel_dep(name = "bazel_features", version = "1.33.0", repo_name = "proto_bazel_features")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "jsoncpp", version = "1.9.6")
bazel_dep(name = "jsoncpp", version = "1.9.6.bcr.1")
bazel_dep(name = "rules_java", version = "8.6.1")
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_kotlin", version = "1.9.6")
bazel_dep(name = "rules_kotlin", version = "2.2.2")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_python", version = "1.6.0")
bazel_dep(name = "rules_rust", version = "0.63.0")

bazel_dep(name = "rules_ruby", version = "0.17.3", dev_dependency = True)
bazel_dep(name = "rules_ruby", version = "0.20.1", dev_dependency = True)

# Workaround for https://github.com/bazelbuild/bazel-central-registry/issues/4230
# rules_fuzzing 0.5.3 is not yet available in BCR.
Expand All @@ -65,12 +61,11 @@ single_version_override(
patch_strip = 1,
patches = [
"@com_google_protobuf//:Disable_bundle_install.patch",
"@com_google_protobuf//:Neverlink_jruby_jars.patch",
],
version = "0.17.3",
)

bazel_dep(name = "rules_shell", version = "0.2.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "platforms", version = "0.0.11")

# Ruby toolchains
Expand Down Expand Up @@ -267,7 +262,7 @@ protobuf_maven_dev.install(
)
use_repo(protobuf_maven_dev, "protobuf_maven_dev")

bazel_dep(name = "googletest", version = "1.15.2", dev_dependency = True)
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(
Expand Down Expand Up @@ -302,6 +297,7 @@ archive_override(
"@com_google_protobuf//:patches/protobuf_v25/0005-Make-rules_ruby-a-dev-only-dependency.patch",
"@com_google_protobuf//:patches/protobuf_v25/0006-Add-repo_name.patch",
"@com_google_protobuf//:patches/protobuf_v25/0007-Java-bazel8.patch",
"@com_google_protobuf//:patches/protobuf_v25/0008-bazel9.patch",
],
strip_prefix = "protobuf-25.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.0/protobuf-25.0.tar.gz"],
Expand All @@ -314,6 +310,7 @@ archive_override(
patch_strip = 1,
patches = [
"@com_google_protobuf//:patches/protobuf_v29/0001-Update-module-name.patch",
"@com_google_protobuf//:patches/protobuf_v29/0002-bazel9.patch",
],
strip_prefix = "protobuf-29.0",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protobuf-29.0.tar.gz"],
Expand Down
16 changes: 0 additions & 16 deletions Neverlink_jruby_jars.patch

This file was deleted.

2 changes: 2 additions & 0 deletions bazel/private/file_concat/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")

cc_binary(
name = "file_concat",
srcs = [
Expand Down
1 change: 1 addition & 0 deletions bazel/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("//bazel:proto_descriptor_set.bzl", "proto_descriptor_set")
load("//bazel:proto_library.bzl", "proto_library")
load(":bazel_proto_library_tests.bzl", "bazel_proto_library_test_suite")
Expand Down
2 changes: 1 addition & 1 deletion bazel/tests/bazel_proto_library_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def _test_experimental_proto_descriptor_sets_include_source_info(name):
name = name,
target = name + "_a_proto",
impl = _test_experimental_proto_descriptor_sets_include_source_info_impl,
config_settings = {"//bazel/flags:experimental_proto_descriptor_sets_include_source_info": True},
config_settings = {"@@//bazel/flags:experimental_proto_descriptor_sets_include_source_info": True},
)

def _test_experimental_proto_descriptor_sets_include_source_info_impl(env, target):
Expand Down
16 changes: 9 additions & 7 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@ if(${CMAKE_VERSION} VERSION_GREATER 3.16 OR ${CMAKE_VERSION} VERSION_EQUAL 3.16)
include_guard()
endif()

set(apple_support-version "1.15.1")
set(apple_support-version "1.16.0")
set(rules_proto-version "7.1.0")
set(abseil-cpp-version "20250512.1")
set(rules_cc-version "0.0.17")
set(zlib-version "1.3.1.bcr.5")
set(zlib-version "1.3.1")
set(bazel_features-version "1.33.0")
set(bazel_skylib-version "1.9.0")
set(jsoncpp-version "1.9.6")
set(rules_java-version "8.6.1")
set(rules_jvm_external-version "6.7")
set(rules_kotlin-version "1.9.6")
set(rules_kotlin-version "2.2.2")
set(rules_license-version "1.0.0")
set(rules_pkg-version "1.0.1")
set(rules_python-version "1.6.0")
set(rules_rust-version "0.63.0")
set(rules_ruby-version "0.17.3")
set(rules_ruby-version "0.20.1")
set(rules_fuzzing-version "0.5.3")
set(rules_shell-version "0.2.0")
set(aspect_bazel_lib-version "2.22.5")
set(rules_shell-version "0.6.1")
set(platforms-version "0.0.11")
set(re2-version "2024-07-02.bcr.1")
set(googletest-version "1.15.2")
set(re2-version "2024-07-02")
set(googletest-version "1.17.0")
set(rules_buf-version "0.3.0")
set(rules_testing-version "0.9.0")
set(abseil-py-version "2.1.0")
Expand Down
4 changes: 4 additions & 0 deletions cmake/dependencies_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import print_function

import os
import re
import sys
import textwrap

Expand Down Expand Up @@ -70,6 +71,9 @@ def module(self, *args, **kwargs):
pass

def bazel_dep(self, name, version, **kwargs):
# Strip BCR-specific version suffixes (e.g. 1.17.0.bcr.2 -> 1.17.0)
# since they don't correspond to upstream git tags.
version = re.sub(r'\.bcr\.\d+', '', version)
self.converter.toplevel += textwrap.dedent(
"""\
set(%(name)s-version "%(version)s")
Expand Down
1 change: 1 addition & 0 deletions editions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ cc_binary(

cc_library(
name = "defaults_test_embedded",
testonly = True,
hdrs = [
"defaults_test_embedded.h",
"defaults_test_embedded_base64.h",
Expand Down
92 changes: 92 additions & 0 deletions patches/protobuf_v25/0008-bazel9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
diff --git a/build_defs/cc_proto_blacklist_test.bzl b/build_defs/cc_proto_blacklist_test.bzl
index 260abde..2c100d9 100644
--- a/build_defs/cc_proto_blacklist_test.bzl
+++ b/build_defs/cc_proto_blacklist_test.bzl
@@ -1,6 +1,7 @@
"""Contains a unittest to verify that `cc_proto_library` does not generate code for blacklisted `.proto` sources (i.e. WKPs)."""

load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
+load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

def _cc_proto_blacklist_test_impl(ctx):
"""Verifies that there are no C++ compile actions for Well-Known-Protos.
diff --git a/java/osgi/osgi.bzl b/java/osgi/osgi.bzl
index 40ee084..ec43c8b 100644
--- a/java/osgi/osgi.bzl
+++ b/java/osgi/osgi.bzl
@@ -1,6 +1,7 @@
""" Custom rule to generate OSGi Manifest """

load("@rules_java//java:defs.bzl", "java_library")
+load("@rules_java//java/common:java_info.bzl", "JavaInfo")

# Note that this rule is currently agnostic of protobuf concerns and could be
# pulled out as a general purpose helper to allow migrations from maven to bazel
diff --git a/non_module_deps.bzl b/non_module_deps.bzl
index 0b3c572..b637402 100644
--- a/non_module_deps.bzl
+++ b/non_module_deps.bzl
@@ -14,6 +14,8 @@ def _non_module_deps_impl(ctx):
repo = "https://github.com/protocolbuffers/utf8_range",
commit = "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f",
sha256 = "5da960e5e5d92394c809629a03af3c7709d2d3d0ca731dacb3a9fb4bf28f7702",
+ patches = ["utf8_range.patch"],
+ patch_args = ["-p1"],
)

non_module_deps = module_extension(implementation = _non_module_deps_impl)
\ No newline at end of file
diff --git a/src/google/protobuf/compiler/rust/BUILD.bazel b/src/google/protobuf/compiler/rust/BUILD.bazel
index f404bea..7135cd4 100644
--- a/src/google/protobuf/compiler/rust/BUILD.bazel
+++ b/src/google/protobuf/compiler/rust/BUILD.bazel
@@ -2,6 +2,7 @@
# Protocol Buffers Compiler - Rust code generator
################################################################################

+load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//build_defs:cpp_opts.bzl", "COPTS")

diff --git a/src/google/protobuf/compiler/test_plugin_injection.bzl b/src/google/protobuf/compiler/test_plugin_injection.bzl
index aec2544..210d942 100644
--- a/src/google/protobuf/compiler/test_plugin_injection.bzl
+++ b/src/google/protobuf/compiler/test_plugin_injection.bzl
@@ -28,6 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//build_defs:cpp_opts.bzl", "COPTS")

# This works around https://github.com/bazelbuild/bazel/issues/19124 by using a generated header to
@@ -55,8 +56,7 @@ cat <<'EOF' >$(OUTS)
visibility = ["//visibility:private"],
testonly = True,
)
-
- native.cc_library(
+ cc_library(
name = name,
hdrs = [hdr],
strip_include_prefix = "/src",
diff --git a/utf8_range.patch b/utf8_range.patch
new file mode 100644
index 0000000..d45bcb6
--- /dev/null
+++ b/utf8_range.patch
@@ -0,0 +1,14 @@
+diff --git a/BUILD.bazel b/BUILD.bazel
+index aa98b84..5882efe 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -4,6 +4,9 @@
+ # license that can be found in the LICENSE file or at
+ # https://opensource.org/licenses/MIT.
+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
++load("@rules_cc//cc:cc_test.bzl", "cc_test")
++
+ package(
+ default_visibility = ["//visibility:public"],
+ )
Loading
Loading