Skip to content

Commit 444ca88

Browse files
aignasrickeylev
andauthored
ci: fix CI after bazel 8 release (#2492)
Summary: * Remove the old `7.x` config from all `.bazelrc`. * Drop bazel 6 from example testing/support. The `.bazelrc` for enabling `WORKSPACE` cannot work across bazel 6,7,8. * Add missing `BUILD.bazel` file for integration tests. * Remove an integration test runner for `bazel 6.x`. * RBE test for bazel 8 is still not working. * bump `rules_java` for internal WORKSPACE dependencies to a version that supports `8.x`. * start running bazel-in-bazel integration tests using bazel `8.x`. * until bazel-contrib/rules_bazel_integration_test#414 is merged, we need to use bazel 7 for the delete_packagese pre-commit hook, not sure about how to track this as the `cgrindel/bazel-lib` needs a new version. Fixes #2378 --------- Co-authored-by: Richard Levasseur <[email protected]>
1 parent 622989e commit 444ca88

File tree

18 files changed

+63
-63
lines changed

18 files changed

+63
-63
lines changed

.bazelci/presubmit.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ buildifier:
1818
# Use a specific version to avoid skew issues when new versions are released.
1919
version: 6.1.0
2020
warnings: "all"
21-
# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod
21+
# NOTE: Minimum supported version is 7.x
2222
.minimum_supported_version: &minimum_supported_version
2323
# For testing minimum supported version.
2424
# NOTE: Keep in sync with //:version.bzl
25-
bazel: 6.4.0
26-
skip_in_bazel_downstream_pipeline: "Bazel 6 required"
25+
bazel: 7.x
26+
skip_in_bazel_downstream_pipeline: "Bazel 7 required"
2727
.reusable_config: &reusable_config
2828
build_targets:
2929
- "--"
@@ -34,7 +34,6 @@ buildifier:
3434
build_flags:
3535
- "--keep_going"
3636
- "--build_tag_filters=-integration-test"
37-
- "--config=bazel7.x"
3837
test_targets:
3938
- "--"
4039
- "..."
@@ -55,6 +54,7 @@ buildifier:
5554
build_flags:
5655
- "--noenable_bzlmod"
5756
- "--enable_workspace"
57+
bazel: 7.x
5858
.common_bazelinbazel_config: &common_bazelinbazel_config
5959
build_flags:
6060
- "--build_tag_filters=integration-test"
@@ -159,7 +159,6 @@ tasks:
159159
- "--enable_workspace"
160160
- "--keep_going"
161161
- "--build_tag_filters=-integration-test"
162-
- "--config=bazel7.x"
163162
test_targets:
164163
- "--"
165164
- "..."
@@ -187,7 +186,6 @@ tasks:
187186
<<: *reusable_config
188187
name: "RBE: Ubuntu, minimum Bazel"
189188
platform: rbe_ubuntu2004
190-
bazel: 7.x
191189
build_flags:
192190
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
193191
# which prevents cc toolchain autodetection from working correctly
@@ -206,6 +204,9 @@ tasks:
206204
<<: *reusable_config
207205
name: "RBE: Ubuntu"
208206
platform: rbe_ubuntu2004
207+
# TODO @aignas 2024-12-11: get the RBE working in CI for bazel 8.0
208+
# See https://github.com/bazelbuild/rules_python/issues/2499
209+
bazel: 7.x
209210
test_flags:
210211
- "--test_tag_filters=-integration-test,-acceptance-test"
211212
- "--extra_toolchains=@buildkite_config//config:cc-toolchain"
@@ -412,25 +413,21 @@ tasks:
412413
name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel"
413414
working_directory: examples/pip_parse_vendored
414415
platform: ubuntu2004
415-
integration_test_pip_parse_vendored_ubuntu_min_bzlmod:
416-
<<: *minimum_supported_version
417-
<<: *reusable_build_test_all
418-
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
419-
working_directory: examples/pip_parse_vendored
420-
platform: ubuntu2004
421-
bazel: 7.x
422416
integration_test_pip_parse_vendored_ubuntu:
423417
<<: *reusable_build_test_all
418+
<<: *common_workspace_flags
424419
name: "examples/pip_parse_vendored: Ubuntu"
425420
working_directory: examples/pip_parse_vendored
426421
platform: ubuntu2004
427422
integration_test_pip_parse_vendored_debian:
428423
<<: *reusable_build_test_all
424+
<<: *common_workspace_flags
429425
name: "examples/pip_parse_vendored: Debian"
430426
working_directory: examples/pip_parse_vendored
431427
platform: debian11
432428
integration_test_pip_parse_vendored_macos:
433429
<<: *reusable_build_test_all
430+
<<: *common_workspace_flags
434431
name: "examples/pip_parse_vendored: MacOS"
435432
working_directory: examples/pip_parse_vendored
436433
platform: macos

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ common --incompatible_disallow_struct_provider_syntax
2323
# Windows makes use of runfiles for some rules
2424
build --enable_runfiles
2525

26-
# Make Bazel 6 use bzlmod by default
26+
# Make Bazel 7 use bzlmod by default
2727
common --enable_bzlmod
2828

2929
# Additional config to use for readthedocs builds.
@@ -33,6 +33,6 @@ build:rtd --stamp
3333
# Some bzl files contain repos only available under bzlmod
3434
build:rtd --enable_bzlmod
3535

36-
common:bazel7.x --incompatible_python_disallow_native_rules
36+
common --incompatible_python_disallow_native_rules
3737

3838
build --lockfile_mode=update

.bazelversion

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

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ repos:
4646
- id: update-deleted-packages
4747
name: Update deleted packages
4848
language: system
49-
entry: bazel run @rules_bazel_integration_test//tools:update_deleted_packages
49+
# 7.x is necessary until https://github.com/bazel-contrib/rules_bazel_integration_test/pull/414
50+
# is merged and released
51+
entry: env USE_BAZEL_VERSION=7.x bazel run @rules_bazel_integration_test//tools:update_deleted_packages
5052
files: ^((examples|tests)/.*/(MODULE.bazel|WORKSPACE|WORKSPACE.bzlmod|BUILD.bazel)|.bazelrc)$
5153
pass_filenames: false

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Unreleased changes template.
5252

5353
{#v0-0-0-changed}
5454
### Changed
55-
* Nothing changed.
55+
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
56+
version, per our Bazel support matrix. Earlier versions are not
57+
tested by CI, so functionality cannot be guaranteed.
5658

5759
{#v0-0-0-fixed}
5860
### Fixed

MODULE.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ bazel_binaries.local(
150150
name = "self",
151151
path = "tests/integration/bazel_from_env",
152152
)
153-
bazel_binaries.download(version = "6.4.0")
154-
bazel_binaries.download(version = "7.4.0")
153+
bazel_binaries.download(version = "7.4.1")
154+
bazel_binaries.download(version = "8.0.0")
155155

156156
# For now, don't test with rolling, because that's Bazel 9, which is a ways
157157
# away.
@@ -162,8 +162,8 @@ use_repo(
162162
# These don't appear necessary, but are reported as direct dependencies
163163
# that should be use_repo()'d, so we add them as requested
164164
"bazel_binaries_bazelisk",
165-
"build_bazel_bazel_6_4_0",
166-
"build_bazel_bazel_7_4_0",
165+
"build_bazel_bazel_7_4_1",
166+
"build_bazel_bazel_8_0_0",
167167
# "build_bazel_bazel_rolling",
168168
"build_bazel_bazel_self",
169169
)

WORKSPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ load("//:internal_dev_deps.bzl", "rules_python_internal_deps")
2121

2222
rules_python_internal_deps()
2323

24+
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
25+
26+
rules_java_dependencies()
27+
28+
# note that the following line is what is minimally required from protobuf for the java rules
29+
# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl
30+
load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility
31+
32+
proto_bazel_features(name = "proto_bazel_features")
33+
34+
# register toolchains
35+
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
36+
37+
rules_java_toolchains()
38+
2439
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
2540

2641
protobuf_deps()

examples/build_file_generation/.bazelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ build --enable_runfiles
55

66
# The bzlmod version of this example is in examples/bzlmod_build_file_generation
77
# Once WORKSPACE support is dropped, this example can be entirely deleted.
8-
build --experimental_enable_bzlmod=false
9-
10-
common:bazel7.x --incompatible_python_disallow_native_rules
8+
common --noenable_bzlmod
9+
common --enable_workspace
10+
common --incompatible_python_disallow_native_rules

examples/pip_parse/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file
22
try-import %workspace%/user.bazelrc
3-
common:bazel7.x --incompatible_python_disallow_native_rules
3+
common --incompatible_python_disallow_native_rules

examples/pip_parse_vendored/.bazelrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ build --enable_runfiles
55

66
# Vendoring requirements.bzl files isn't necessary under bzlmod
77
# When workspace support is dropped, this example can be removed.
8-
build --noexperimental_enable_bzlmod
9-
common:bazel7.x --incompatible_python_disallow_native_rules
8+
common --noenable_bzlmod
9+
common --enable_workspace
10+
common --incompatible_python_disallow_native_rules

0 commit comments

Comments
 (0)