Use local MSVC toolchains for native Windows Bazel tests (#53443)

## Why

Hermetic LLVM targets the GNU ABI on Windows even when an MSVC platform is selected. Native MSVC builds need the runner's MSVC toolchains and SDK environment.

## What changed

- Register the local x64 and ARM64 C++ toolchains in `ci-windows-msvc`.
- Apply `--config=ci-windows-msvc` to the native Windows Bazel test job.
- Allow the native Windows test job to run on `workflow_dispatch` as well as pushes to `main` so toolchain changes can be tested manually.

GitOrigin-RevId: b9fbd3f2bba8a3a8bf226cafda19a921c8738acd
This commit is contained in:
Eric Traut
2026-10-12 18:20:04 +00:00
committed by copyberry
parent 6c7d409a6d
commit 3ece80b784
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -231,11 +231,12 @@ common:v8-target-arm64 --@v8//bazel/config:v8_target_cpu=arm64
# the matching runtime objects.
common:rusty-v8-upstream-libcxx --@v8//:v8_use_rusty_v8_custom_libcxx=True
# Native Windows archive builds inherit the runner's MSVC SDK environment.
# Native Windows MSVC builds inherit the runner's MSVC SDK environment.
# Client environment capture and repository discovery happen before target
# transitions, so these runner settings cannot live in runtime_package.bzl.
# The archive target selects its own MSVC host platform and native toolchains.
# Hermetic LLVM targets the GNU ABI on Windows even on an MSVC platform.
build:ci-windows-msvc --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0
build:ci-windows-msvc --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows,@local_config_cc//:cc-toolchain-arm64_windows
build:ci-windows-msvc --action_env=PATH
build:ci-windows-msvc --host_action_env=PATH
build:ci-windows-msvc --action_env=INCLUDE
+3 -2
View File
@@ -251,8 +251,8 @@ jobs:
test-windows-native-main:
# Native Windows Bazel tests are slower and frequently approach the
# 30-minute PR budget. Run this only for post-merge commits to main and give
# it a larger timeout.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# it a larger timeout. Also allow manual runs for native toolchain changes.
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
timeout-minutes: 40
runs-on:
group: ${{ github.event.repository.name }}-runners
@@ -290,6 +290,7 @@ jobs:
bazel_test_args=(
test
--config=ci-windows-msvc
--platforms=//:windows_x86_64_msvc
--test_tag_filters=-argument-comment-lint
--test_verbose_timeout_warnings