Skip to content

Commit dd95630

Browse files
committed
build: Switch to Bazel 8.0.1 for development and default testing
We drop the dev dependency to stardoc, which we do not actually need. We stop using `--nolegacy_external_runfiles` as it is the default with Bazel 8. Strictly speaking this reduces the performance in some aspect integration tests. But given the difference is minimal, we prefer an overall clean and consistent setup not mentioning this flag.
1 parent 974acb6 commit dd95630

File tree

11 files changed

+8
-26
lines changed

11 files changed

+8
-26
lines changed

.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Always tell why tests fail
22
test --test_output=errors
33

4-
# When working with hermetic Python toolchains, supporting the legacy runfiles layout is needlessly wasting resources.
5-
# See https://github.com/bazelbuild/rules_python/issues/1653
6-
common --nolegacy_external_runfiles
7-
84
# Allow users to provide their own workspace settings
95
try-import %workspace%/user.bazelrc

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.1
1+
8.0.1

MODULE.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ use_repo(non_module_dependencies, "dwyu_pcpp")
1717
###
1818

1919
bazel_dep(name = "aspect_bazel_lib", version = "2.10.0", dev_dependency = True)
20-
bazel_dep(name = "stardoc", version = "0.7.2", dev_dependency = True)
20+
21+
# Hidden dependencies of aspect_bazel_lib macro stardoc_with_diff_test
22+
bazel_dep(name = "platforms", version = "0.0.11", dev_dependency = True)
2123

2224
python = use_extension(
2325
"@rules_python//python/extensions:python.bzl",

examples/.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Do not waste memory by keeping idle Bazel servers around
22
startup --max_idle_secs=10
33

4-
# When working with hermetic Python toolchains, supporting the legacy runfiles layout is needlessly wasting resources.
5-
# See https://github.com/bazelbuild/rules_python/issues/1653
6-
common --nolegacy_external_runfiles
7-
84
# The symlinks are cluttering the file tree without much value
95
common --experimental_convenience_symlinks=ignore

examples/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.1
1+
8.0.1

examples/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Result:
108108
def make_cmd(example: Example, bazel_bin: str, legacy_workspace: bool) -> list[str]:
109109
cmd = [bazel_bin, "build"]
110110
if legacy_workspace:
111-
cmd.append("--noenable_bzlmod")
111+
cmd.extend(["--noenable_bzlmod", "--enable_workspace"])
112112
cmd.extend(shlex.split(example.build_cmd))
113113
return cmd
114114

test/apply_fixes/execution_logic.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,14 @@
3737
"""
3838

3939
BAZEL_RC_FILE = """
40-
# Decrease Python toolchain overhead
41-
# See https://github.com/bazelbuild/rules_python/issues/1653
42-
common --nolegacy_external_runfiles
43-
4440
# Useless as the workspace are thrown away after each creation
4541
common --lockfile_mode=off
4642
4743
# Some users require this setting to mitigate issues due to a large PYTHONPATH created by rules_python
4844
build --noexperimental_python_import_all_repositories
4945
"""
5046

51-
BAZEL_VERSION = "7.4.1"
47+
BAZEL_VERSION = "8.0.1"
5248

5349

5450
def dwyu_path_as_string(dwyu_path: Path) -> str:

test/aspect/.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ startup --max_idle_secs=10
44
# Always tell why tests fail
55
test --test_output=errors
66

7-
# When working with hermetic Python toolchains, supporting the legacy runfiles layout is needlessly wasting resources.
8-
# See https://github.com/bazelbuild/rules_python/issues/1653
9-
common --nolegacy_external_runfiles
10-
117
# The symlinks are cluttering the file tree without much value
128
common --experimental_convenience_symlinks=ignore

test/aspect/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.1
1+
8.0.1

test/aspect/test_case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def _run_bazel_build(
109109
"build",
110110
"--experimental_convenience_symlinks=ignore",
111111
"--noshow_progress",
112-
"--nolegacy_external_runfiles",
113112
*self._extra_args,
114113
*extra_args,
115114
"--",

test/aspect/test_case_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def test_dwyu_command_without_any_extra_args(self, run_mock: MagicMock) -> None:
9191
"build",
9292
"--experimental_convenience_symlinks=ignore",
9393
"--noshow_progress",
94-
"--nolegacy_external_runfiles",
9594
"--@rules_python//python/config_settings:python_version=13.37",
9695
"--aspects=//some:aspect",
9796
"--output_groups=dwyu",
@@ -122,7 +121,6 @@ def test_dwyu_command_with_global_and_dwyu_extra_args(self, run_mock: MagicMock)
122121
"build",
123122
"--experimental_convenience_symlinks=ignore",
124123
"--noshow_progress",
125-
"--nolegacy_external_runfiles",
126124
"--global_arg=23",
127125
"--another_global_arg",
128126
"--@rules_python//python/config_settings:python_version=13.37",
@@ -157,7 +155,6 @@ def test_dwyu_command_with_multiple_targets(self, run_mock: MagicMock) -> None:
157155
"build",
158156
"--experimental_convenience_symlinks=ignore",
159157
"--noshow_progress",
160-
"--nolegacy_external_runfiles",
161158
"--@rules_python//python/config_settings:python_version=13.37",
162159
"--aspects=//some:aspect",
163160
"--output_groups=dwyu",

0 commit comments

Comments
 (0)