Skip to content

Commit d624e03

Browse files
committed
bazel: Update Bazel to a rolling release
Due to incompatible changes, this also requires updating Protobuf and including an unreleased patch for rules_kotlin.
1 parent 2212173 commit d624e03

File tree

5 files changed

+44
-134
lines changed

5 files changed

+44
-134
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
132d2497f4337473fb084677c7f2b98c85e67c92
1+
7.0.0-pre.20230810.1

WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ rules_java_toolchains()
3535
http_archive(
3636
name = "com_google_protobuf",
3737
patches = ["//third_party:protobuf-disable-layering_check.patch"],
38-
sha256 = "ddf8c9c1ffccb7e80afd183b3bd32b3b62f7cc54b106be190bf49f2bc09daab5",
39-
strip_prefix = "protobuf-23.2",
38+
sha256 = "0930b1a6eb840a2295dfcb13bb5736d1292c3e0d61a90391181399327be7d8f1",
39+
strip_prefix = "protobuf-24.1",
4040
# Keep in sync with com_google_protobuf_protobuf_java in repositories.bzl.
41-
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protobuf-23.2.tar.gz"],
41+
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v24.1/protobuf-24.1.tar.gz"],
4242
)
4343

4444
http_archive(

repositories.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def jazzer_dependencies(android = False):
2222
maybe(
2323
http_archive,
2424
name = "platforms",
25-
sha256 = "5308fc1d8865406a49427ba24a9ab53087f17f5266a7aabbfc28823f3916e1ca",
25+
sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51",
2626
urls = [
27-
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.6/platforms-0.0.6.tar.gz",
28-
"https://github.com/bazelbuild/platforms/releases/download/0.0.6/platforms-0.0.6.tar.gz",
27+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
28+
"https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
2929
],
3030
)
3131

@@ -47,6 +47,9 @@ def jazzer_dependencies(android = False):
4747
# https://github.com/bazelbuild/rules_kotlin/pull/1000
4848
# Remove unnecessary dependency on a Java runtime for the target platform.
4949
"//third_party:rules_kotlin-remove-java-runtime-dep.patch",
50+
# https://github.com/bazelbuild/rules_kotlin/pull/1005
51+
# Required for compatibility with recent Bazel 7 pre-releases.
52+
"//third_party:rules_kotlin-remove-java-info-transitive-deps.patch",
5053
],
5154
sha256 = "01293740a16e474669aba5b5a1fe3d368de5832442f164e4fbfc566815a8bc3a",
5255
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.8/rules_kotlin_release.tgz",
@@ -168,9 +171,9 @@ def jazzer_dependencies(android = False):
168171
maybe(
169172
http_jar,
170173
name = "com_google_protobuf_protobuf_java",
171-
sha256 = "18a057f5e0f828daa92b71c19df91f6bcc2aad067ca2cdd6b5698055ca7bcece",
174+
sha256 = "b7eb9203fd2dd6e55b929debf2d079c949e0f9a85f15ec3a298b7534bc7ebd41",
172175
# Keep in sync with com_google_protobuf in WORKSPACE.
173-
url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar",
176+
url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.24.1/protobuf-java-3.24.1.jar",
174177
)
175178

176179
maybe(

third_party/protobuf-disable-layering_check.patch

Lines changed: 5 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -40,138 +40,18 @@ index 77ed2309f..8c38fb872 100644
4040

4141
proto_library(
4242
diff --git src/google/protobuf/compiler/BUILD.bazel src/google/protobuf/compiler/BUILD.bazel
43-
index a2171c806..8dcd34667 100644
43+
index 9b4c243d1..e258c7298 100644
4444
--- src/google/protobuf/compiler/BUILD.bazel
4545
+++ src/google/protobuf/compiler/BUILD.bazel
46-
@@ -13,6 +13,8 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
47-
load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test")
48-
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
49-
46+
@@ -14,6 +14,8 @@ load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test")
47+
load("//build_defs:cpp_opts.bzl", "COPTS")
48+
load("test_plugin_injection.bzl", "inject_plugin_paths")
49+
5050
+package(features = ["-layering_check"])
5151
+
5252
proto_library(
5353
name = "plugin_proto",
5454
srcs = ["plugin.proto"],
55-
diff --git src/google/protobuf/compiler/allowlists/BUILD.bazel src/google/protobuf/compiler/allowlists/BUILD.bazel
56-
index 569a142fc..0a90b312f 100644
57-
--- src/google/protobuf/compiler/allowlists/BUILD.bazel
58-
+++ src/google/protobuf/compiler/allowlists/BUILD.bazel
59-
@@ -1,7 +1,10 @@
60-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
61-
load("//build_defs:cpp_opts.bzl", "COPTS")
62-
63-
-package(default_visibility = ["//visibility:private"])
64-
+package(
65-
+ default_visibility = ["//visibility:private"],
66-
+ features = ["-layering_check"],
67-
+)
68-
69-
cc_library(
70-
name = "allowlist",
71-
diff --git src/google/protobuf/compiler/cpp/BUILD.bazel src/google/protobuf/compiler/cpp/BUILD.bazel
72-
index ac1184d32..deacbf582 100644
73-
--- src/google/protobuf/compiler/cpp/BUILD.bazel
74-
+++ src/google/protobuf/compiler/cpp/BUILD.bazel
75-
@@ -7,6 +7,8 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
76-
load("@rules_proto//proto:defs.bzl", "proto_library")
77-
load("//build_defs:cpp_opts.bzl", "COPTS")
78-
79-
+package(features = ["-layering_check"])
80-
+
81-
cc_library(
82-
name = "names",
83-
hdrs = ["names.h"],
84-
diff --git src/google/protobuf/compiler/csharp/BUILD.bazel src/google/protobuf/compiler/csharp/BUILD.bazel
85-
index 96b8dcbc0..a2d549f26 100644
86-
--- src/google/protobuf/compiler/csharp/BUILD.bazel
87-
+++ src/google/protobuf/compiler/csharp/BUILD.bazel
88-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
89-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
90-
load("//build_defs:cpp_opts.bzl", "COPTS")
91-
92-
+package(features = ["-layering_check"])
93-
+
94-
cc_library(
95-
name = "names",
96-
hdrs = ["names.h"],
97-
diff --git src/google/protobuf/compiler/java/BUILD.bazel src/google/protobuf/compiler/java/BUILD.bazel
98-
index 94573892c..c94f472d6 100644
99-
--- src/google/protobuf/compiler/java/BUILD.bazel
100-
+++ src/google/protobuf/compiler/java/BUILD.bazel
101-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
102-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
103-
load("//build_defs:cpp_opts.bzl", "COPTS")
104-
105-
+package(features = ["-layering_check"])
106-
+
107-
cc_library(
108-
name = "names",
109-
hdrs = ["names.h"],
110-
diff --git src/google/protobuf/compiler/objectivec/BUILD.bazel src/google/protobuf/compiler/objectivec/BUILD.bazel
111-
index f78990394..6c534219a 100644
112-
--- src/google/protobuf/compiler/objectivec/BUILD.bazel
113-
+++ src/google/protobuf/compiler/objectivec/BUILD.bazel
114-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
115-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
116-
load("//build_defs:cpp_opts.bzl", "COPTS")
117-
118-
+package(features = ["-layering_check"])
119-
+
120-
cc_library(
121-
name = "names",
122-
hdrs = ["names.h"],
123-
diff --git src/google/protobuf/compiler/php/BUILD.bazel src/google/protobuf/compiler/php/BUILD.bazel
124-
index fe9e75c2c..a569a1c9d 100644
125-
--- src/google/protobuf/compiler/php/BUILD.bazel
126-
+++ src/google/protobuf/compiler/php/BUILD.bazel
127-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
128-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
129-
load("//build_defs:cpp_opts.bzl", "COPTS")
130-
131-
+package(features = ["-layering_check"])
132-
+
133-
cc_library(
134-
name = "names",
135-
hdrs = ["names.h"],
136-
diff --git src/google/protobuf/compiler/python/BUILD.bazel src/google/protobuf/compiler/python/BUILD.bazel
137-
index 5d26e0ce9..ce017acf1 100644
138-
--- src/google/protobuf/compiler/python/BUILD.bazel
139-
+++ src/google/protobuf/compiler/python/BUILD.bazel
140-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
141-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
142-
load("//build_defs:cpp_opts.bzl", "COPTS")
143-
144-
+package(features = ["-layering_check"])
145-
+
146-
cc_library(
147-
name = "python",
148-
srcs = [
149-
diff --git src/google/protobuf/compiler/ruby/BUILD.bazel src/google/protobuf/compiler/ruby/BUILD.bazel
150-
index 520b69194..1e437e7bc 100644
151-
--- src/google/protobuf/compiler/ruby/BUILD.bazel
152-
+++ src/google/protobuf/compiler/ruby/BUILD.bazel
153-
@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
154-
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
155-
load("//build_defs:cpp_opts.bzl", "COPTS")
156-
157-
+package(features = ["-layering_check"])
158-
+
159-
cc_library(
160-
name = "ruby",
161-
srcs = ["ruby_generator.cc"],
162-
diff --git src/google/protobuf/compiler/rust/BUILD.bazel src/google/protobuf/compiler/rust/BUILD.bazel
163-
index 7c1f5b856..4a10038d1 100644
164-
--- src/google/protobuf/compiler/rust/BUILD.bazel
165-
+++ src/google/protobuf/compiler/rust/BUILD.bazel
166-
@@ -5,6 +5,8 @@
167-
load("@rules_cc//cc:defs.bzl", "cc_library")
168-
load("//build_defs:cpp_opts.bzl", "COPTS")
169-
170-
+package(features = ["-layering_check"])
171-
+
172-
cc_library(
173-
name = "rust",
174-
srcs = ["generator.cc"],
17555
diff --git src/google/protobuf/io/BUILD.bazel src/google/protobuf/io/BUILD.bazel
17656
index 8f39625c2..fc2f8e002 100644
17757
--- src/google/protobuf/io/BUILD.bazel
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 5633d284a6c77882487ef58885dbcbfd24c07f9c Mon Sep 17 00:00:00 2001
2+
From: hvadehra <[email protected]>
3+
Date: Fri, 11 Aug 2023 09:10:16 +0200
4+
Subject: [PATCH] Migrate usages deprecated `JavaInfo` fields
5+
6+
transitive_deps was an alias for transitive_compile_time_jars transitive_runtime_deps was an alias for transitive_runtime_jars
7+
8+
The fields were deprecated in 2021, and are dropped in Bazel@HEAD
9+
10+
Fixes bazelbuild#1003
11+
---
12+
kotlin/internal/jvm/compile.bzl | 2 +-
13+
1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+
diff --git a/kotlin/internal/jvm/compile.bzl b/kotlin/internal/jvm/compile.bzl
16+
index 80cbf7a8..327a0bdc 100644
17+
--- a/kotlin/internal/jvm/compile.bzl
18+
+++ b/kotlin/internal/jvm/compile.bzl
19+
@@ -261,7 +261,7 @@ def _run_merge_jdeps_action(ctx, toolchains, jdeps, outputs, deps):
20+
)
21+
22+
# For sandboxing to work, and for this action to be deterministic, the compile jars need to be passed as inputs
23+
- inputs = depset(jdeps, transitive = [depset([], transitive = [dep.transitive_deps for dep in deps])])
24+
+ inputs = depset(jdeps, transitive = [depset([], transitive = [dep.transitive_compile_time_jars for dep in deps])])
25+
26+
ctx.actions.run(
27+
mnemonic = mnemonic,

0 commit comments

Comments
 (0)