Skip to content

Commit 541b216

Browse files
anandoleecopybara-github
authored andcommitted
Add Bazel9 test
PiperOrigin-RevId: 882100299
1 parent eaec88f commit 541b216

File tree

8 files changed

+27
-16
lines changed

8 files changed

+27
-16
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LINT.IfChange(bazelci_presubmit)
22
matrix:
33
platform: ["debian10", "macos", "macos_arm64", "ubuntu2004", "windows"]
4-
bazel: [8.x]
4+
bazel: [8.x, 9.x]
55

66
tasks:
77
verify_targets:

.github/workflows/test_bazel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
runner: [ ubuntu, windows, macos ]
30-
bazelversion: [ '8.0.0' ]
30+
bazelversion: [ '8.0.0', '9.0.0' ]
3131
bzlmod: [ true, false ]
3232
toolchain_resolution:
3333
# Default flags, uses from prebuilt protoc
@@ -73,7 +73,7 @@ jobs:
7373
uses: protocolbuffers/protobuf-ci/bazel@v5
7474
with:
7575
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
76-
bazel-cache: examples-${{ matrix.bazelversion }}-${{ matrix.bzlmod }}-${{ matrix.toolchain_resolution }}
76+
bazel-cache: example-${{ matrix.bazelversion }}-${{ matrix.bzlmod }}-${{ matrix.toolchain_resolution }}
7777
version: ${{ matrix.bazelversion }}
7878
bash: >
7979
cd examples;
@@ -103,7 +103,7 @@ jobs:
103103
uses: protocolbuffers/protobuf-ci/bazel@v5
104104
with:
105105
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
106-
bazel-cache: examples-prebuilt-${{ matrix.bazelversion }}-${{ matrix.toolchain_resolution }}
106+
bazel-cache: example-prebuilt-${{ matrix.bazelversion }}-${{ matrix.toolchain_resolution }}
107107
version: ${{ matrix.bazelversion }}
108108
bash: >
109109
cd examples/example_without_cc_toolchain;

.github/workflows/test_cpp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
cache_key: Bazel8
4545
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:8.0.1-d415763a389bb62a6f126b08c992e83f9f7dc1b4"
4646
targets: "//src/... //third_party/utf8_range/..."
47+
- config: { name: "Bazel9", flags: "--cxxopt=-Wno-self-assign-overloaded --repo_contents_cache=" }
48+
cache_key: Bazel9
49+
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:9.0.0-7932bf8b25fb76a111e7257d151a6a58d5c3c671"
50+
targets: "//src/... //third_party/utf8_range/..."
4751
- config: { name: "TCMalloc" }
4852
cache_key: TcMalloc
4953
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc:8.0.1-d415763a389bb62a6f126b08c992e83f9f7dc1b4"

MODULE.bazel

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ module(
88
repo_name = "com_google_protobuf",
99
)
1010

11+
single_version_override(
12+
module_name = "apple_support",
13+
version = "2.3.0",
14+
)
15+
1116
# LOWER BOUND dependency versions.
1217
# Bzlmod follows MVS:
1318
# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution
1419
# Thus the highest version in their module graph is resolved.
1520

16-
bazel_dep(name = "apple_support", version = "1.16.0", repo_name = "build_bazel_apple_support")
21+
bazel_dep(name = "apple_support", version = "2.3.0", repo_name = "build_bazel_apple_support")
22+
apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
23+
use_repo(apple_cc_configure, "local_config_apple_cc")
1724

1825
# Unused but must be pinned to avoid old broken versions
1926
bazel_dep(name = "rules_proto", version = "7.1.0")
@@ -22,8 +29,8 @@ bazel_dep(name = "rules_proto", version = "7.1.0")
2229
# LINT.IfChange
2330
#endif // PROTO2_OPENSOURCE
2431
# protoc dependencies
25-
bazel_dep(name = "abseil-cpp", version = "20250512.1")
26-
bazel_dep(name = "rules_cc", version = "0.0.17")
32+
bazel_dep(name = "abseil-cpp", version = "20260107.0")
33+
bazel_dep(name = "rules_cc", version = "0.2.17")
2734
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
2835
#ifndef PROTO2_OPENSOURCE
2936
# LINT.ThenChange(//depot/google3/third_party/protobuf/compiler/notices.h)
@@ -39,7 +46,7 @@ bazel_dep(name = "rules_kotlin", version = "2.2.2")
3946
bazel_dep(name = "rules_license", version = "1.0.0")
4047
bazel_dep(name = "rules_pkg", version = "1.0.1")
4148
bazel_dep(name = "rules_python", version = "1.6.0")
42-
bazel_dep(name = "rules_rust", version = "0.63.0")
49+
bazel_dep(name = "rules_rust", version = "0.69.0")
4350

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

WORKSPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
106106

107107
rules_pkg_dependencies()
108108

109-
load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies")
110-
111-
apple_support_dependencies()
112-
113109
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")
114110

115111
rules_cc_dependencies()

ci/common.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ build --incompatible_dont_use_javasourceinfoprovider
4949
build --incompatible_enable_android_toolchain_resolution
5050
build --incompatible_enable_apple_toolchain_resolution
5151
build --incompatible_exclusive_test_sandboxed
52-
build --incompatible_remote_use_new_exit_code_for_lost_inputs
53-
build --incompatible_sandbox_hermetic_tmp
5452
build --incompatible_top_level_aspects_require_providers
5553
build --incompatible_use_cc_configure_from_rules_cc
5654

@@ -68,6 +66,8 @@ build --incompatible_use_cc_configure_from_rules_cc
6866
# --incompatible_disable_objc_library_transition
6967
# --incompatible_fail_on_unknown_attributes
7068
# --incompatible_merge_fixed_and_default_shell_env
69+
# --incompatible_remote_use_new_exit_code_for_lost_inputs
70+
# --incompatible_sandbox_hermetic_tmp
7171

7272
# For easier debugging of build failures.
7373
common --announce_rc

patches/apple_support_bazel9.patch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
--- /dev/null
2+
+++ b/crosstool/BUILD
3+
@@ -0,0 +1,1 @@
4+
+# Empty BUILD file for Bazel 9 compatibility

protobuf_deps.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def protobuf_deps():
163163
if not native.existing_rule("build_bazel_apple_support"):
164164
http_archive(
165165
name = "build_bazel_apple_support",
166-
sha256 = "1ae6fcf983cff3edab717636f91ad0efff2e5ba75607fdddddfd6ad0dbdfaf10",
167-
url = "https://github.com/bazelbuild/apple_support/releases/download/1.24.5/apple_support.1.24.5.tar.gz",
166+
sha256 = "73753c44433272c653ce710bb5f595de99f243b3885876d04a78c2ca3ba90219",
167+
url = "https://github.com/bazelbuild/apple_support/releases/download/2.3.0/apple_support.2.3.0.tar.gz",
168168
)
169169

170170
if not native.existing_rule("rules_kotlin"):

0 commit comments

Comments
 (0)