diff --git a/.bazelrc b/.bazelrc index 3427eb28f00..a3f535585dd 100644 --- a/.bazelrc +++ b/.bazelrc @@ -39,16 +39,16 @@ build:linux --host_per_file_copt=external/.*@-w # Configure our Windows MSVC and ClangCL setup. common:windows-msvc --enable_runfiles +build:windows-msvc --platforms=//ci:windows_msvc build:windows-msvc --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 build:windows-msvc --copt=/WX build:windows-msvc --per_file_copt=external/.*@/w build:windows-msvc --host_per_file_copt=external/.*@/w build:windows-clangcl --config=windows-msvc +build:windows-clangcl --platforms=//ci:windows_clangcl build:windows-clangcl --compiler=clang-cl build:windows-clangcl --copt=-Wno-microsoft-cast -build:windows-clangcl --extra_execution_platforms=//:x64_windows-clang-cl -build:windows-clangcl --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl # Configure our macOS Xcode setup. build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @@ -120,3 +120,15 @@ build:remote-arm --platforms=//ci:rbe-arm build:remote-arm --remote_cache=grpcs://us-central1-remotebuildexecution.googleapis.com build:remote-arm --remote_executor=grpcs://us-central1-remotebuildexecution.googleapis.com build:remote-arm --remote_instance_name=projects/google.com:absl-177019/instances/gloop-ci-central + +build:remote-windows --config=remote-base +build:remote-windows --extra_execution_platforms=//ci:rbe-windows +build:remote-windows --host_platform=//ci:rbe-windows +build:remote-windows --platforms=//ci:rbe-windows +build:remote-windows --remote_cache=grpcs://us-east1-remotebuildexecution.googleapis.com +build:remote-windows --remote_executor=grpcs://us-east1-remotebuildexecution.googleapis.com +build:remote-windows --remote_instance_name=projects/google.com:absl-177019/instances/absl-ci-east +# cc_test puts Windows .pdb files in the pdb_file output group rather than +# runfiles, so run symbolize_test locally with symbolize_test.pdb downloaded. +build:remote-windows --remote_download_regex=.*symbolize_test\.pdb$ +build:remote-windows --strategy_regexp=Testing.*symbolize_test=local diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 995754391d3..384215f92e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: - name: GCC/libstdc++ (floor) toolchain: gcc remote_config: remote-floor - container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:5a5d17e588e14d5f0d993ea828b7ba844c72b02980bcf731ccf5a4cddf8db599 + container_image: gcr.io/google.com/absl-177019/oss-linux-toolchain-floor@sha256:9027d0b4cae51d764cebafecbf9e390a14f97cf977ca24d02cc533998614acd2 stds: '["c++17"]' # linux_arm_clang-latest_libcxx_bazel.cfg (c++17 and c++20 only) - name: ARM64 Clang/libc++ @@ -101,7 +101,7 @@ jobs: os: ${{ matrix.config.os || 'ubuntu-24.04' }} toolchain: ${{ matrix.config.toolchain }} remote_config: ${{ matrix.config.remote_config || 'remote' }} - container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:5a19067585ce5e5ee45640fd0287f05038d6b3f9574d6a5cdf08241e022d0f4a' }} + container_image: ${{ matrix.config.container_image || 'gcr.io/google.com/absl-177019/oss-linux-toolchain-latest@sha256:81009eeb5523ae59cfbea8dc0847d41572ed100f79e3c976c64378a0c30d353c' }} alternate_options: ${{ matrix.config.alternate_options || false }} stds: ${{ matrix.config.stds || '["c++17", "c++20", "c++23"]' }} compilation_modes: ${{ matrix.config.compilation_modes || '["opt", "fastbuild"]' }} @@ -115,17 +115,17 @@ jobs: # linux_gcc-latest_libstdcxx_cxx17_cmake.cfg - name: Linux GCC/libstdc++ os: ubuntu-24.04 - container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6 + container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58 # linux_gcc_alpine_cmake.cfg - name: Alpine Linux GCC (musl) os: ubuntu-24.04 - container_image: gcr.io/google.com/absl-177019/alpine@sha256:ae26b80601cebb14595056a94e070f0f865d24baaf3ce19bcd52f53be9f99c80 + container_image: gcr.io/google.com/absl-177019/alpine@sha256:52945833fc7b7b93f73ec865eb82390aa46d4e3acd1af87d253cd4a05f95d241 build_types: '["Debug"]' link_modes: '["static"]' # cmake-install.cfg - name: Linux Install os: ubuntu-24.04 - container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6 + container_image: gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58 build_types: '["Release"]' link_modes: '["static", "shared"]' install_test: true @@ -172,7 +172,7 @@ jobs: with: os: windows-2022 toolchain: ${{ matrix.config.toolchain }} - remote_config: remote-cache + remote_config: remote-windows alternate_options: ${{ matrix.config.alternate_options || false }} stds: ${{ matrix.config.stds || '["c++17", "c++20"]' }} compilation_modes: ${{ matrix.config.compilation_modes || '["dbg", "opt"]' }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2080af3b76f..09d0b7edbe9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -70,12 +70,20 @@ jobs: CFLAGS: ${{ !inputs.install_test && startsWith(inputs.os, 'ubuntu') && '-Werror' || '' }} CXX: ${{ startsWith(inputs.os, 'ubuntu') && 'g++' || '' }} CXXFLAGS: ${{ !inputs.install_test && (startsWith(inputs.os, 'ubuntu') && '-Werror' || startsWith(inputs.os, 'windows') && '-WX') || '' }} - CMAKE_BUILD_PARALLEL_LEVEL: 16 - CMAKE_C_COMPILER_LAUNCHER: sccache - CMAKE_CXX_COMPILER_LAUNCHER: sccache + CMAKE_BUILD_PARALLEL_LEVEL: ${{ startsWith(inputs.os, 'ubuntu') && 50 || 16 }} + CMAKE_C_COMPILER_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rewrapper' || 'sccache' }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rewrapper' || 'sccache' }} + CMAKE_TEST_LAUNCHER: ${{ startsWith(inputs.os, 'ubuntu') && 'rbe_test_launcher' || '' }} CMAKE_GENERATOR: Ninja CTEST_OUTPUT_ON_FAILURE: 1 - CTEST_PARALLEL_LEVEL: 16 + CTEST_PARALLEL_LEVEL: ${{ startsWith(inputs.os, 'ubuntu') && 50 || 16 }} + TZDIR: ${{ github.workspace }}/absl/time/internal/cctz/testdata/zoneinfo + RBE_service: us-east1-remotebuildexecution.googleapis.com:443 + RBE_instance: projects/google.com:absl-177019/instances/absl-ci-east + RBE_use_application_default_credentials: true + RBE_exec_strategy: remote + RBE_exec_root: ${{ github.workspace }} + RBE_platform: OSArch=amd64,cache-silo-key=n2-highcpu-2-2026-10-14,container-image=docker://${{ inputs.container_image }},dockerRunAsRoot=true SCCACHE_GCS_BUCKET: absl-cmake-sccache SCCACHE_GCS_RW_MODE: READ_WRITE SCCACHE_IDLE_TIMEOUT: 0 @@ -98,13 +106,23 @@ jobs: credentials_json: ${{ secrets.GAR_SERVICE_ACCOUNT }} - name: Set up sccache + if: ${{ runner.os != 'Linux' }} uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 - name: Start sccache + if: ${{ runner.os != 'Linux' }} env: SCCACHE_GCS_KEY_PATH: ${{ steps.auth.outputs.credentials_file_path }} run: sccache --start-server + - name: Start reclient (RBE) + if: ${{ runner.os == 'Linux' }} + run: | + # CMake passes absolute source/include paths (${GITHUB_WORKSPACE}/...) to + # the compiler, so mount the remote input root at that same container path. + echo "RBE_platform=${RBE_platform},InputRootAbsolutePath=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV" + bootstrap + - name: Run installation test if: ${{ inputs.install_test }} env: @@ -140,9 +158,11 @@ jobs: - name: Run tests if: ${{ !inputs.install_test }} - env: - TZDIR: ${{ github.workspace }}/absl/time/internal/cctz/testdata/zoneinfo run: > ctest --test-dir build --repeat until-pass:3 ${{ runner.os == 'Windows' && '-E "absl_lifetime_test|absl_symbolize_test"' || '' }} + + - name: Stop reclient (RBE) + if: ${{ always() && runner.os == 'Linux' }} + run: bootstrap --shutdown diff --git a/CMake/install_test_project/test.sh b/CMake/install_test_project/test.sh index 2d25696f151..8f021582f6f 100755 --- a/CMake/install_test_project/test.sh +++ b/CMake/install_test_project/test.sh @@ -19,13 +19,18 @@ # Fail on any error. Treat unset variables an error. Print commands as executed. set -euox pipefail +# TODO(b/573304451): Remove once Kokoro is turned down (set in cmake.yml). +export CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc)}" +export CTEST_PARALLEL_LEVEL="${CTEST_PARALLEL_LEVEL:-$(nproc)}" + absl_dir="${PWD}" -absl_build_dir=/buildfs +absl_build_dir="${absl_dir}/buildfs/absl-build" mkdir -p "${absl_build_dir}" -googletest_builddir=/googletest_builddir +googletest_builddir="${absl_dir}/buildfs/googletest" +googletest_install_dir="${absl_build_dir}/googletest-install" googletest_archive="googletest-${ABSL_GOOGLETEST_VERSION}.tar.gz" project_dir="${absl_dir}/CMake/install_test_project" -project_build_dir=/buildfs/project-build +project_build_dir="${absl_dir}/buildfs/project-build" build_shared_libs="OFF" if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then @@ -33,7 +38,7 @@ if [ "${LINK_TYPE:-}" = "DYNAMIC" ]; then fi # Build and install GoogleTest -mkdir "${googletest_builddir}" +mkdir -p "${googletest_builddir}" pushd "${googletest_builddir}" curl -L "${ABSL_GOOGLETEST_DOWNLOAD_URL}" --output "${googletest_archive}" tar -xz -f "${googletest_archive}" @@ -42,8 +47,7 @@ mkdir build pushd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="${build_shared_libs}" .. cmake --build . -cmake --install . -ldconfig +cmake --install . --prefix "${googletest_install_dir}" popd popd popd @@ -56,6 +60,7 @@ pushd "${absl_build_dir}" cmake "${absl_dir}" \ -DABSL_USE_EXTERNAL_GOOGLETEST=ON \ -DABSL_FIND_GOOGLETEST=ON \ + -DCMAKE_PREFIX_PATH="${googletest_install_dir}" \ -DCMAKE_BUILD_TYPE=Release \ -DABSL_BUILD_TESTING=ON \ -DBUILD_SHARED_LIBS="${build_shared_libs}" \ @@ -70,8 +75,8 @@ popd # Test the project against the installed Abseil mkdir -p "${project_build_dir}" pushd "${project_build_dir}" -cmake "${project_dir}" -cmake --build . --target simple +env -u CMAKE_C_COMPILER_LAUNCHER -u CMAKE_CXX_COMPILER_LAUNCHER cmake "${project_dir}" +env -u CMAKE_C_COMPILER_LAUNCHER -u CMAKE_CXX_COMPILER_LAUNCHER cmake --build . --target simple output="$(${project_build_dir}/simple "printme" 2>&1)" if [[ "${output}" != *"Arg 1: printme"* ]]; then diff --git a/ci/BUILD.bazel b/ci/BUILD.bazel index c83d079420f..d3714167a58 100644 --- a/ci/BUILD.bazel +++ b/ci/BUILD.bazel @@ -23,7 +23,7 @@ platform( exec_properties = { "OSArch": "amd64", "cache-silo-key": "n2-highcpu-2-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58", "dockerRunAsRoot": "true", }, ) @@ -37,7 +37,7 @@ platform( exec_properties = { "OSArch": "amd64", "cache-silo-key": "n2-highcpu-2-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:60898eb3b0dbcf85cd60e346f103fbf3169d966d391dcb2362b243d528b1183b", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-floor@sha256:a25e596d10b907c8896768196a6e5c8007bac93abb1677ed1fcc186d28afc032", "dockerRunAsRoot": "true", }, ) @@ -51,11 +51,24 @@ platform( exec_properties = { "OSArch": "arm64", "cache-silo-key": "t2a-standard-4-2026-10-14", - "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:9f7f104e4857e3528e8bf5f14968183f5a0e786ca9ef63601eae4e4136f011d6", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-linux-latest@sha256:84505366948db3ea97c71d0aa384a920e73f6994bb4194d7f80ee77979fd9d58", "dockerRunAsRoot": "true", }, ) +platform( + name = "rbe-windows", + constraint_values = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + exec_properties = { + "OSFamily": "Windows", + "cache-silo-key": "e2-highmem-2-2026-10-21", + "container-image": "docker://gcr.io/google.com/absl-177019/oss-windows-latest@sha256:e0b1a8289f04ee358226ee64879be1721a209baf825e16b2393a54dbc6183fa4", + }, +) + platform( name = "linux_gcc", constraint_values = [ @@ -82,3 +95,21 @@ platform( "@bazel_tools//tools/cpp:clang", ], ) + +platform( + name = "windows_msvc", + constraint_values = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + "@bazel_tools//tools/cpp:msvc", + ], +) + +platform( + name = "windows_clangcl", + constraint_values = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + "@bazel_tools//tools/cpp:clang-cl", + ], +) diff --git a/ci/docker_toolchain/BUILD.bazel b/ci/docker_toolchain/BUILD.bazel index ae482b053eb..db0d01ca93b 100644 --- a/ci/docker_toolchain/BUILD.bazel +++ b/ci/docker_toolchain/BUILD.bazel @@ -12,10 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Standalone fallback toolchain module when building outside the Docker container. -# Inside the container, this module is overridden via /etc/bazel.bazelrc to point to an actual -# toolchain. +# Standalone toolchain module when building outside the Linux Docker container. +# Inside the Linux container, this module is overridden via /etc/bazel.bazelrc +# to point to /opt/docker_toolchain. On Windows RBE, this module provides the +# toolchains targeting the oss-windows-latest container. + +load(":windows_toolchain.bzl", "setup_windows_toolchains") package(default_visibility = ["//visibility:public"]) filegroup(name = "empty") + +setup_windows_toolchains() diff --git a/ci/docker_toolchain/MODULE.bazel b/ci/docker_toolchain/MODULE.bazel index 10d86505057..93455b355a9 100644 --- a/ci/docker_toolchain/MODULE.bazel +++ b/ci/docker_toolchain/MODULE.bazel @@ -16,3 +16,6 @@ module( name = "docker_toolchain", version = "0.1", ) + +bazel_dep(name = "rules_cc", version = "0.2.22") +bazel_dep(name = "platforms", version = "1.1.0") diff --git a/ci/docker_toolchain/windows_toolchain.bzl b/ci/docker_toolchain/windows_toolchain.bzl new file mode 100644 index 00000000000..aac692b050b --- /dev/null +++ b/ci/docker_toolchain/windows_toolchain.bzl @@ -0,0 +1,205 @@ +# Copyright 2026 The Abseil Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Windows RBE C++ toolchains targeting the oss-windows-latest container.""" + +load("@rules_cc//cc/private/toolchain:windows_cc_toolchain_config.bzl", "cc_toolchain_config") +load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain") + +_MSVC_VERSION = "14.44.35207" +_WINSDK_VERSION = "10.0.26100.0" +_CLANG_MAJOR_VERSION = "23" + +_MSVC_ROOT_WIN = "C:\\BuildTools\\VC\\Tools\\MSVC\\" + _MSVC_VERSION +_MSVC_BIN_POSIX = "C:/BuildTools/VC/Tools/MSVC/" + _MSVC_VERSION + "/bin/Hostx64/x64" +_VS_AUX_WIN = "C:\\BuildTools\\VC\\Auxiliary\\VS" +_WINSDK_INCLUDE_WIN = "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\" + _WINSDK_VERSION +_WINSDK_LIB_WIN = "C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\" + _WINSDK_VERSION +_WINSDK_BIN_WIN = "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\" + _WINSDK_VERSION +_CLANG_ROOT_WIN = "C:\\LLVM\\lib\\clang\\" + _CLANG_MAJOR_VERSION + +_WINDOWS_ENV_PATH = ";".join([ + _MSVC_ROOT_WIN + "\\bin\\Hostx64\\x64", + _WINSDK_BIN_WIN + "\\x64", + "C:\\LLVM\\bin", + "C:\\CMake\\bin", + "C:\\Python3", + "C:\\Windows\\System32", + "C:\\Windows", + "C:\\Windows\\System32\\Wbem", + "C:\\Windows\\System32\\WindowsPowerShell\\v1.0", + "C:\\tools\\msys64\\usr\\bin", +]) + +_MSVC_ENV_INCLUDE = ";".join([ + _MSVC_ROOT_WIN + "\\include", + _VS_AUX_WIN + "\\include", + _WINSDK_INCLUDE_WIN + "\\ucrt", + _WINSDK_INCLUDE_WIN + "\\um", + _WINSDK_INCLUDE_WIN + "\\shared", + _WINSDK_INCLUDE_WIN + "\\winrt", + _WINSDK_INCLUDE_WIN + "\\cppwinrt", +]) + +_MSVC_ENV_LIB = ";".join([ + _MSVC_ROOT_WIN + "\\lib\\x64", + _WINSDK_LIB_WIN + "\\ucrt\\x64", + _WINSDK_LIB_WIN + "\\um\\x64", +]) + +_WINDOWS_BUILTIN_INCLUDE_DIRECTORIES = [ + "C:\\BuildTools\\VC\\Tools\\MSVC", + "C:\\BuildTools\\VC\\Auxiliary\\VS\\include", + "C:\\Program Files (x86)\\Windows Kits\\10\\Include", + "C:\\LLVM\\lib\\clang", +] + +def setup_windows_toolchains(): + """Defines MSVC and Clang-CL toolchains for the Windows RBE container.""" + cc_toolchain_config( + name = "windows_msvc_config", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:X64"], + compiler = "msvc-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = _WINDOWS_BUILTIN_INCLUDE_DIRECTORIES, + dbg_mode_debug_flag = "/DEBUG:FULL", + default_link_flags = ["/MACHINE:X64"], + fastbuild_mode_debug_flag = "/DEBUG:FULL", + host_system_name = "local", + msvc_cl_path = _MSVC_BIN_POSIX + "/cl.exe", + msvc_env_include = _MSVC_ENV_INCLUDE, + msvc_env_lib = _MSVC_ENV_LIB, + msvc_env_path = _WINDOWS_ENV_PATH, + msvc_env_tmp = "C:\\TEMP", + msvc_lib_path = _MSVC_BIN_POSIX + "/lib.exe", + msvc_link_path = _MSVC_BIN_POSIX + "/link.exe", + msvc_ml_path = _MSVC_BIN_POSIX + "/ml64.exe", + shorten_virtual_includes = True, + supports_parse_showincludes = True, + target_libc = "ucrt", + target_system_name = "local", + tool_paths = { + "ar": _MSVC_BIN_POSIX + "/lib.exe", + "cpp": _MSVC_BIN_POSIX + "/cl.exe", + "dumpbin": _MSVC_BIN_POSIX + "/dumpbin.exe", + "gcc": _MSVC_BIN_POSIX + "/cl.exe", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": _MSVC_BIN_POSIX + "/link.exe", + "ml": _MSVC_BIN_POSIX + "/ml64.exe", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + toolchain_identifier = "msvc_x64", + ) + + cc_toolchain( + name = "windows_msvc_cc_toolchain", + all_files = ":empty", + ar_files = ":empty", + as_files = ":empty", + compiler_files = ":empty", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, + toolchain_config = ":windows_msvc_config", + toolchain_identifier = "msvc_x64", + ) + + cc_toolchain_config( + name = "windows_clang_cl_config", + abi_libc_version = "local", + abi_version = "local", + archiver_flags = ["/MACHINE:X64"], + compiler = "clang-cl", + cpu = "x64_windows", + cxx_builtin_include_directories = _WINDOWS_BUILTIN_INCLUDE_DIRECTORIES, + dbg_mode_debug_flag = "/DEBUG", + default_link_flags = ["/MACHINE:X64"], + fastbuild_mode_debug_flag = "/DEBUG", + host_system_name = "local", + msvc_cl_path = "C:/LLVM/bin/clang-cl.exe", + msvc_env_include = _MSVC_ENV_INCLUDE + ";" + _CLANG_ROOT_WIN + "\\include", + msvc_env_lib = _MSVC_ENV_LIB + ";" + _CLANG_ROOT_WIN + "\\lib\\windows", + msvc_env_path = _WINDOWS_ENV_PATH, + msvc_env_tmp = "C:\\TEMP", + msvc_lib_path = "C:/LLVM/bin/llvm-lib.exe", + msvc_link_path = "C:/LLVM/bin/lld-link.exe", + msvc_ml_path = "C:/LLVM/bin/clang-cl.exe", + supports_parse_showincludes = True, + target_libc = "ucrt", + target_system_name = "local", + tool_paths = { + "ar": "C:/LLVM/bin/llvm-lib.exe", + "cpp": "C:/LLVM/bin/clang-cl.exe", + "gcc": "C:/LLVM/bin/clang-cl.exe", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "C:/LLVM/bin/lld-link.exe", + "ml": "C:/LLVM/bin/clang-cl.exe", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + toolchain_identifier = "clang_cl_x64", + ) + + cc_toolchain( + name = "windows_clang_cl_cc_toolchain", + all_files = ":empty", + ar_files = ":empty", + as_files = ":empty", + compiler_files = ":empty", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, + toolchain_config = ":windows_clang_cl_config", + toolchain_identifier = "clang_cl_x64", + ) + + native.toolchain( + name = "windows_clang_cl_toolchain", + exec_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + "@bazel_tools//tools/cpp:clang-cl", + ], + toolchain = ":windows_clang_cl_cc_toolchain", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", + ) + + native.toolchain( + name = "windows_msvc_toolchain", + exec_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = ":windows_msvc_cc_toolchain", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", + )