Skip to content

Commit

Permalink
Reduce Windows Python overhead
Browse files Browse the repository at this point in the history
Windows CI jobs are the longest running
  • Loading branch information
martis42 committed Jul 9, 2024
1 parent 3395af1 commit 15962c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Can improve performance in Windows workers
# See https://github.com/bazelbuild/rules_python/blob/7bba79de34b6352001cb42b801245d0de33ce225/docs/sphinx/pypi-dependencies.md#L40
startup --windows_enable_symlinks

# When working with hermetic Python toolchains, supporting the legacy runfiles layout is needlessly wasting resources.
# See https://github.com/bazelbuild/rules_python/issues/1653
common --nolegacy_external_runfiles
Expand Down
6 changes: 6 additions & 0 deletions test/apply_fixes/execution_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"""

BAZEL_RC_FILE = """
# Can improve performance in Windows workers
# See https://github.com/bazelbuild/rules_python/blob/7bba79de34b6352001cb42b801245d0de33ce225/docs/sphinx/pypi-dependencies.md#L40
startup --windows_enable_symlinks
# Decrease Python toolchain overhead
# See https://github.com/bazelbuild/rules_python/issues/1653
common --nolegacy_external_runfiles
common --lockfile_mode=off
"""
Expand Down
3 changes: 3 additions & 0 deletions test/aspect/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def _run_bazel_build(
# Testing over many Bazel versions does work well with a static bazelrc file including flags which might not
# be available in a some tested Bazel version.
"--noworkspace_rc",
# Can improve performance in Windows workers
# See https://github.com/bazelbuild/rules_python/blob/7bba79de34b6352001cb42b801245d0de33ce225/docs/sphinx/pypi-dependencies.md#L40
"--windows_enable_symlinks",
"build",
"--experimental_convenience_symlinks=ignore",
"--noshow_progress",
Expand Down
3 changes: 3 additions & 0 deletions test/aspect/test_case_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_dwyu_command_without_any_extra_args(self, run_mock: MagicMock) -> None:
"/bazel/binary",
"--output_base=/some/path",
"--noworkspace_rc",
"--windows_enable_symlinks",
"build",
"--experimental_convenience_symlinks=ignore",
"--noshow_progress",
Expand Down Expand Up @@ -106,6 +107,7 @@ def test_dwyu_command_with_global_and_dwyu_extra_args(self, run_mock: MagicMock)
"/bazel/binary",
"--output_base=/some/path",
"--noworkspace_rc",
"--windows_enable_symlinks",
"build",
"--experimental_convenience_symlinks=ignore",
"--noshow_progress",
Expand Down Expand Up @@ -137,6 +139,7 @@ def test_dwyu_command_with_multiple_targets(self, run_mock: MagicMock) -> None:
"/bazel/binary",
"--output_base=/some/path",
"--noworkspace_rc",
"--windows_enable_symlinks",
"build",
"--experimental_convenience_symlinks=ignore",
"--noshow_progress",
Expand Down

0 comments on commit 15962c3

Please sign in to comment.