[CI] Updated RBE Windows Configuration to use Bazel 7.3.1 (#38006)

The Windows RBE test has been using Bazel 7.3.1 for running tests.
However, the RBE configuration itself was built with an older Bazel
version (6.3.2). While this hasn't caused any issues so far, it's best
to use the same Bazel version (7.3.1) for both building the RBE
configuration and running tests to ensure consistency and avoid
potential problems in the future.

Related to https://github.com/grpc/grpc/pull/37987
pull/38053/head
Esun Kim 4 weeks ago committed by GitHub
parent 30506ff344
commit a6682db32f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      test/distrib/bazel/test_single_bazel_version.sh
  2. 6
      third_party/toolchains/BUILD
  3. 2
      third_party/toolchains/README.md
  4. 2
      third_party/toolchains/dockerfile/rbe_windows2019/Dockerfile
  5. 6
      third_party/toolchains/generate_windows_rbe_configs.sh
  6. 2
      third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc/WORKSPACE
  7. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/LICENSE
  8. 338
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/BUILD
  9. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/REPO.bazel
  10. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/WORKSPACE
  11. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/armeabi_cc_toolchain_config.bzl
  12. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/builtin_include_directory_paths_clangcl
  13. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/builtin_include_directory_paths_mingw
  14. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/builtin_include_directory_paths_msvc
  15. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/clang_installation_error.bat
  16. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/get_env.bat
  17. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/msys_gcc_installation_error.bat
  18. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/vc_installation_error_arm.bat
  19. 0
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/vc_installation_error_arm64.bat
  20. 54
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc/windows_cc_toolchain_config.bzl
  21. 7
      third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/config/BUILD

@ -63,7 +63,7 @@ EXCLUDED_TARGETS=(
# Analyzing windows toolchains when running on linux results in an error.
# Since bazel distribtests are run on linux, we exclude the windows RBE toolchains.
"-//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/..."
"-//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/..."
"-//third_party/toolchains:rbe_windows_default_toolchain_suite"
# Exclude bazelified tests as they contain some bazel hackery

@ -52,13 +52,13 @@ platform(
# The default toolchain suite for RBE windows, pass it to --crosstool_top
alias(
name = "rbe_windows_default_toolchain_suite",
actual = "//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc:toolchain",
actual = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc:toolchain",
)
# The default CC toolchain suite for RBE windows
alias(
name = "rbe_windows_default_cc_toolchain",
actual = "//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:cc-toolchain",
actual = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/config:cc-toolchain",
)
# The default platform for RBE windows
@ -73,5 +73,5 @@ platform(
os_family = "Windows",
),
# Inherit from the platform target generated by 'rbe_configs_gen'.
parents = ["//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/config:platform"],
parents = ["//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/config:platform"],
)

@ -6,7 +6,7 @@ Run `generate_linux_rbe_configs.sh` to regenerate.
## Windows
The `rbe_windows_bazel_6.3.2_vs2019` directory contains the autogenerated toolchain configuration for windows RBE.
The `rbe_windows_bazel_7.3.1_vs2019` directory contains the autogenerated toolchain configuration for windows RBE.
The configuration was generated by the `rbe_configs_gen` tool (just as the linux RBE config),
but since it's a windows configuration, it needs to be run on a windows machine.

@ -47,7 +47,7 @@ RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_buildtools.exe" \
[Environment]::SetEnvironmentVariable(\"BAZEL_VC\", \"C:\VS\VC\", \"Machine\")
# Install msys2 and add to path.
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20220319.sfx.exe" \
Invoke-WebRequest "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20240507.sfx.exe" \
-OutFile msys2_install.exe -UseBasicParsing; \
.\msys2_install.exe -y -oC:\; \
Remove-Item msys2_install.exe; \

@ -28,15 +28,15 @@ wget https://github.com/bazelbuild/bazel-toolchains/releases/download/v5.1.2/rbe
RBE_CONFIGS_GEN_TOOL_PATH="./rbe_configs_gen_windows_amd64.exe"
# Actions on RBE will run under a dedicated docker image.
WINDOWS_RBE_DOCKER_IMAGE=us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:63aed074a2ca1bf5af45bb43b255d21d51882d7169ec57be7f0f5454ea5d2c98
WINDOWS_RBE_DOCKER_IMAGE=us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:1700f2ad0e7f5bdcafa56dce649720e6b12cf397e27990433871f11c75f68cb4
# Bazel version used for configuring
# Needs to be one of the versions from bazel/supported_versions.txt chosen so that the result is compatible
# with other supported bazel versions.
BAZEL_VERSION=6.3.2
BAZEL_VERSION=7.3.1
# Where to store the generated configs (relative to repo root)
CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019
CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019
# Delete old generated configs.
rm -rf "${REPO_ROOT}/${CONFIG_OUTPUT_PATH}"

@ -1,2 +0,0 @@
# DO NOT EDIT: automatically generated WORKSPACE file for cc_autoconf rule
workspace(name = "local_config_cc")

@ -14,12 +14,30 @@
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite", "cc_library")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(name = "empty_lib")
# Label flag for extra libraries to be linked into every binary.
# TODO(bazel-team): Support passing flag multiple times to build a list.
label_flag(
name = "link_extra_libs",
build_setting_default = ":empty_lib",
)
# The final extra library to be linked into every binary target. This collects
# the above flag, but may also include more libraries depending on config.
cc_library(
name = "link_extra_lib",
deps = [
":link_extra_libs",
],
)
cc_library(
name = "malloc",
)
@ -31,17 +49,17 @@ filegroup(
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
srcs = [":builtin_include_directory_paths_mingw"]
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
srcs = [":builtin_include_directory_paths_clangcl"]
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
srcs = [":builtin_include_directory_paths_msvc"]
)
# Hardcoded toolchain, legacy behaviour.
@ -71,6 +89,8 @@ cc_toolchain_suite(
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
toolchain_identifier = "msys_x64",
toolchain_config = ":msys_x64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
@ -80,27 +100,20 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
compiler = "msys-gcc",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/msys64/usr/bin",
tool_paths = {
"ar": "c:/msys64/usr/bin/ar",
target_libc = "msys",
abi_version = "local",
abi_libc_version = "local",
cxx_builtin_include_directories = [ "c:/msys64/usr/",
],
tool_paths = {"ar": "c:/msys64/usr/bin/ar",
"cpp": "c:/msys64/usr/bin/cpp",
"dwp": "c:/msys64/usr/bin/dwp",
"gcc": "c:/msys64/usr/bin/gcc",
@ -109,8 +122,10 @@ cc_toolchain_config(
"nm": "c:/msys64/usr/bin/nm",
"objcopy": "c:/msys64/usr/bin/objcopy",
"objdump": "c:/msys64/usr/bin/objdump",
"strip": "c:/msys64/usr/bin/strip",
},
"strip": "c:/msys64/usr/bin/strip"},
tool_bin_path = "c:/msys64/usr/bin",
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
)
toolchain(
@ -130,6 +145,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
toolchain_identifier = "msys_x64_mingw",
toolchain_config = ":msys_x64_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
@ -139,27 +156,21 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
compiler = "mingw-gcc",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
target_libc = "mingw",
abi_version = "local",
abi_libc_version = "local",
tool_bin_path = "c:/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/msys64/mingw64/bin/ar",
cxx_builtin_include_directories = [ "c:/msys64/mingw64/",
],
tool_paths = {"ar": "c:/msys64/mingw64/bin/ar",
"cpp": "c:/msys64/mingw64/bin/cpp",
"dwp": "c:/msys64/mingw64/bin/dwp",
"gcc": "c:/msys64/mingw64/bin/gcc",
@ -168,8 +179,9 @@ cc_toolchain_config(
"nm": "c:/msys64/mingw64/bin/nm",
"objcopy": "c:/msys64/mingw64/bin/objcopy",
"objdump": "c:/msys64/mingw64/bin/objdump",
"strip": "c:/msys64/mingw64/bin/strip",
},
"strip": "c:/msys64/mingw64/bin/strip"},
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
)
toolchain(
@ -189,6 +201,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-x64_windows",
toolchain_identifier = "msvc_x64",
toolchain_config = ":msvc_x64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
@ -198,39 +212,32 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
compiler = "msvc-cl",
host_system_name = "local",
msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
target_system_name = "local",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x64",
msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe",
msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe",
target_libc = "msvcrt",
target_system_name = "local",
msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe",
msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe",
cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt"],
tool_paths = {
"ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe",
"ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe",
@ -243,7 +250,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
archiver_flags = ["/MACHINE:X64"],
default_link_flags = ["/MACHINE:X64"],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
supports_parse_showincludes = True,
)
toolchain(
@ -262,6 +273,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-x64_x86_windows",
toolchain_identifier = "msvc_x64_x86",
toolchain_config = ":msvc_x64_x86",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
@ -271,39 +284,32 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_x86",
toolchain_identifier = "msvc_x64_x86",
)
cc_toolchain_config(
name = "msvc_x64_x86",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X86"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X86"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
compiler = "msvc-cl",
host_system_name = "local",
msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe",
target_system_name = "local",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64_x86",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x86",
msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe",
msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe",
msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe",
msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe",
target_libc = "msvcrt",
target_system_name = "local",
msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe",
msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe",
cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt"],
tool_paths = {
"ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe",
"ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe",
@ -316,7 +322,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_x86",
archiver_flags = ["/MACHINE:X86"],
default_link_flags = ["/MACHINE:X86"],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
supports_parse_showincludes = True,
)
toolchain(
@ -335,6 +345,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-x64_arm_windows",
toolchain_identifier = "msvc_x64_arm",
toolchain_config = ":msvc_x64_arm",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
@ -344,32 +356,27 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_arm",
toolchain_identifier = "msvc_x64_arm",
)
cc_toolchain_config(
name = "msvc_x64_arm",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM"],
fastbuild_mode_debug_flag = "/DEBUG",
compiler = "msvc-cl",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm.bat",
target_system_name = "local",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64_arm",
msvc_env_tmp = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm.bat",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_cl_path = "vc_installation_error_arm.bat",
msvc_ml_path = "vc_installation_error_arm.bat",
target_libc = "msvcrt",
target_system_name = "local",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_lib_path = "vc_installation_error_arm.bat",
cxx_builtin_include_directories = [],
tool_paths = {
"ar": "vc_installation_error_arm.bat",
"ml": "vc_installation_error_arm.bat",
@ -382,7 +389,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_arm",
archiver_flags = ["/MACHINE:ARM"],
default_link_flags = ["/MACHINE:ARM"],
dbg_mode_debug_flag = "/DEBUG",
fastbuild_mode_debug_flag = "/DEBUG",
supports_parse_showincludes = False,
)
toolchain(
@ -401,6 +412,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-arm64_windows",
toolchain_identifier = "msvc_arm64",
toolchain_config = ":msvc_arm64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
@ -410,32 +423,27 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_arm64",
toolchain_identifier = "msvc_arm64",
)
cc_toolchain_config(
name = "msvc_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
compiler = "msvc-cl",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
target_system_name = "local",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_arm64",
msvc_env_tmp = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
target_libc = "msvcrt",
target_system_name = "local",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_lib_path = "vc_installation_error_arm64.bat",
cxx_builtin_include_directories = [],
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
@ -448,7 +456,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_arm64",
archiver_flags = ["/MACHINE:ARM64"],
default_link_flags = ["/MACHINE:ARM64"],
dbg_mode_debug_flag = "/DEBUG",
fastbuild_mode_debug_flag = "/DEBUG",
supports_parse_showincludes = False,
)
toolchain(
@ -464,8 +476,11 @@ toolchain(
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
toolchain_identifier = "clang_cl_x64",
toolchain_config = ":clang_cl_x64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
@ -475,35 +490,27 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
compiler = "clang-cl",
host_system_name = "local",
msvc_cl_path = "clang_installation_error.bat",
target_system_name = "local",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "clang_cl_x64",
msvc_env_tmp = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "clang_installation_error.bat",
msvc_link_path = "clang_installation_error.bat",
msvc_cl_path = "clang_installation_error.bat",
msvc_ml_path = "clang_installation_error.bat",
target_libc = "msvcrt",
target_system_name = "local",
msvc_link_path = "clang_installation_error.bat",
msvc_lib_path = "clang_installation_error.bat",
cxx_builtin_include_directories = [],
tool_paths = {
"ar": "clang_installation_error.bat",
"ml": "clang_installation_error.bat",
@ -516,7 +523,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
archiver_flags = ["/MACHINE:X64"],
default_link_flags = ["/MACHINE:X64"],
dbg_mode_debug_flag = "/DEBUG",
fastbuild_mode_debug_flag = "/DEBUG",
supports_parse_showincludes = False,
)
toolchain(
@ -536,6 +547,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
toolchain_identifier = "clang_cl_arm64",
toolchain_config = ":clang_cl_arm64",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
@ -545,32 +558,27 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_arm64",
toolchain_identifier = "clang_cl_arm64",
)
cc_toolchain_config(
name = "clang_cl_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "clang-cl",
cpu = "arm64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
compiler = "clang-cl",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
target_system_name = "aarch64-pc-windows-msvc",
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "clang_cl_arm64",
msvc_env_tmp = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
target_libc = "msvcrt",
target_system_name = "aarch64-pc-windows-msvc",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_lib_path = "vc_installation_error_arm64.bat",
cxx_builtin_include_directories = [],
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
@ -583,7 +591,11 @@ cc_toolchain_config(
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_arm64",
archiver_flags = ["/MACHINE:ARM64"],
default_link_flags = ["/MACHINE:ARM64"],
dbg_mode_debug_flag = "/DEBUG",
fastbuild_mode_debug_flag = "/DEBUG",
supports_parse_showincludes = False,
)
toolchain(
@ -602,6 +614,8 @@ toolchain(
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
toolchain_config = ":stub_armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
@ -611,8 +625,6 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")

@ -14,6 +14,7 @@
"""A Starlark cc_toolchain configuration rule for Windows"""
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
@ -28,7 +29,6 @@ load(
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
all_compile_actions = [
ACTION_NAMES.c_compile,
@ -187,7 +187,6 @@ def _impl(ctx):
"compiler_output_flags",
"nologo",
"msvc_env",
"parse_showincludes",
"user_compile_flags",
"sysroot",
],
@ -202,7 +201,6 @@ def _impl(ctx):
"default_compile_flags",
"nologo",
"msvc_env",
"parse_showincludes",
"user_compile_flags",
"sysroot",
"unfiltered_compile_flags",
@ -217,7 +215,6 @@ def _impl(ctx):
"compiler_output_flags",
"nologo",
"msvc_env",
"parse_showincludes",
"user_compile_flags",
"sysroot",
],
@ -378,6 +375,7 @@ def _impl(ctx):
compiler_param_file_feature = feature(
name = "compiler_param_file",
enabled = True,
)
copy_dynamic_libraries_to_binary_feature = feature(
@ -724,6 +722,25 @@ def _impl(ctx):
name = "generate_pdb_file",
)
generate_linkmap_feature = feature(
name = "generate_linkmap",
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.cpp_link_executable,
],
flag_groups = [
flag_group(
flags = [
"/MAP:%{output_execpath}.map",
],
expand_if_available = "output_execpath",
),
],
),
],
)
output_execpath_flags_feature = feature(
name = "output_execpath_flags",
flag_sets = [
@ -788,6 +805,7 @@ def _impl(ctx):
parse_showincludes_feature = feature(
name = "parse_showincludes",
enabled = ctx.attr.supports_parse_showincludes,
flag_sets = [
flag_set(
actions = [
@ -801,6 +819,27 @@ def _impl(ctx):
flag_groups = [flag_group(flags = ["/showIncludes"])],
),
],
env_sets = [
env_set(
actions = [
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.c_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_header_parsing,
],
# Force English (and thus a consistent locale) output so that Bazel can parse
# the /showIncludes output without having to guess the encoding.
env_entries = [env_entry(key = "VSLANG", value = "1033")],
),
],
)
# MSVC does not emit .d files.
no_dotd_file_feature = feature(
name = "no_dotd_file",
enabled = True,
)
treat_warnings_as_errors_feature = feature(
@ -866,7 +905,7 @@ def _impl(ctx):
],
flag_groups = [
flag_group(
flags = ["/external:I", "%{external_include_paths}"],
flags = ["/external:I%{external_include_paths}"],
iterate_over = "external_include_paths",
expand_if_available = "external_include_paths",
),
@ -1100,7 +1139,9 @@ def _impl(ctx):
external_include_paths_feature,
preprocessor_defines_feature,
parse_showincludes_feature,
no_dotd_file_feature,
generate_pdb_file_feature,
generate_linkmap_feature,
shared_flag_feature,
linkstamps_feature,
output_execpath_flags_feature,
@ -1183,7 +1224,7 @@ def _impl(ctx):
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-std=gnu++0x"])],
flag_groups = [flag_group(flags = ["-std=gnu++14"])],
),
],
)
@ -1416,6 +1457,7 @@ cc_toolchain_config = rule(
"dbg_mode_debug_flag": attr.string(),
"fastbuild_mode_debug_flag": attr.string(),
"tool_bin_path": attr.string(default = "not_found"),
"supports_parse_showincludes": attr.bool(),
},
provides = [CcToolchainConfigInfo],
)

@ -17,6 +17,7 @@
package(default_visibility = ["//visibility:public"])
toolchain(
name = "cc-toolchain",
exec_compatible_with = [
@ -27,19 +28,19 @@ toolchain(
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
toolchain = "//third_party/toolchains/rbe_windows_bazel_6.3.2_vs2019/cc:cc-compiler-x64_windows",
toolchain = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2019/cc:cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
platform(
name = "platform",
parents = ["@local_config_platform//:host"],
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
exec_properties = {
"container-image": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:63aed074a2ca1bf5af45bb43b255d21d51882d7169ec57be7f0f5454ea5d2c98",
"container-image": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_windows2019@sha256:1700f2ad0e7f5bdcafa56dce649720e6b12cf397e27990433871f11c75f68cb4",
"OSFamily": "Windows",
},
parents = ["@local_config_platform//:host"],
)
Loading…
Cancel
Save