Skip to content

Commit 0423b07

Browse files
fmeumrules_java Copybara
authored andcommitted
Fix CI failures with last_green (#321)
Closes #321 COPYBARA_INTEGRATE_REVIEW=#321 from fmeum:patch-3 bfde788 PiperOrigin-RevId: 810011421 Change-Id: I7d91fa12565fe856de8dbfcefb8f640fb6814f24
1 parent faaab40 commit 0423b07

File tree

4 files changed

+217
-5
lines changed

4 files changed

+217
-5
lines changed

MODULE.bazel

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,34 @@ module(
66
)
77

88
bazel_dep(name = "platforms", version = "0.0.11")
9-
bazel_dep(name = "rules_cc", version = "0.0.15")
9+
bazel_dep(name = "rules_cc", version = "0.2.8")
1010
bazel_dep(name = "bazel_features", version = "1.30.0")
1111
bazel_dep(name = "bazel_skylib", version = "1.6.1")
12-
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
12+
bazel_dep(name = "protobuf", version = "32.1", repo_name = "com_google_protobuf")
1313
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
1414

1515
# Required by @remote_java_tools, which is loaded via module extension.
1616
bazel_dep(name = "rules_license", version = "0.0.3")
17-
bazel_dep(name = "abseil-cpp", version = "20230802.1", repo_name = "com_google_absl")
17+
bazel_dep(name = "abseil-cpp", version = "20250814.0", repo_name = "com_google_absl")
18+
19+
# TODO: Remove this override after the next release of abseil-cpp.
20+
single_version_override(
21+
module_name = "abseil-cpp",
22+
patch_strip = 1,
23+
patches = [
24+
"//third_party:abseil-cpp_load-cc-rules.patch",
25+
],
26+
version = "20250814.0",
27+
)
28+
29+
single_version_override(
30+
module_name = "protobuf",
31+
patch_strip = 1,
32+
patches = [
33+
"//third_party:protobuf_load-cc-rules.patch",
34+
],
35+
version = "32.1",
36+
)
1837

1938
register_toolchains("//toolchains:all")
2039

@@ -97,9 +116,9 @@ use_repo(compat, "compatibility_proxy")
97116

98117
# Dev dependencies
99118
bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)
100-
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
119+
bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True)
101120
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
102-
bazel_dep(name = "rules_testing", version = "0.7.0", dev_dependency = True)
121+
bazel_dep(name = "rules_testing", dev_dependency = True)
103122
archive_override(
104123
module_name = "rules_testing",
105124
integrity = "sha256-0+3pLjeZCqn+K1qS7HNr7HbwMXBjxLvJm+pMSUhDel8=",

third_party/BUILD

Whitespace-only changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 2370ccf579bd0fb4484c343389b8121c6b7f9bb8 Mon Sep 17 00:00:00 2001
2+
From: Keith Smiley <[email protected]>
3+
Date: Sat, 20 Sep 2025 20:02:06 -0700
4+
Subject: [PATCH] PR #1939: Add missing rules_cc loads
5+
6+
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1939
7+
8+
This is required for use with bazel past this commit: https://github.com/bazelbuild/bazel/commit/71ca0ed111ff3d842a0d23bc3a46bd2e6745491d
9+
10+
Most files do this already these were just missing
11+
12+
Merge f7d58947afdb0549c9e5c287a5e5851a7d72e1e0 into 620d600442769b7ec4b61bd87667899908eec4ef
13+
14+
Merging this change closes #1939
15+
16+
COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1939 from keith:ks/add-missing-rules_cc-loads f7d58947afdb0549c9e5c287a5e5851a7d72e1e0
17+
PiperOrigin-RevId: 809556509
18+
Change-Id: I494a118b851685a03393485514a3b6fbe3a10597
19+
---
20+
absl/debugging/BUILD.bazel | 3 +++
21+
1 file changed, 3 insertions(+)
22+
23+
diff --git a/absl/debugging/BUILD.bazel b/absl/debugging/BUILD.bazel
24+
index ed7cc493e90..7cc053e783e 100644
25+
--- a/absl/debugging/BUILD.bazel
26+
+++ b/absl/debugging/BUILD.bazel
27+
@@ -14,6 +14,9 @@
28+
# limitations under the License.
29+
#
30+
31+
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
32+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
33+
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
34+
load(
35+
"//absl:copts/configure_copts.bzl",
36+
"ABSL_DEFAULT_COPTS",
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
Backported from https://github.com/protocolbuffers/protobuf/pull/23584 to 32.0:
2+
3+
From 733a0ccf6f53f469352b19440a1d152eccea6bec Mon Sep 17 00:00:00 2001
4+
From: Keith Smiley <[email protected]>
5+
Date: Sat, 20 Sep 2025 09:30:37 -0700
6+
Subject: [PATCH] bazel: add missing rules_cc loads
7+
8+
This is required for use with bazel after this commit https://github.com/bazelbuild/bazel/commit/71ca0ed111ff3d842a0d23bc3a46bd2e6745491d
9+
10+
Many files have these already
11+
---
12+
lua/BUILD.bazel | 3 +++
13+
pkg/test/BUILD.bazel | 1 +
14+
ruby/ext/google/protobuf_c/BUILD.bazel | 1 +
15+
ruby/lib/google/BUILD.bazel | 1 +
16+
rust/defs.bzl | 1 +
17+
src/google/protobuf/compiler/cpp/BUILD.bazel | 1 +
18+
src/google/protobuf/compiler/java/full/BUILD.bazel | 1 +
19+
src/google/protobuf/compiler/java/lite/BUILD.bazel | 1 +
20+
src/google/protobuf/compiler/kotlin/BUILD.bazel | 1 +
21+
src/google/protobuf/compiler/php/BUILD.bazel | 1 +
22+
src/google/protobuf/compiler/rust/BUILD.bazel | 2 ++
23+
toolchain/BUILD.bazel | 2 ++
24+
12 files changed, 16 insertions(+)
25+
26+
diff --git a/lua/BUILD.bazel b/lua/BUILD.bazel
27+
index 389e5da7635ca..db956713bd849 100644
28+
--- a/lua/BUILD.bazel
29+
+++ b/lua/BUILD.bazel
30+
@@ -5,6 +5,9 @@
31+
# license that can be found in the LICENSE file or at
32+
# https://developers.google.com/open-source/licenses/bsd
33+
34+
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
35+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
36+
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
37+
load("//bazel:proto_library.bzl", "proto_library")
38+
load(
39+
"//lua:lua_proto_library.bzl",
40+
diff --git a/pkg/test/BUILD.bazel b/pkg/test/BUILD.bazel
41+
index d0954f0126ba2..4fd01c9759643 100644
42+
--- a/pkg/test/BUILD.bazel
43+
+++ b/pkg/test/BUILD.bazel
44+
@@ -1,5 +1,6 @@
45+
# Tests for CMake file list generation
46+
47+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
48+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
49+
load("//pkg:build_systems.bzl", "gen_file_lists")
50+
load("//pkg:cc_dist_library.bzl", "cc_dist_library")
51+
diff --git a/ruby/ext/google/protobuf_c/BUILD.bazel b/ruby/ext/google/protobuf_c/BUILD.bazel
52+
index 00458e2eedbe4..63276d538cc5c 100644
53+
--- a/ruby/ext/google/protobuf_c/BUILD.bazel
54+
+++ b/ruby/ext/google/protobuf_c/BUILD.bazel
55+
@@ -1,4 +1,5 @@
56+
load("@build_bazel_rules_apple//apple:apple_binary.bzl", "apple_binary")
57+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
58+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
59+
load("//upb/cmake:build_defs.bzl", "staleness_test")
60+
61+
diff --git a/ruby/lib/google/BUILD.bazel b/ruby/lib/google/BUILD.bazel
62+
index db0d7cd6b89bc..157df81b6d734 100644
63+
--- a/ruby/lib/google/BUILD.bazel
64+
+++ b/ruby/lib/google/BUILD.bazel
65+
@@ -1,3 +1,4 @@
66+
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
67+
load("@rules_java//java:java_binary.bzl", "java_binary")
68+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
69+
load("@rules_ruby//ruby:defs.bzl", "rb_library")
70+
diff --git a/rust/defs.bzl b/rust/defs.bzl
71+
index b787d108fc743..54dab26e25048 100644
72+
--- a/rust/defs.bzl
73+
+++ b/rust/defs.bzl
74+
@@ -1,4 +1,5 @@
75+
"""This file implements rust_proto_library."""
76+
77+
+load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
78+
load("@rules_rust//rust:defs.bzl", "rust_common")
79+
load("//bazel/common:proto_common.bzl", "proto_common")
80+
diff --git a/src/google/protobuf/compiler/cpp/BUILD.bazel b/src/google/protobuf/compiler/cpp/BUILD.bazel
81+
index 4d4e99d774772..ced92c04e235d 100644
82+
--- a/src/google/protobuf/compiler/cpp/BUILD.bazel
83+
+++ b/src/google/protobuf/compiler/cpp/BUILD.bazel
84+
@@ -2,6 +2,7 @@
85+
# Protocol Buffers Compiler - C++ code generator
86+
################################################################################
87+
88+
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
89+
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
90+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
91+
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
92+
diff --git a/src/google/protobuf/compiler/java/full/BUILD.bazel b/src/google/protobuf/compiler/java/full/BUILD.bazel
93+
index 6bffaa10fbc87..54b4ae9cd186d 100644
94+
--- a/src/google/protobuf/compiler/java/full/BUILD.bazel
95+
+++ b/src/google/protobuf/compiler/java/full/BUILD.bazel
96+
@@ -1,6 +1,7 @@
97+
# We use abbreviated target names in this directory to work around:
98+
# https://github.com/bazelbuild/bazel/issues/18683
99+
100+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
101+
load("//build_defs:cpp_opts.bzl", "COPTS")
102+
103+
cc_library(
104+
diff --git a/src/google/protobuf/compiler/java/lite/BUILD.bazel b/src/google/protobuf/compiler/java/lite/BUILD.bazel
105+
index 02af1b3f917df..5e04135abbac0 100644
106+
--- a/src/google/protobuf/compiler/java/lite/BUILD.bazel
107+
+++ b/src/google/protobuf/compiler/java/lite/BUILD.bazel
108+
@@ -1,3 +1,4 @@
109+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
110+
load("//build_defs:cpp_opts.bzl", "COPTS")
111+
112+
cc_library(
113+
diff --git a/src/google/protobuf/compiler/kotlin/BUILD.bazel b/src/google/protobuf/compiler/kotlin/BUILD.bazel
114+
index 4f866ae02e1b7..5a1e1b727092b 100644
115+
--- a/src/google/protobuf/compiler/kotlin/BUILD.bazel
116+
+++ b/src/google/protobuf/compiler/kotlin/BUILD.bazel
117+
@@ -1,3 +1,4 @@
118+
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
119+
load("//build_defs:cpp_opts.bzl", "COPTS")
120+
121+
cc_library(
122+
diff --git a/src/google/protobuf/compiler/php/BUILD.bazel b/src/google/protobuf/compiler/php/BUILD.bazel
123+
index 930db4476125b..d41fe6d122adb 100644
124+
--- a/src/google/protobuf/compiler/php/BUILD.bazel
125+
+++ b/src/google/protobuf/compiler/php/BUILD.bazel
126+
@@ -2,6 +2,7 @@
127+
# Protocol Buffers Compiler - PHP code generator
128+
################################################################################
129+
130+
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
131+
load("@rules_cc//cc:defs.bzl", "cc_library")
132+
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
133+
load("//build_defs:cpp_opts.bzl", "COPTS")
134+
diff --git a/src/google/protobuf/compiler/rust/BUILD.bazel b/src/google/protobuf/compiler/rust/BUILD.bazel
135+
index e5766c2abd40b..116e44b76df9c 100644
136+
--- a/src/google/protobuf/compiler/rust/BUILD.bazel
137+
+++ b/src/google/protobuf/compiler/rust/BUILD.bazel
138+
@@ -9,6 +9,8 @@
139+
# Protocol Buffers Compiler - Rust code generator
140+
################################################################################
141+
142+
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
143+
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
144+
load("@rules_cc//cc:defs.bzl", "cc_library")
145+
load("//build_defs:cpp_opts.bzl", "COPTS")
146+
load(
147+
diff --git a/toolchain/BUILD.bazel b/toolchain/BUILD.bazel
148+
index 524fa14390501..4cb056c75ff66 100644
149+
--- a/toolchain/BUILD.bazel
150+
+++ b/toolchain/BUILD.bazel
151+
@@ -1,4 +1,6 @@
152+
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
153+
+load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain")
154+
+load("@rules_cc//cc/toolchains:cc_toolchain_suite.bzl", "cc_toolchain_suite")
155+
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
156+
157+
package(default_visibility = ["//visibility:public"])

0 commit comments

Comments
 (0)