Skip to content

Commit 7b495f9

Browse files
committed
wip: updates for bazel 8 compat
1 parent 7010148 commit 7b495f9

File tree

13 files changed

+16594
-5333
lines changed

13 files changed

+16594
-5333
lines changed

.bazelci/presubmit.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ buildifier:
3939
test_flags:
4040
- "--test_tag_filters=-integration-test"
4141
.common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel
42-
test_flags:
43-
- "--noenable_bzlmod"
4442
build_flags:
4543
- "--noenable_bzlmod"
44+
- "--build_tag_filters=-integration-test"
45+
test_flags:
46+
- "--noenable_bzlmod"
47+
- "--test_tag_filters=-integration-test"
4648
.common_workspace_flags: &common_workspace_flags
4749
test_flags:
4850
- "--noenable_bzlmod"
@@ -120,11 +122,13 @@ tasks:
120122
<<: *common_workspace_flags_min_bazel
121123
name: "Default: Ubuntu, workspace, minimum Bazel"
122124
platform: ubuntu2004
125+
123126
ubuntu_min_bzlmod:
124127
<<: *minimum_supported_version
125128
<<: *reusable_config
126129
name: "Default: Ubuntu, bzlmod, minimum Bazel"
127130
platform: ubuntu2004
131+
bazel: 7.x
128132
ubuntu:
129133
<<: *reusable_config
130134
name: "Default: Ubuntu"
@@ -171,6 +175,7 @@ tasks:
171175
<<: *reusable_config
172176
name: "RBE: Ubuntu, minimum Bazel"
173177
platform: rbe_ubuntu2004
178+
bazel: 7.x
174179
build_flags:
175180
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
176181
# which prevents cc toolchain autodetection from working correctly
@@ -232,24 +237,28 @@ tasks:
232237
name: "examples/bzlmod: Ubuntu, minimum Bazel"
233238
working_directory: examples/bzlmod
234239
platform: ubuntu2004
240+
bazel: 7.x
235241
integration_test_bzlmod_ubuntu:
236242
<<: *reusable_build_test_all
237243
<<: *coverage_targets_example_bzlmod
238244
name: "examples/bzlmod: Ubuntu"
239245
working_directory: examples/bzlmod
240246
platform: ubuntu2004
247+
bazel: 7.x
241248
integration_test_bzlmod_debian:
242249
<<: *reusable_build_test_all
243250
<<: *coverage_targets_example_bzlmod
244251
name: "examples/bzlmod: Debian"
245252
working_directory: examples/bzlmod
246253
platform: debian11
254+
bazel: 7.x
247255
integration_test_bzlmod_macos:
248256
<<: *reusable_build_test_all
249257
<<: *coverage_targets_example_bzlmod
250258
name: "examples/bzlmod: macOS"
251259
working_directory: examples/bzlmod
252260
platform: macos
261+
bazel: 7.x
253262
integration_test_bzlmod_windows:
254263
<<: *reusable_build_test_all
255264
# coverage is not supported on Windows
@@ -262,6 +271,7 @@ tasks:
262271
name: "examples/bzlmod: Ubuntu with lockfile"
263272
working_directory: examples/bzlmod
264273
platform: ubuntu2004
274+
bazel: 7.x
265275
shell_commands:
266276
# Update the lockfiles and fail if it is different.
267277
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -272,6 +282,7 @@ tasks:
272282
name: "examples/bzlmod: macOS with lockfile"
273283
working_directory: examples/bzlmod
274284
platform: macos
285+
bazel: 7.x
275286
shell_commands:
276287
# Update the lockfiles and fail if it is different.
277288
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -284,6 +295,7 @@ tasks:
284295
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
285296
working_directory: examples/bzlmod_build_file_generation
286297
platform: ubuntu2004
298+
bazel: 7.x
287299
integration_test_bzlmod_generation_build_files_ubuntu:
288300
<<: *reusable_build_test_all
289301
<<: *coverage_targets_example_bzlmod_build_file_generation
@@ -350,15 +362,16 @@ tasks:
350362
<<: *minimum_supported_version
351363
<<: *common_workspace_flags_min_bazel
352364
<<: *reusable_build_test_all
353-
name: "examples/pip_parse: Ubuntu, workspace, minimum supporte Bazel version"
365+
name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version"
354366
working_directory: examples/pip_parse
355367
platform: ubuntu2004
356368
integration_test_pip_parse_ubuntu_min_bzlmod:
357369
<<: *minimum_supported_version
358370
<<: *reusable_build_test_all
359-
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
371+
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supported Bazel version"
360372
working_directory: examples/pip_parse
361373
platform: ubuntu2004
374+
bazel: 7.x
362375
integration_test_pip_parse_ubuntu:
363376
<<: *reusable_build_test_all
364377
name: "examples/pip_parse: Ubuntu"
@@ -393,6 +406,7 @@ tasks:
393406
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
394407
working_directory: examples/pip_parse_vendored
395408
platform: ubuntu2004
409+
bazel: 7.x
396410
integration_test_pip_parse_vendored_ubuntu:
397411
<<: *reusable_build_test_all
398412
name: "examples/pip_parse_vendored: Ubuntu"
@@ -573,6 +587,7 @@ tasks:
573587
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
574588
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
575589
platform: ubuntu2004
590+
bazel: 7.x
576591
shell_commands:
577592
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
578593
- "bazel test @compile_pip_requirements//..."

MODULE.bazel

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ module(
66

77
bazel_dep(name = "bazel_features", version = "1.9.1")
88
bazel_dep(name = "bazel_skylib", version = "1.7.1")
9-
bazel_dep(name = "rules_cc", version = "0.0.9")
9+
bazel_dep(name = "rules_cc", version = "0.0.14")
1010
bazel_dep(name = "platforms", version = "0.0.4")
1111

1212
# Those are loaded only when using py_proto_library
1313
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
14-
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
14+
15+
##bazel_dep(name = "protobuf", version = "28.0", repo_name = "com_google_protobuf")
16+
bazel_dep(name = "protobuf", version = "29.0-rc1", repo_name = "com_google_protobuf")
1517

1618
internal_deps = use_extension("//python/private:internal_deps.bzl", "internal_deps")
1719
use_repo(
@@ -144,7 +146,7 @@ bazel_binaries.local(
144146
path = "tests/integration/bazel_from_env",
145147
)
146148
bazel_binaries.download(version = "6.4.0")
147-
bazel_binaries.download(version = "7.3.1")
149+
bazel_binaries.download(version = "7.4.0")
148150
bazel_binaries.download(version = "rolling")
149151
use_repo(
150152
bazel_binaries,
@@ -153,7 +155,7 @@ use_repo(
153155
# that should be use_repo()'d, so we add them as requested
154156
"bazel_binaries_bazelisk",
155157
"build_bazel_bazel_6_4_0",
156-
"build_bazel_bazel_7_3_1",
158+
"build_bazel_bazel_7_4_0",
157159
"build_bazel_bazel_rolling",
158160
"build_bazel_bazel_self",
159161
)
@@ -171,3 +173,27 @@ register_toolchains(
171173
"@uv_toolchains//:all",
172174
dev_dependency = True,
173175
)
176+
177+
##bazel_dep(name = "toolchains_protoc", version = "0.3.3", dev_dependency = True)
178+
##
179+
##protoc = use_extension(
180+
## "@toolchains_protoc//protoc:extensions.bzl",
181+
## "protoc",
182+
## dev_dependency = True,
183+
##)
184+
##protoc.toolchain(
185+
## google_protobuf = "com_google_protobuf",
186+
## # Demonstrate overriding the default version
187+
## version = "v28.0",
188+
##)
189+
##use_repo(
190+
## protoc,
191+
## ##"com_google_protobuf",
192+
## "toolchains_protoc_hub",
193+
##)
194+
##
195+
##register_toolchains(
196+
## "@toolchains_protoc_hub//:all",
197+
## "//tools/toolchains:all",
198+
## dev_dependency = True,
199+
##)

docs/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ dependencies = [
1212
"readthedocs-sphinx-ext",
1313
"absl-py",
1414
"typing-extensions",
15-
"sphinx-reredirects"
15+
"sphinx-reredirects",
16+
"protobuf"
1617
]

docs/requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ packaging==24.1 \
242242
# via
243243
# readthedocs-sphinx-ext
244244
# sphinx
245+
protobuf==5.28.3 \
246+
--hash=sha256:0c4eec6f987338617072592b97943fdbe30d019c56126493111cf24344c1cc24 \
247+
--hash=sha256:135658402f71bbd49500322c0f736145731b16fc79dc8f367ab544a17eab4535 \
248+
--hash=sha256:27b246b3723692bf1068d5734ddaf2fccc2cdd6e0c9b47fe099244d80200593b \
249+
--hash=sha256:3e6101d095dfd119513cde7259aa703d16c6bbdfae2554dfe5cfdbe94e32d548 \
250+
--hash=sha256:3fa2de6b8b29d12c61911505d893afe7320ce7ccba4df913e2971461fa36d584 \
251+
--hash=sha256:64badbc49180a5e401f373f9ce7ab1d18b63f7dd4a9cdc43c92b9f0b481cef7b \
252+
--hash=sha256:70585a70fc2dd4818c51287ceef5bdba6387f88a578c86d47bb34669b5552c36 \
253+
--hash=sha256:712319fbdddb46f21abb66cd33cb9e491a5763b2febd8f228251add221981135 \
254+
--hash=sha256:91fba8f445723fcf400fdbe9ca796b19d3b1242cd873907979b9ed71e4afe868 \
255+
--hash=sha256:a3f6857551e53ce35e60b403b8a27b0295f7d6eb63d10484f12bc6879c715687 \
256+
--hash=sha256:cee1757663fa32a1ee673434fcf3bf24dd54763c79690201208bafec62f19eed
257+
# via rules-python-docs (docs/pyproject.toml)
245258
pygments==2.18.0 \
246259
--hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \
247260
--hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a

examples/bzlmod/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.3.1
1+
7.x

examples/bzlmod/MODULE.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ local_path_override(
1212
)
1313

1414
# (py_proto_library specific) We are using rules_proto to define rules_proto targets to be consumed by py_proto_library.
15-
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
15+
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
1616

1717
# (py_proto_library specific) Add the protobuf library for well-known types (e.g. `Any`, `Timestamp`, etc)
18-
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
18+
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
19+
bazel_dep(name = "rules_java", version = "8.3.0")
20+
21+
##bazel_dep(name = "rules_rust", version = "0.45.1")
22+
bazel_dep(name = "rules_rust", version = "0.54.1")
1923

2024
# We next initialize the python toolchain using the extension.
2125
# You can set different Python versions in this block.

0 commit comments

Comments
 (0)