Skip to content

Commit b0cb281

Browse files
committed
wip: updates for bazel 8 compat
1 parent 772b1cc commit b0cb281

File tree

13 files changed

+19795
-5341
lines changed

13 files changed

+19795
-5341
lines changed

.bazelci/presubmit.yml

Lines changed: 16 additions & 2 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"
@@ -232,24 +236,28 @@ tasks:
232236
name: "examples/bzlmod: Ubuntu, minimum Bazel"
233237
working_directory: examples/bzlmod
234238
platform: ubuntu2004
239+
bazel: 7.x
235240
integration_test_bzlmod_ubuntu:
236241
<<: *reusable_build_test_all
237242
<<: *coverage_targets_example_bzlmod
238243
name: "examples/bzlmod: Ubuntu"
239244
working_directory: examples/bzlmod
240245
platform: ubuntu2004
246+
bazel: 7.x
241247
integration_test_bzlmod_debian:
242248
<<: *reusable_build_test_all
243249
<<: *coverage_targets_example_bzlmod
244250
name: "examples/bzlmod: Debian"
245251
working_directory: examples/bzlmod
246252
platform: debian11
253+
bazel: 7.x
247254
integration_test_bzlmod_macos:
248255
<<: *reusable_build_test_all
249256
<<: *coverage_targets_example_bzlmod
250257
name: "examples/bzlmod: macOS"
251258
working_directory: examples/bzlmod
252259
platform: macos
260+
bazel: 7.x
253261
integration_test_bzlmod_windows:
254262
<<: *reusable_build_test_all
255263
# coverage is not supported on Windows
@@ -262,6 +270,7 @@ tasks:
262270
name: "examples/bzlmod: Ubuntu with lockfile"
263271
working_directory: examples/bzlmod
264272
platform: ubuntu2004
273+
bazel: 7.x
265274
shell_commands:
266275
# Update the lockfiles and fail if it is different.
267276
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -272,6 +281,7 @@ tasks:
272281
name: "examples/bzlmod: macOS with lockfile"
273282
working_directory: examples/bzlmod
274283
platform: macos
284+
bazel: 7.x
275285
shell_commands:
276286
# Update the lockfiles and fail if it is different.
277287
- "../../tools/private/update_bzlmod_lockfiles.sh"
@@ -284,6 +294,7 @@ tasks:
284294
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
285295
working_directory: examples/bzlmod_build_file_generation
286296
platform: ubuntu2004
297+
bazel: 7.x
287298
integration_test_bzlmod_generation_build_files_ubuntu:
288299
<<: *reusable_build_test_all
289300
<<: *coverage_targets_example_bzlmod_build_file_generation
@@ -359,6 +370,7 @@ tasks:
359370
name: "examples/pip_parse: Ubuntu, bzlmod, minimum supporte Bazel version"
360371
working_directory: examples/pip_parse
361372
platform: ubuntu2004
373+
bazel: 7.x
362374
integration_test_pip_parse_ubuntu:
363375
<<: *reusable_build_test_all
364376
name: "examples/pip_parse: Ubuntu"
@@ -393,6 +405,7 @@ tasks:
393405
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
394406
working_directory: examples/pip_parse_vendored
395407
platform: ubuntu2004
408+
bazel: 7.x
396409
integration_test_pip_parse_vendored_ubuntu:
397410
<<: *reusable_build_test_all
398411
name: "examples/pip_parse_vendored: Ubuntu"
@@ -573,6 +586,7 @@ tasks:
573586
name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel"
574587
working_directory: tests/integration/compile_pip_requirements_test_from_external_repo
575588
platform: ubuntu2004
589+
bazel: 7.x
576590
shell_commands:
577591
# Assert that @compile_pip_requirements//:requirements_test does the right thing.
578592
- "bazel test @compile_pip_requirements//..."

MODULE.bazel

Lines changed: 32 additions & 6 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.6.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(
@@ -74,9 +76,9 @@ use_repo(pip, "rules_python_publish_deps")
7476
bazel_dep(name = "stardoc", version = "0.6.2", repo_name = "io_bazel_stardoc")
7577

7678
# ===== DEV ONLY DEPS AND SETUP BELOW HERE =====
77-
bazel_dep(name = "rules_bazel_integration_test", version = "0.20.0", dev_dependency = True)
79+
bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_dependency = True)
7880
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
79-
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
81+
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
8082
bazel_dep(name = "rules_multirun", version = "0.9.0", dev_dependency = True)
8183
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
8284

@@ -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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ module(
44
compatibility_level = 1,
55
)
66

7-
bazel_dep(name = "bazel_skylib", version = "1.4.1")
7+
bazel_dep(name = "bazel_skylib", version = "1.6.1")
88
bazel_dep(name = "rules_python", version = "0.0.0")
99
local_path_override(
1010
module_name = "rules_python",
1111
path = "../..",
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")
1920

2021
# We next initialize the python toolchain using the extension.
2122
# You can set different Python versions in this block.
@@ -266,4 +267,4 @@ local_path_override(
266267
)
267268

268269
# example test dependencies
269-
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
270+
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)

0 commit comments

Comments
 (0)