Skip to content

Commit 3dee6dd

Browse files
authored
Upgrade to Bazel 9.0.0 (#309)
1 parent 797be97 commit 3dee6dd

File tree

37 files changed

+591
-340
lines changed

37 files changed

+591
-340
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run --workspace_status_command="bash tools/workspace-status.sh"
22
common --enable_platform_specific_config
3-
common --incompatible_enable_proto_toolchain_resolution
3+
common --@protobuf//bazel/toolchains:prefer_prebuilt_protoc
44
common --protocopt=--fatal_warnings
55

66
# Required to make protobuf compile on Windows

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.0.0rc1
1+
9.0.0

MODULE.bazel

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
module(name = "com_github_buildbarn_bb_storage")
22

3-
bazel_dep(name = "aspect_bazel_lib", version = "2.21.2")
4-
bazel_dep(name = "aspect_rules_js", version = "2.8.0")
3+
bazel_dep(name = "aspect_bazel_lib", version = "2.22.5")
4+
bazel_dep(name = "aspect_rules_js", version = "2.9.2")
55
bazel_dep(name = "bazel_remote_apis", version = "0")
6-
bazel_dep(name = "gazelle", version = "0.46.0")
7-
bazel_dep(name = "googleapis", version = "0.0.0-20251104-53af3b72")
8-
bazel_dep(name = "grpc", version = "1.76.0")
6+
bazel_dep(name = "gazelle", version = "0.47.0")
7+
bazel_dep(name = "googleapis", version = "0.0.0-20260109-6145b5ff")
8+
bazel_dep(name = "grpc", version = "1.76.0.bcr.1")
99
bazel_dep(name = "jsonnet_go", version = "0.21.0")
1010
bazel_dep(name = "opentelemetry-proto", version = "1.8.0")
11-
bazel_dep(name = "toolchains_protoc", version = "0.6.0") # must come BEFORE protobuf so the toolchain registration wins
1211
bazel_dep(name = "platforms", version = "1.0.0")
13-
bazel_dep(name = "protobuf", version = "33.0")
12+
bazel_dep(name = "protobuf", version = "33.4")
1413
bazel_dep(name = "protoc-gen-validate", version = "1.3.0")
1514
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
1615
bazel_dep(name = "rules_go", version = "0.59.0")
17-
bazel_dep(name = "rules_img", version = "0.2.9")
16+
bazel_dep(name = "rules_img", version = "0.3.3")
1817
bazel_dep(name = "rules_jsonnet", version = "0.7.2")
19-
bazel_dep(name = "rules_nodejs", version = "6.6.0")
18+
bazel_dep(name = "rules_nodejs", version = "6.7.3")
2019
bazel_dep(name = "rules_proto", version = "7.1.0")
2120
bazel_dep(name = "rules_shell", version = "0.6.1")
22-
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
21+
bazel_dep(name = "toolchains_llvm", version = "1.6.0")
2322

2423
git_override(
2524
module_name = "bazel_remote_apis",
@@ -32,12 +31,13 @@ single_version_override(
3231
patches = ["//:patches/gazelle/dont-flatten-srcs.diff"],
3332
)
3433

35-
# Match protobuf above, until it ships a pre-built binary toolchain itself
36-
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
37-
protoc.toolchain(version = "v33.0")
34+
single_version_override(
35+
module_name = "jsonnet_go",
36+
patches = ["//:patches/jsonnet_go/bazel-9.diff"],
37+
)
3838

3939
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
40-
go_sdk.download(version = "1.25.4")
40+
go_sdk.download(version = "1.25.6")
4141

4242
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
4343
go_deps.from_file(go_mod = "//:go.mod")

MODULE.bazel.lock

Lines changed: 376 additions & 292 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

patches/jsonnet_go/bazel-9.diff

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
diff --git MODULE.bazel MODULE.bazel
2+
index daacd76..3373ccd 100644
3+
--- MODULE.bazel
4+
+++ MODULE.bazel
5+
@@ -24,11 +24,13 @@ CPP_JSONNET_URL = (
6+
# even exactly match a released version).
7+
http_archive(
8+
name = "cpp_jsonnet",
9+
+ patches = ["//:cpp_jsonnet.diff"],
10+
sha256 = CPP_JSONNET_SHA256,
11+
strip_prefix = CPP_JSONNET_STRIP_PREFIX,
12+
urls = [CPP_JSONNET_URL],
13+
)
14+
15+
+bazel_dep(name = "rules_cc", version = "0.2.16")
16+
bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle")
17+
bazel_dep(name = "rules_go", version = "0.53.0", repo_name = "io_bazel_rules_go")
18+
19+
diff --git cpp_jsonnet.diff cpp_jsonnet.diff
20+
new file mode 100644
21+
index 0000000..0126bf4
22+
--- /dev/null
23+
+++ cpp_jsonnet.diff
24+
@@ -0,0 +1,143 @@
25+
+commit 218bc6532798e7a530dd5a048a6be1046b77c914
26+
+Author: Benjamin Peterson <benjamin@engflow.com>
27+
+Date: Mon Dec 1 15:59:23 2025 -0600
28+
+
29+
+ add loads for cc rules to BUILD files
30+
+
31+
+ builtin rules are removed in newer versions of Bazel
32+
+
33+
+diff --git MODULE.bazel MODULE.bazel
34+
+index 32c00af..9e70a3b 100644
35+
+--- MODULE.bazel
36+
++++ MODULE.bazel
37+
+@@ -5,3 +5,4 @@ module(
38+
+
39+
+ bazel_dep(name = "googletest", version = "1.16.0")
40+
+ bazel_dep(name = "rules_python", version = "1.2.0")
41+
++bazel_dep(name = "rules_cc", version = "0.2.14")
42+
+diff --git cmd/BUILD cmd/BUILD
43+
+index 51803a4..9efb186 100644
44+
+--- cmd/BUILD
45+
++++ cmd/BUILD
46+
+@@ -1,3 +1,6 @@
47+
++load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
48+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
49+
++
50+
+ package(default_visibility = ["//visibility:private"])
51+
+
52+
+ cc_library(
53+
+diff --git core/BUILD core/BUILD
54+
+index 5508488..1e2d485 100644
55+
+--- core/BUILD
56+
++++ core/BUILD
57+
+@@ -1,3 +1,6 @@
58+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
59+
++load("@rules_cc//cc:cc_test.bzl", "cc_test")
60+
++
61+
+ package(default_visibility = ["//visibility:private"])
62+
+
63+
+ cc_library(
64+
+diff --git cpp/BUILD cpp/BUILD
65+
+index ca996c3..43770b3 100644
66+
+--- cpp/BUILD
67+
++++ cpp/BUILD
68+
+@@ -1,3 +1,6 @@
69+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
70+
++load("@rules_cc//cc:cc_test.bzl", "cc_test")
71+
++
72+
+ package(default_visibility = ["//visibility:private"])
73+
+
74+
+ cc_library(
75+
+diff --git examples/bazel/BUILD examples/bazel/BUILD
76+
+index 5be8463..d95cf84 100644
77+
+--- examples/bazel/BUILD
78+
++++ examples/bazel/BUILD
79+
+@@ -1,3 +1,4 @@
80+
++load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
81+
+ load("@rules_python//python:defs.bzl", "py_binary")
82+
+
83+
+ cc_binary(
84+
+diff --git examples/bazel/MODULE.bazel examples/bazel/MODULE.bazel
85+
+index 1888e07..728dc0b 100644
86+
+--- examples/bazel/MODULE.bazel
87+
++++ examples/bazel/MODULE.bazel
88+
+@@ -1,5 +1,9 @@
89+
+ # Example of using jsonnet by depending on the Bazel module.
90+
+
91+
+ bazel_dep(name = "rules_python", version = "1.2.0")
92+
++bazel_dep(name = "rules_cc", version = "0.2.14")
93+
+ bazel_dep(name = "jsonnet")
94+
+-local_path_override(module_name = "jsonnet", path = "../..")
95+
++local_path_override(
96+
++ module_name = "jsonnet",
97+
++ path = "../..",
98+
++)
99+
+diff --git include/BUILD include/BUILD
100+
+index 3893ba4..869e438 100644
101+
+--- include/BUILD
102+
++++ include/BUILD
103+
+@@ -1,3 +1,5 @@
104+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
105+
++
106+
+ package(default_visibility = ["//visibility:private"])
107+
+
108+
+ cc_library(
109+
+diff --git python/BUILD python/BUILD
110+
+index 513f2dc..ab5294f 100644
111+
+--- python/BUILD
112+
++++ python/BUILD
113+
+@@ -1,3 +1,4 @@
114+
++load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
115+
+ load("@rules_python//python:defs.bzl", "py_library", "py_test")
116+
+
117+
+ package(default_visibility = ["//visibility:private"])
118+
+diff --git stdlib/BUILD stdlib/BUILD
119+
+index de1c31a..c7d4a70 100644
120+
+--- stdlib/BUILD
121+
++++ stdlib/BUILD
122+
+@@ -1,3 +1,5 @@
123+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
124+
++
125+
+ package(default_visibility = ["//visibility:private"])
126+
+
127+
+ filegroup(
128+
+diff --git test_suite/BUILD test_suite/BUILD
129+
+index 12c8937..17ed1ad 100644
130+
+--- test_suite/BUILD
131+
++++ test_suite/BUILD
132+
+@@ -1,3 +1,5 @@
133+
++load("@rules_shell//shell:sh_library.bzl", "sh_library")
134+
++
135+
+ package(default_visibility = ["//visibility:private"])
136+
+
137+
+ # Export the tests.source so it can be used by Bazel tests elsewhere in the repo.
138+
+diff --git third_party/json/BUILD third_party/json/BUILD
139+
+index 1d23af1..d4ede23 100644
140+
+--- third_party/json/BUILD
141+
++++ third_party/json/BUILD
142+
+@@ -1,3 +1,5 @@
143+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
144+
++
145+
+ licenses(["permissive"])
146+
+
147+
+ package(default_visibility = ["//visibility:private"])
148+
+diff --git third_party/md5/BUILD third_party/md5/BUILD
149+
+index 840ebd4..bd158c8 100644
150+
+--- third_party/md5/BUILD
151+
++++ third_party/md5/BUILD
152+
+@@ -1,3 +1,5 @@
153+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
154+
++
155+
+ licenses(["permissive"])
156+
+
157+
+ package(default_visibility = ["//visibility:private"])
158+
+diff --git third_party/rapidyaml/BUILD third_party/rapidyaml/BUILD
159+
+index 3ce4677..f98c6f3 100644
160+
+--- third_party/rapidyaml/BUILD
161+
++++ third_party/rapidyaml/BUILD
162+
+@@ -1,3 +1,5 @@
163+
++load("@rules_cc//cc:cc_library.bzl", "cc_library")
164+
++
165+
+ licenses(["permissive"])
166+
+
167+
+ package(default_visibility = ["//visibility:private"])

pkg/proto/auth/auth.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proto/auth/auth_grpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proto/blobstore/local/local.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proto/configuration/auth/auth.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proto/configuration/bb_copy/bb_copy.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)