Remove Windows Bazel lint toolchain overrides (#34827)

## What changed

- Stop forcing the `local_windows_msvc` host platform for Windows
  `argument-comment-lint` builds.
- Stop selecting the Rust linker preference explicitly.
- Continue skipping incompatible explicit targets on Windows.

GitOrigin-RevId: de3014c1fb0685d33cad32fccb0081a3717d9676
This commit is contained in:
zbarsky-openai
2026-07-22 20:58:55 +00:00
committed by copyberry
parent 12c115d558
commit b5748e6e3c

View File

@@ -4,31 +4,8 @@ set -euo pipefail
bazel_lint_args=("$@")
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
has_host_platform_override=0
for arg in "${bazel_lint_args[@]}"; do
if [[ "$arg" == --host_platform=* ]]; then
has_host_platform_override=1
break
fi
done
if [[ $has_host_platform_override -eq 0 ]]; then
# The nightly Windows lint toolchain is registered with an MSVC exec
# platform even though the lint target platform stays on `windows-gnullvm`.
# Override the host platform here so the exec-side helper binaries actually
# match the registered toolchain set.
bazel_lint_args+=("--host_platform=//:local_windows_msvc")
fi
# Native Windows lint runs need exec-side Rust helper binaries and proc-macros
# to use rust-lld instead of the C++ linker path. The default `none`
# preference resolves to `cc` when a cc_toolchain is present, which currently
# routes these exec actions through clang++ with an argument shape it cannot
# consume.
bazel_lint_args+=("--@rules_rust//rust/settings:toolchain_linker_preference=rust")
# Some Rust top-level targets are still intentionally incompatible with the
# local Windows MSVC exec platform. Skip those explicit targets so the native
# local Windows exec platform. Skip those explicit targets so the native
# lint aspect can run across the compatible crate graph instead of failing the
# whole build after analysis.
bazel_lint_args+=("--skip_incompatible_explicit_targets")