From 15962c355133a884e1ba75dcb7449e7ae9547db3 Mon Sep 17 00:00:00 2001 From: Martin Medler Date: Mon, 8 Jul 2024 23:05:18 +0200 Subject: [PATCH] Reduce Windows Python overhead Windows CI jobs are the longest running --- examples/.bazelrc | 4 ++++ test/apply_fixes/execution_logic.py | 6 ++++++ test/aspect/test_case.py | 3 +++ test/aspect/test_case_test.py | 3 +++ 4 files changed, 16 insertions(+) diff --git a/examples/.bazelrc b/examples/.bazelrc index 21a31312..96b86b74 100644 --- a/examples/.bazelrc +++ b/examples/.bazelrc @@ -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 diff --git a/test/apply_fixes/execution_logic.py b/test/apply_fixes/execution_logic.py index b4ecb1b5..0ea458ba 100644 --- a/test/apply_fixes/execution_logic.py +++ b/test/apply_fixes/execution_logic.py @@ -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 """ diff --git a/test/aspect/test_case.py b/test/aspect/test_case.py index c43b2612..63869c17 100644 --- a/test/aspect/test_case.py +++ b/test/aspect/test_case.py @@ -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", diff --git a/test/aspect/test_case_test.py b/test/aspect/test_case_test.py index 0fbc6eb6..14247a1d 100644 --- a/test/aspect/test_case_test.py +++ b/test/aspect/test_case_test.py @@ -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", @@ -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", @@ -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",