diff --git a/.bazelrc b/.bazelrc index c58667b46e..9643d5e7c4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -165,6 +165,15 @@ common:ci-windows --config=ci-bazel common:ci-windows --build_metadata=TAG_os=windows common:ci-windows --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache +# Keep Windows Rust lint actions on the native gnullvm execution platform while +# offloading only hermetic C++ compilation and linking to Linux RBE workers. +common:ci-windows-argument-lint --config=ci-windows +common:ci-windows-argument-lint --extra_execution_platforms=//:rbe +common:ci-windows-argument-lint --strategy=local +common:ci-windows-argument-lint --strategy=CppCompile=remote +common:ci-windows-argument-lint --strategy=CppArchive=remote +common:ci-windows-argument-lint --strategy=CppLink=remote + # We prefer to run the build actions entirely remotely so we can dial up the concurrency. # We have platform-specific tests, so we want to execute the tests on all platforms using the strongest sandboxing available on each platform. diff --git a/.github/scripts/run-bazel-ci.sh b/.github/scripts/run-bazel-ci.sh index 89f937a998..37a4c45915 100755 --- a/.github/scripts/run-bazel-ci.sh +++ b/.github/scripts/run-bazel-ci.sh @@ -255,6 +255,15 @@ if [[ ${#bazel_args[@]} -eq 0 || ${#bazel_targets[@]} -eq 0 ]]; then exit 1 fi +if [[ "${RUNNER_OS:-}" == "Windows" ]]; then + for arg in "${bazel_args[@]}"; do + if [[ "$arg" == "--config=argument-comment-lint" ]]; then + ci_config=ci-windows-argument-lint + break + fi + done +fi + if [[ "${RUNNER_OS:-}" == "Windows" && $windows_cross_compile -eq 1 && -z "${BUILDBUDDY_API_KEY:-}" ]]; then # Windows cross-compilation depends on authenticated RBE. Preserve the local # Windows build shape when credentials are unavailable. diff --git a/.github/scripts/run_bazel_with_buildbuddy.py b/.github/scripts/run_bazel_with_buildbuddy.py index 4503b4fda3..619ee7acde 100755 --- a/.github/scripts/run_bazel_with_buildbuddy.py +++ b/.github/scripts/run_bazel_with_buildbuddy.py @@ -20,6 +20,7 @@ REMOTE_EXECUTION_CONFIGS = { "--config=ci-linux", "--config=ci-macos", "--config=ci-v8", + "--config=ci-windows-argument-lint", "--config=ci-windows-cross", } # Honor either explicit setting so the wrapper never overrides the caller's diff --git a/.github/scripts/test_run_bazel_with_buildbuddy.py b/.github/scripts/test_run_bazel_with_buildbuddy.py index f06e34b895..82d526e6f3 100644 --- a/.github/scripts/test_run_bazel_with_buildbuddy.py +++ b/.github/scripts/test_run_bazel_with_buildbuddy.py @@ -98,6 +98,27 @@ class RunBazelWithBuildBuddyTest(unittest.TestCase): ], ) + def test_windows_argument_lint_configuration_uses_remote_execution(self) -> None: + env = {"BUILDBUDDY_API_KEY": "fork-token"} + + self.assertEqual( + run_bazel_with_buildbuddy.bazel_args_with_remote_config( + [ + "build", + "--config=ci-windows-argument-lint", + "//codex-rs/cli:codex", + ], + env, + ), + [ + "build", + "--config=buildbuddy-generic-rbe", + "--remote_header=x-buildbuddy-api-key=fork-token", + "--config=ci-windows-argument-lint", + "//codex-rs/cli:codex", + ], + ) + def test_query_remote_configuration_is_inserted_before_expression(self) -> None: expression = 'kind("rust_library rule", //codex-rs/...)' env = {"BUILDBUDDY_API_KEY": "fork-token"}