Skip to content

Commit be2f16e

Browse files
authored
tests: add bazel 9 testing, use latest released (not rc) for bazel (#3650)
This runs the default test jobs using the test matrix so that Bazel 9 is better covered by testing. The main thing needed is setting `--incompatible_strict_action_env=false`. This is enabled in Bazel 9, but breaks Windows. See #3655 for details. It also changes to using `N.x` instead of `N.*` for specifying the Bazel version. The difference is `x` matches the latest released version, while `*` matches the latest released _or release candidate_. Since release candidates can have regressions, and we have a separate job for RCs, use the latest released version. Along the way, mark the last_rc job as soft-fail
1 parent 8c2cae6 commit be2f16e

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.bazelci/presubmit.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ buildifier:
113113

114114

115115
matrix:
116+
# Keep in sync with .bcr/presubmit.yml
116117
platform:
117118
- ubuntu2204
118119
- debian11
119120
- macos_arm64
120121
- windows
121-
bazel: [7.*, 8.*, 9.*]
122+
# Keep in sync with .bcr/presubmit.yml
123+
bazel: [7.x, 8.x, 9.x]
122124

123125
tasks:
124126
# Keep in sync with .bcr/presubmit.yml
@@ -187,13 +189,15 @@ tasks:
187189
bazel: 7.x
188190
ubuntu:
189191
<<: *reusable_config
190-
name: "Default: Ubuntu"
192+
name: "Default: Ubuntu, Bazel {bazel}"
191193
platform: ubuntu2204
194+
bazel: ${{ bazel }}
192195
ubuntu_upcoming:
193196
<<: *reusable_config
194197
name: "Default: Ubuntu, upcoming Bazel"
195198
platform: ubuntu2204
196199
bazel: last_rc
200+
# This is an advisory job; doesn't block merges
197201
# RCs may have regressions, so don't fail our CI on them
198202
soft_fail:
199203
- exit_status: 1
@@ -250,16 +254,19 @@ tasks:
250254

251255
debian:
252256
<<: *reusable_config
253-
name: "Default: Debian"
257+
name: "Default: Debian, Bazel {bazel}"
254258
platform: debian11
259+
bazel: ${{ bazel }}
255260
macos_arm64:
256261
<<: *reusable_config
257-
name: "Default: MacOS"
262+
name: "Default: MacOS, Bazel {bazel}"
258263
platform: macos_arm64
264+
bazel: ${{ bazel }}
259265
windows:
260266
<<: *reusable_config
261-
name: "Default: Windows"
267+
name: "Default: Windows, Bazel {bazel}"
262268
platform: windows
269+
bazel: ${{ bazel }}
263270
test_flags:
264271
- "--test_tag_filters=-integration-test,-fix-windows"
265272
rbe_min:

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ common --incompatible_disallow_struct_provider_syntax
2121
# Makes Bazel 7 act more like Bazel 8
2222
common --incompatible_use_plus_in_repo_names
2323

24+
# Needed to make Windows with a py_binary in data deps work. The Bazel launcher
25+
# is used, which falls back to finding python.exe on PATH to bootstrap.
26+
# See https://github.com/bazel-contrib/rules_python/issues/3655
27+
common --incompatible_strict_action_env=false
28+
2429
# Windows makes use of runfiles for some rules
2530
build --enable_runfiles
2631

.bcr/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bcr_test_module:
1616
module_path: "examples/bzlmod"
1717
matrix:
1818
platform: ["debian11", "macos", "ubuntu2204", "windows"]
19-
bazel: [7.*, 8.*, 9.*]
19+
bazel: [7.x, 8.x, 9.x]
2020
tasks:
2121
run_tests:
2222
name: "Run test module"

0 commit comments

Comments
 (0)